Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
48adc81
Improved explosion logic and particle effects intensity scaling, adde…
Pabilo8 Jul 12, 2026
c230da9
Added advancements for installing Emplacement weapons, updated ModWor…
Pabilo8 Jul 12, 2026
1c99a2d
Added a config option to replace IE crate GUIs with Deco based ones
Pabilo8 Jul 13, 2026
e4c1950
Added punchtape printing functionality to Printing Press and Logistic…
Pabilo8 Jul 15, 2026
2484c97
Fixed DIM not using electricity for sending a packet.
Pabilo8 Jul 15, 2026
c101ac4
Added adapters for IE recipes to be displayed in II manual pages, upd…
Pabilo8 Jul 15, 2026
f08c1de
Refactored event handlers and IE event override
Pabilo8 Jul 16, 2026
dd7b3eb
Added separate handling of block penetration for multiblocks with hit…
Pabilo8 Jul 16, 2026
dcc04e2
Fixed noise shader for smoke particle effects, improved shader error …
Pabilo8 Jul 16, 2026
de42a4d
Fixed applying of contributor skins for weapons on multiplayer servers
Pabilo8 Jul 18, 2026
88e04bb
Refactored Tile Entities for small devices, fixed alarm siren sound r…
Pabilo8 Jul 18, 2026
9bb1348
More tile entity refactoring
Pabilo8 Jul 20, 2026
88c4e61
Fixed timing for mechanical belt animations
Pabilo8 Jul 20, 2026
84e3ab0
Added a safety for loops in data networks, fixed data item NBT handli…
Pabilo8 Jul 21, 2026
9459012
Added wooden harbor blocks, improved Fluidlogged-api compat, added wo…
Pabilo8 Jul 22, 2026
ac133f1
Fixed Vulcanizer capabilities crash with NuclearCraft
Pabilo8 Jul 22, 2026
537aab7
Added integrity checks in OwnerIdentity loading and fixed chunk owner…
Pabilo8 Jul 22, 2026
f2beeab
Improved concrete brick textures
Pabilo8 Jul 27, 2026
fca7e92
Fixed manual not changing resolution if it's opened as a Deco widget …
Pabilo8 Jul 27, 2026
bee01dd
Added faction invitations GUI, reworked flagpole GUI. Miscellaneous D…
Pabilo8 Jul 27, 2026
8f0128f
Fixed Precision Assembler Scheme not differentiating between recipes …
Pabilo8 Jul 27, 2026
a5956d3
Improved handling of mouse events in Deco, improved GL scissoring, so…
Pabilo8 Jul 30, 2026
8ee5af1
Added more frequent machine recipe progress syncing
Pabilo8 Jul 30, 2026
37ad84f
Corrosion, radiation, toxic gas protection, and infrared visibility n…
Pabilo8 Jul 31, 2026
42c39a8
Rebase fixes, reverted opti.sh to the improved version
Pabilo8 Aug 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 11 additions & 4 deletions gradle/tools/opti.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,26 @@ processAudio () {
touch $1.tmp
$LOC_FFMPEG -y -i $1 -f ogg -c:a libvorbis -b:a 120k $1.tmp &
wait
rm $1
mv $1.tmp $1
if [ -s $1.tmp ]
then
rm $1
mv $1.tmp $1
else
echo "Cannot convert file, output is empty."
rm $1.tmp
return;
fi
}

while getopts "ia" arg; do
case $arg in
i)
echo "Processing images..."
for f in $(find ./src/main/resources/assets/immersiveintelligence/textures -name '*.png'); do ./gradle/tools/oxipng $f --zc 9 -f 0-5 --nc --strip all; done
for f in $(find ./src/main/resources/assets/*/textures -name '*.png'); do chmod 644 "$f"; ./gradle/tools/oxipng "$f" --zc 9 -f 0-5 --nc --strip all; done
;;
a)
echo "Processing audio..."
for f in $(find ./src/main/resources/assets/immersiveintelligence/sounds -name '*.ogg'); do processAudio $f; done
for f in $(find ./src/main/resources/assets/*/sounds -name '*.ogg'); do processAudio $f; done
;;
esac
done
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import pl.pabilo8.immersiveintelligence.common.IISaveData;
import pl.pabilo8.immersiveintelligence.common.commands.CommandII;
import pl.pabilo8.immersiveintelligence.common.compat.IICompatModule;
import pl.pabilo8.immersiveintelligence.common.event.IEOverrideEventHandler;
import pl.pabilo8.immersiveintelligence.common.event.LightEngineerEventHandler;
import pl.pabilo8.immersiveintelligence.common.util.IIReflectionUtils;
import pl.pabilo8.immersiveintelligence.common.util.IISkinHandler;
import pl.pabilo8.immersiveintelligence.common.util.diplomacy.DiplomacyHandler;
Expand Down Expand Up @@ -83,18 +81,15 @@ public void preInit(FMLPreInitializationEvent event)
public void init(FMLInitializationEvent event)
{
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, proxy);
new LightEngineerEventHandler().registerEventHandler();
proxy.init(event);
}

@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
proxy.postInit(event);

//Redirecting IE event to our own
//Redirecting IE event handler to our own
IIReflectionUtils.getForgeEventListeners();
IIReflectionUtils.overrideEventHandler(blusunrize.immersiveengineering.common.EventHandler.class, new IEOverrideEventHandler());
}

@Mod.EventHandler
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.util.INBTSerializable;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;
Expand Down Expand Up @@ -99,9 +100,13 @@ else if(packet.has('s'))
//Owner
try
{
IIDataHandlingUtils.optionalString('o', packet)
.map(UUID::fromString)
.ifPresent(uuid -> this.owner = uuid);
if(packet.has('o'))
{
DiplomacyHandler instance = DiplomacyHandler.getInstance(FMLCommonHandler.instance().getEffectiveSide()==Side.CLIENT);
IIDataHandlingUtils.optionalString('o', packet)
.map(instance::getIdentityByName)
.ifPresent(uuid -> this.owner = uuid.getUUID());
}
} catch(IllegalArgumentException ignored) {}
//Color (Paint)
IIDataHandlingUtils.optionalColor('p', packet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static void init()
//Bedrock
registerState(state -> state.getBlock().blockHardness==-1, new PenetrationHandlerInvulnerable(PenetrationHardness.BEDROCK, Integer.MAX_VALUE));
//Fluids
registerState(state -> state.getBlock().blockHardness==-1, new PenetrationHandlerInvulnerable(PenetrationHardness.FOLIAGE, 0f));
registerState(state -> state.getMaterial().isLiquid(), new PenetrationHandlerInvulnerable(PenetrationHardness.FOLIAGE, 0f));

//Fragile metals
registerMetalMaterial(PenetrationHandlerMetal.create("aluminum", PenetrationHardness.FRAGILE, 1.0f, 150f));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ public static void suppress(World world, double posX, double posY, double posZ,
}
}

public static void breakArmour(Entity entity, int damageToArmour)
public static void breakArmor(Entity entity, int damageToArmor)
{
if(entity instanceof EntityLivingBase)
{
EntityLivingBase ent = (EntityLivingBase)entity;
PotionEffect effect = ent.getActivePotionEffect(IIPotions.brokenArmor);
if(effect==null)
effect = new PotionEffect(IIPotions.brokenArmor, 60, damageToArmour, false, false);
effect = new PotionEffect(IIPotions.brokenArmor, 60, damageToArmor, false, false);
else
{
effect.duration = 10;
effect.combine(new PotionEffect(IIPotions.brokenArmor, 60, Math.min(255, effect.getAmplifier()+damageToArmour)));
effect.combine(new PotionEffect(IIPotions.brokenArmor, 60, Math.min(255, effect.getAmplifier()+damageToArmor)));
}
for(ItemStack stack : ent.getArmorInventoryList())
stack.damageItem(damageToArmour, ent);
stack.damageItem(damageToArmor, ent);

ent.addPotionEffect(effect);
}
Expand Down Expand Up @@ -493,7 +493,7 @@ public static float getCombinedDepth(IAmmoType<?, ?> ammoType, CoreType coreType
* @return amount of blocks penetrated by the ammo
*/
public static int getPenetratedAmount(IAmmoType<?, ?> ammoType, AmmoCore coreMaterial, CoreType coreType,
IPenetrationHandler penHandler, PenetrationHardness blockHardness)
IPenetrationHandler penHandler, PenetrationHardness blockHardness)
{
float penetrationDepth = getCombinedDepth(ammoType, coreType);
PenetrationHardness ammoHardness = getCombinedHardness(coreMaterial, coreType);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pl.pabilo8.immersiveintelligence.api.ammo.utils;

import blusunrize.immersiveengineering.common.blocks.TileEntityMultiblockPart;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
Expand All @@ -8,6 +9,10 @@
import pl.pabilo8.immersiveintelligence.common.IIConfigHandler.IIConfig.Graphics;
import pl.pabilo8.immersiveintelligence.common.network.IIPacketHandler;
import pl.pabilo8.immersiveintelligence.common.network.messages.MessageBlockDamageSync;
import pl.pabilo8.immersiveintelligence.common.util.easynbt.SyncNBT.SyncEvents;
import pl.pabilo8.immersiveintelligence.common.util.multiblock.IIMultiblockInterfaces.IDamageResistantMultiblock;
import pl.pabilo8.immersiveintelligence.common.util.multiblock.TileEntityMultiblockIIBase;
import pl.pabilo8.immersiveintelligence.common.util.tile.TileEntityIIBase;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -61,26 +66,53 @@ public static void dealBlockDamage(World world, Vec3d direction, float bulletDam
return;

DamageBlockPos dimensionBlockPos = new DamageBlockPos(pos, world, pen.getIntegrity());
float newHp = getBlockHitpoints(pen, pos, world)-(bulletDamage*pen.getThickness());
if(newHp > 0)
if(world.getTileEntity(pos) instanceof IDamageResistantMultiblock)
{
List<DamageBlockPos> list = blockDamage.stream().filter(damageBlockPos -> damageBlockPos.equals(dimensionBlockPos)).collect(Collectors.toList());
if(!list.isEmpty())
list.forEach(damageBlockPos -> damageBlockPos.damage = newHp);
else
blockDamage.add(new DamageBlockPos(dimensionBlockPos, newHp));

IIPacketHandler.sendToClient(dimensionBlockPos, world,
new MessageBlockDamageSync(new DamageBlockPos(dimensionBlockPos, newHp/(pen.getIntegrity()/pen.getThickness())), direction));
//Damage a multiblock
IDamageResistantMultiblock mb = (IDamageResistantMultiblock)world.getTileEntity(pos);
if(mb instanceof TileEntityMultiblockPart)
mb = (IDamageResistantMultiblock)((TileEntityMultiblockPart<?>)mb).master();
if(mb!=null)
{
if(mb.damageHealth(bulletDamage*pen.getThickness()))
{
world.getBlockState(pos).getBlock().breakBlock(world, pos, world.getBlockState(pos));
world.destroyBlock(dimensionBlockPos, false);
}
else
{
if(mb instanceof TileEntityMultiblockIIBase)
((TileEntityMultiblockIIBase<?>)mb).updateTileForEvent(SyncEvents.TILE_DAMAGED);
else if(mb instanceof TileEntityIIBase)
((TileEntityIIBase)mb).updateTileForEvent(SyncEvents.TILE_DAMAGED);
}
}
}
else if(newHp <= 0)
else
{
blockDamage.removeIf(damageBlockPos -> damageBlockPos.equals(dimensionBlockPos));
world.getBlockState(pos).getBlock().breakBlock(world, pos, world.getBlockState(pos));
world.destroyBlock(dimensionBlockPos, false);
//Proceed with block breaking
float newHp = getBlockHitpoints(pen, pos, world)-(bulletDamage*pen.getThickness());
if(newHp > 0)
{
List<DamageBlockPos> list = blockDamage.stream().filter(damageBlockPos -> damageBlockPos.equals(dimensionBlockPos)).collect(Collectors.toList());
if(!list.isEmpty())
list.forEach(damageBlockPos -> damageBlockPos.damage = newHp);
else
blockDamage.add(new DamageBlockPos(dimensionBlockPos, newHp));

IIPacketHandler.sendToClient(dimensionBlockPos, world,
new MessageBlockDamageSync(new DamageBlockPos(dimensionBlockPos, newHp/(pen.getIntegrity()/pen.getThickness())), direction));
}
else if(newHp <= 0)
{
blockDamage.removeIf(damageBlockPos -> damageBlockPos.equals(dimensionBlockPos));
world.getBlockState(pos).getBlock().breakBlock(world, pos, world.getBlockState(pos));
world.destroyBlock(dimensionBlockPos, false);

IIPacketHandler.sendToClient(dimensionBlockPos, world,
new MessageBlockDamageSync(new DamageBlockPos(dimensionBlockPos, newHp/(pen.getIntegrity()/pen.getThickness())), direction));
IIPacketHandler.sendToClient(dimensionBlockPos, world,
new MessageBlockDamageSync(new DamageBlockPos(dimensionBlockPos, newHp/(pen.getIntegrity()/pen.getThickness())), direction));
}
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package pl.pabilo8.immersiveintelligence.api.api.protection;

import net.minecraft.item.ItemStack;
import net.minecraftforge.items.ItemHandlerHelper;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* Registry and capability query for item corrosion.
*
* @since 24.05.2019
*/
public final class CorrosionHandler
{
private static final List<ItemStack> CORROSION_BLACKLIST = new ArrayList<>();

private CorrosionHandler()
{
}

public static boolean canCorrode(ItemStack stack)
{
if(stack.isEmpty()||ProtectionHandler.isProtectedFromCorrosion(stack))
return false;
return CORROSION_BLACKLIST.stream().noneMatch(blacklisted ->
ItemHandlerHelper.canItemStacksStack(stack, blacklisted));
}

public static void addItemToBlacklist(ItemStack stack)
{
if(!stack.isEmpty())
CORROSION_BLACKLIST.add(stack.copy());
}

public static List<ItemStack> getCorrosionBlacklist()
{
return Collections.unmodifiableList(CORROSION_BLACKLIST);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package pl.pabilo8.immersiveintelligence.api.api.protection;

import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.capabilities.Capability;
import pl.pabilo8.immersiveintelligence.api.api.protection.capability.*;

import javax.annotation.Nullable;
import java.util.function.Predicate;

/**
* Central capability-based handler for radiation, gas, infrared and acid protective equipment.
*
* @author Pabilo8 (pabilo@iiteam.net)
* @ii-approved 0.3.1
* @since 22.07.2026
*/
public final class ProtectionHandler
{
private ProtectionHandler()
{
}

public static boolean isProtectedFromGas(EntityLivingBase entity)
{
return hasPartialArmorProtection(entity, ProtectionCapabilities.GAS_PROTECTION,
IGasProtection::protectsFromGases);
}

public static boolean isInvisibleToInfrared(EntityLivingBase entity)
{
return hasPartialArmorProtection(entity, ProtectionCapabilities.INFRARED_PROTECTION,
IInfraredProtection::isInvisibleToInfrared);
}

public static boolean isProtectedFromAcid(EntityLivingBase entity)
{
return hasCompleteArmorProtection(entity, ProtectionCapabilities.ACID_PROTECTION,
IAcidProtection::protectsFromAcid);
}

public static boolean isProtectedFromRadiation(EntityLivingBase entity)
{
return hasCompleteArmorProtection(entity, ProtectionCapabilities.RADIATION_PROTECTION,
IRadiationProtection::protectsFromRadiation);
}

public static boolean isProtectedFromCorrosion(ItemStack stack)
{
return test(stack, ProtectionCapabilities.CORROSION_PROTECTION, ICorrosionProtection::protectsFromCorrosion);
}

private static <T> boolean hasPartialArmorProtection(EntityLivingBase entity, @Nullable Capability<T> capability,
Predicate<T> predicate)
{
//Check for the entity itself
if(capability!=null&&entity.hasCapability(capability, null)
&&predicate.test(entity.getCapability(capability, null)))
return true;

//Check for armor pieces
for(ItemStack stack : entity.getArmorInventoryList())
if(test(stack, capability, predicate))
return true;
return false;
}

private static <T> boolean hasCompleteArmorProtection(EntityLivingBase entity, @Nullable Capability<T> capability,
Predicate<T> predicate)
{
//Check for the entity itself
if(capability!=null&&entity.hasCapability(capability, null)
&&predicate.test(entity.getCapability(capability, null)))
return true;

//Check for armor pieces
for(ItemStack stack : entity.getArmorInventoryList())
if(!test(stack, capability, predicate))
return false;
return true;
}

private static <T> boolean test(ItemStack stack, @Nullable Capability<T> capability, Predicate<T> predicate)
{
if(stack.isEmpty()||capability==null||!stack.hasCapability(capability, null))
return false;
T value = stack.getCapability(capability, null);
return value!=null&&predicate.test(value);
}
}
Loading
Loading