Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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
// -----------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> 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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public void getDrops(NonNullList<ItemStack> 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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -473,6 +474,14 @@ public void breakDummies(BlockPos pos, IBlockState state)
}
}

// === ICacheData ===

@Override
public Object[] getCacheData()
{
return new Object[]{ getClass().getName() };
}

// === IBlockBounds ===

@Override
Expand Down