Fixed up the Tile Entity mess a bit, still need to look at the CableBus stuff a bit though.

This commit is contained in:
Gunther De Wachter
2017-06-30 17:22:06 +02:00
parent 10e050c35b
commit 49a6df5bc7
44 changed files with 167 additions and 77 deletions
@@ -112,7 +112,8 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return 0;
}
protected void setTileEntity( final Class<? extends AEBaseTile> c )
// TODO : Was this change needed?
public void setTileEntity( final Class<? extends AEBaseTile> c )
{
this.tileEntityType = c;
this.setInventory( IInventory.class.isAssignableFrom( c ) );
@@ -47,7 +47,6 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
public BlockCraftingMonitor()
{
super( CraftingUnitType.MONITOR );
this.setTileEntity( TileCraftingMonitorTile.class );
}
@Override
@@ -28,7 +28,6 @@ public class BlockCraftingStorage extends BlockCraftingUnit
public BlockCraftingStorage( final CraftingUnitType type )
{
super( type );
this.setTileEntity( TileCraftingStorageTile.class );
}
}
@@ -60,7 +60,6 @@ public class BlockCraftingUnit extends AEBaseTileBlock
super( Material.IRON );
this.type = type;
this.setTileEntity( TileCraftingTile.class );
}
@Override
@@ -49,7 +49,6 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileMolecularAssembler.class );
this.setOpaque( false );
this.lightOpacity = 1;
}
@@ -48,7 +48,6 @@ public class BlockCrank extends AEBaseTileBlock
{
super( Material.WOOD );
this.setTileEntity( TileCrank.class );
this.setLightOpacity( 0 );
this.setHarvestLevel( "axe", 0 );
this.setFullSize( this.setOpaque( false ) );
@@ -42,7 +42,6 @@ public class BlockGrinder extends AEBaseTileBlock
{
super( Material.ROCK );
this.setTileEntity( TileGrinder.class );
this.setHardness( 3.2F );
}
@@ -41,8 +41,6 @@ public class BlockCellWorkbench extends AEBaseTileBlock
public BlockCellWorkbench()
{
super( Material.IRON );
this.setTileEntity( TileCellWorkbench.class );
}
@Override
@@ -66,7 +66,6 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
super( Material.IRON );
this.setTileEntity( TileCharger.class );
this.setLightOpacity( 2 );
this.setFullSize( this.setOpaque( false ) );
}
@@ -42,8 +42,6 @@ public class BlockCondenser extends AEBaseTileBlock
public BlockCondenser()
{
super( Material.IRON );
this.setTileEntity( TileCondenser.class );
}
@Override
@@ -44,7 +44,6 @@ public class BlockInscriber extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileInscriber.class );
this.setLightOpacity( 2 );
this.setFullSize( this.setOpaque( false ) );
}
@@ -49,8 +49,6 @@ public class BlockInterface extends AEBaseTileBlock
public BlockInterface()
{
super( Material.IRON );
this.setTileEntity( TileInterface.class );
}
@Override
@@ -63,8 +63,6 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
this.setTileEntity( TileLightDetector.class );
}
@Override
@@ -52,7 +52,6 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
{
super( Material.ROCK );
this.setSoundType( SoundType.METAL );
this.setTileEntity( TileQuartzGrowthAccelerator.class );
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
}
@@ -49,7 +49,6 @@ public class BlockSecurityStation extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileSecurityStation.class );
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
}
@@ -49,7 +49,6 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
public BlockSkyCompass()
{
super( Material.CIRCUITS );
this.setTileEntity( TileSkyCompass.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
@@ -53,7 +53,6 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
public BlockVibrationChamber()
{
super( Material.IRON );
this.setTileEntity( TileVibrationChamber.class );
this.setHardness( 4.2F );
this.setDefaultState( getDefaultState().withProperty( ACTIVE, false ) );
}
@@ -100,7 +100,6 @@ public class BlockCableBus extends AEBaseTileBlock
// this will actually be overwritten later through setupTile and the
// combined layers
this.setTileEntity( TileCableBus.class );
}
@Override
@@ -387,20 +386,22 @@ public class BlockCableBus extends AEBaseTileBlock
{
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
this.setTileEntity( noTesrTile );
// TODO: Change after transition phase
Platform.registerTileEntityWithAlternatives( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus", "BlockCableBus" );
if( Platform.isClient() )
{
setupTesr();
}
else
{
GameRegistry.registerTileEntity( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus" );
}
}
@SideOnly( Side.CLIENT )
private static void setupTesr()
{
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
// TODO: Change after transition phase
Platform.registerTileEntityWithAlternatives( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus", "ClientOnly_TESR_CableBus" );
GameRegistry.registerTileEntity( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus" );
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
}
@@ -73,7 +73,6 @@ public class BlockController extends AEBaseTileBlock
public BlockController()
{
super( Material.IRON );
this.setTileEntity( TileController.class );
this.setHardness( 6 );
this.setDefaultState( getDefaultState()
.withProperty( CONTROLLER_STATE, ControllerBlockState.offline )
@@ -29,6 +29,5 @@ public class BlockCreativeEnergyCell extends AEBaseTileBlock
public BlockCreativeEnergyCell()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileCreativeEnergyCell.class );
}
}
@@ -26,7 +26,7 @@ public class BlockDenseEnergyCell extends BlockEnergyCell
public BlockDenseEnergyCell()
{
this.setTileEntity( TileDenseEnergyCell.class );
}
@Override
@@ -31,6 +31,5 @@ public class BlockEnergyAcceptor extends AEBaseTileBlock
public BlockEnergyAcceptor()
{
super( Material.IRON );
this.setTileEntity( TileEnergyAcceptor.class );
}
}
@@ -56,8 +56,6 @@ public class BlockEnergyCell extends AEBaseTileBlock
public BlockEnergyCell()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileEnergyCell.class );
}
@Override
@@ -66,7 +66,6 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
public BlockWireless()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileWireless.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
@@ -58,7 +58,6 @@ public class BlockPaint extends AEBaseTileBlock
{
super( new MaterialLiquid( MapColor.AIR ) );
this.setTileEntity( TilePaint.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
@@ -48,7 +48,6 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
public BlockQuantumBase( final Material mat )
{
super( mat );
this.setTileEntity( TileQuantumBridge.class );
final float shave = 2.0f / 16.0f;
this.boundingBox = new AxisAlignedBB( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
@@ -43,7 +43,6 @@ public class BlockSpatialIOPort extends AEBaseTileBlock
public BlockSpatialIOPort()
{
super( Material.IRON );
this.setTileEntity( TileSpatialIOPort.class );
}
@Override
@@ -44,7 +44,6 @@ public class BlockSpatialPylon extends AEBaseTileBlock
public BlockSpatialPylon()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileSpatialPylon.class );
}
@Override
@@ -52,7 +52,6 @@ public class BlockChest extends AEBaseTileBlock
public BlockChest()
{
super( Material.IRON );
this.setTileEntity( TileChest.class );
this.setDefaultState( getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
}
@@ -52,7 +52,6 @@ public class BlockDrive extends AEBaseTileBlock
public BlockDrive()
{
super( Material.IRON );
this.setTileEntity( TileDrive.class );
}
@Override
@@ -44,7 +44,6 @@ public class BlockIOPort extends AEBaseTileBlock
public BlockIOPort()
{
super( Material.IRON );
this.setTileEntity( TileIOPort.class );
}
@Override
@@ -61,7 +61,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
public BlockSkyChest( final SkyChestType type )
{
super( Material.ROCK );
this.setTileEntity( TileSkyChest.class );
this.setOpaque( this.setFullSize( false ) );
this.lightOpacity = 0;
this.setHardness( 50 );