diff --git a/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/BlockCutoffSwitchBase.java b/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/BlockCutoffSwitchBase.java index 159bcf4..eb72e62 100644 --- a/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/BlockCutoffSwitchBase.java +++ b/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/BlockCutoffSwitchBase.java @@ -140,7 +140,7 @@ protected BlockStateContainer createBlockState() { return new ExtendedBlockState(this, new IProperty[]{ FACING, ACTIVE }, - new IUnlistedProperty[]{ IEProperties.CONNECTIONS }); + new IUnlistedProperty[]{ IEProperties.CONNECTIONS, IEProperties.TILEENTITY_PASSTHROUGH }); } @Override @@ -151,9 +151,10 @@ public IBlockState getExtendedState(IBlockState state, IBlockAccess world, Block TileEntity te = world.getTileEntity(pos); if (te instanceof TileEntityImmersiveConnectable) { - state = ((IExtendedBlockState) state).withProperty( - IEProperties.CONNECTIONS, - ((TileEntityImmersiveConnectable) te).genConnBlockstate()); + state = ((IExtendedBlockState) state) + .withProperty(IEProperties.CONNECTIONS, + ((TileEntityImmersiveConnectable) te).genConnBlockstate()) + .withProperty(IEProperties.TILEENTITY_PASSTHROUGH, te); } } return state; diff --git a/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/TileEntityCutoffSwitch.java b/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/TileEntityCutoffSwitch.java index f387d31..cd86dd4 100644 --- a/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/TileEntityCutoffSwitch.java +++ b/src/main/java/com/micatechnologies/realgrid/blocks/cutoffs/TileEntityCutoffSwitch.java @@ -7,6 +7,7 @@ import blusunrize.immersiveengineering.api.energy.wires.TileEntityImmersiveConnectable; import blusunrize.immersiveengineering.api.energy.wires.WireType; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IBlockBounds; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.ICacheData; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IHammerInteraction; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IRedstoneOutput; @@ -30,7 +31,7 @@ * mirroring the IE MV/LV Breaker Switch model across all three voltage tiers. */ public class TileEntityCutoffSwitch extends TileEntityImmersiveConnectable - implements IDirectionalTile, IBlockBounds, IHammerInteraction, IRedstoneOutput, ITickable { + implements IDirectionalTile, IBlockBounds, ICacheData, IHammerInteraction, IRedstoneOutput, ITickable { // ----------------------------------------------------------------------- // Constants @@ -407,6 +408,14 @@ public void readCustomNBT(NBTTagCompound nbt, boolean descPacket) { public Vec3d getConnectionOffset(Connection con) { return new Vec3d(0.5, 0.5, 0.5); } // ----------------------------------------------------------------------- + // ICacheData + + @Override + public Object[] getCacheData() + { + return new Object[]{ getClass().getName() }; + } + // IDirectionalTile // ----------------------------------------------------------------------- diff --git a/src/main/java/com/micatechnologies/realgrid/blocks/insulators/BlockInsulatorBase.java b/src/main/java/com/micatechnologies/realgrid/blocks/insulators/BlockInsulatorBase.java index 7807c7f..fedb6fc 100644 --- a/src/main/java/com/micatechnologies/realgrid/blocks/insulators/BlockInsulatorBase.java +++ b/src/main/java/com/micatechnologies/realgrid/blocks/insulators/BlockInsulatorBase.java @@ -80,7 +80,8 @@ public void getSubBlocks(CreativeTabs tab, NonNullList items) @Override protected BlockStateContainer createBlockState() { - return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{IEProperties.CONNECTIONS}); + return new ExtendedBlockState(this, new IProperty[]{FACING}, + new IUnlistedProperty[]{IEProperties.CONNECTIONS, IEProperties.TILEENTITY_PASSTHROUGH}); } @Override @@ -91,8 +92,10 @@ public IBlockState getExtendedState(IBlockState state, IBlockAccess world, Block TileEntity te = world.getTileEntity(pos); if (te instanceof TileEntityImmersiveConnectable) { - state = ((IExtendedBlockState) state).withProperty(IEProperties.CONNECTIONS, - ((TileEntityImmersiveConnectable) te).genConnBlockstate()); + state = ((IExtendedBlockState) state) + .withProperty(IEProperties.CONNECTIONS, + ((TileEntityImmersiveConnectable) te).genConnBlockstate()) + .withProperty(IEProperties.TILEENTITY_PASSTHROUGH, te); } } return state; diff --git a/src/main/java/com/micatechnologies/realgrid/blocks/insulators/TileEntityInsulatorBase.java b/src/main/java/com/micatechnologies/realgrid/blocks/insulators/TileEntityInsulatorBase.java index 8731c18..7cb5327 100644 --- a/src/main/java/com/micatechnologies/realgrid/blocks/insulators/TileEntityInsulatorBase.java +++ b/src/main/java/com/micatechnologies/realgrid/blocks/insulators/TileEntityInsulatorBase.java @@ -7,6 +7,7 @@ import blusunrize.immersiveengineering.api.energy.wires.TileEntityImmersiveConnectable; import blusunrize.immersiveengineering.api.energy.wires.WireType; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IBlockBounds; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.ICacheData; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -23,7 +24,7 @@ * color-variant blocks can share this base without a separate class tier. */ public abstract class TileEntityInsulatorBase extends TileEntityImmersiveConnectable - implements IDirectionalTile, IBlockBounds + implements IDirectionalTile, IBlockBounds, ICacheData { public EnumFacing facing = EnumFacing.NORTH; public int colorVariant = 0; @@ -155,6 +156,14 @@ public void onBlockDestroyed() limitType = null; } + // === ICacheData === + + @Override + public Object[] getCacheData() + { + return new Object[]{ getClass().getName() }; + } + // === IDirectionalTile === @Override public EnumFacing getFacing() { return facing; } diff --git a/src/main/java/com/micatechnologies/realgrid/blocks/transformers/BlockRealTransformerBase.java b/src/main/java/com/micatechnologies/realgrid/blocks/transformers/BlockRealTransformerBase.java index 2ecf94a..8b27c7b 100644 --- a/src/main/java/com/micatechnologies/realgrid/blocks/transformers/BlockRealTransformerBase.java +++ b/src/main/java/com/micatechnologies/realgrid/blocks/transformers/BlockRealTransformerBase.java @@ -105,7 +105,8 @@ public void getDrops(NonNullList drops, IBlockAccess world, @Override protected BlockStateContainer createBlockState() { - return new ExtendedBlockState(this, new IProperty[]{FACING, DUMMY}, new IUnlistedProperty[]{IEProperties.CONNECTIONS}); + return new ExtendedBlockState(this, new IProperty[]{FACING, DUMMY}, + new IUnlistedProperty[]{IEProperties.CONNECTIONS, IEProperties.TILEENTITY_PASSTHROUGH}); } @Override @@ -116,8 +117,10 @@ public IBlockState getExtendedState(IBlockState state, IBlockAccess world, Block TileEntity te = world.getTileEntity(pos); if (te instanceof TileEntityImmersiveConnectable) { - state = ((IExtendedBlockState) state).withProperty(IEProperties.CONNECTIONS, - ((TileEntityImmersiveConnectable) te).genConnBlockstate()); + state = ((IExtendedBlockState) state) + .withProperty(IEProperties.CONNECTIONS, + ((TileEntityImmersiveConnectable) te).genConnBlockstate()) + .withProperty(IEProperties.TILEENTITY_PASSTHROUGH, te); } } return state; diff --git a/src/main/java/com/micatechnologies/realgrid/blocks/transformers/TileEntityRealTransformer.java b/src/main/java/com/micatechnologies/realgrid/blocks/transformers/TileEntityRealTransformer.java index 4e9bd2a..e6f5777 100644 --- a/src/main/java/com/micatechnologies/realgrid/blocks/transformers/TileEntityRealTransformer.java +++ b/src/main/java/com/micatechnologies/realgrid/blocks/transformers/TileEntityRealTransformer.java @@ -7,9 +7,10 @@ import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.Connection; import blusunrize.immersiveengineering.api.energy.wires.TileEntityImmersiveConnectable; import blusunrize.immersiveengineering.api.energy.wires.WireType; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IBlockBounds; +import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.ICacheData; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IHasDummyBlocks; -import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IBlockBounds; import com.google.common.collect.ImmutableSet; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -30,7 +31,7 @@ * - Index 2: second HV connection (STEEL only, 2-wire variants only) */ public abstract class TileEntityRealTransformer extends TileEntityImmersiveConnectable - implements IDirectionalTile, IHasDummyBlocks, IBlockBounds + implements IDirectionalTile, IHasDummyBlocks, IBlockBounds, ICacheData { public EnumFacing facing = EnumFacing.NORTH; public int dummy = 0; @@ -473,6 +474,14 @@ public void breakDummies(BlockPos pos, IBlockState state) } } + // === ICacheData === + + @Override + public Object[] getCacheData() + { + return new Object[]{ getClass().getName() }; + } + // === IBlockBounds === @Override