Fixed up the Tile Entity mess a bit, still need to look at the CableBus stuff a bit though.
This commit is contained in:
parent
10e050c35b
commit
49a6df5bc7
|
@ -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 );
|
||||
|
|
|
@ -74,6 +74,8 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||
|
||||
private CreativeTabs creativeTab = CreativeTab.instance;
|
||||
|
||||
private Class<? extends AEBaseTile> teClass;
|
||||
|
||||
private boolean disableItem = false;
|
||||
|
||||
private Function<Block, ItemBlock> itemFactory;
|
||||
|
@ -144,6 +146,12 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockBuilder tileEntity(Class<? extends AEBaseTile> tileEntityClass) {
|
||||
teClass = tileEntityClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockBuilder useCustomItemModel()
|
||||
{
|
||||
|
@ -222,6 +230,9 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||
if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
||||
// Fallback?
|
||||
if ( teClass != null )
|
||||
tileBlock.setTileEntity( teClass );
|
||||
blockRendering.apply( factory, block, tileBlock.getTileEntityClass() );
|
||||
}
|
||||
else
|
||||
|
@ -238,13 +249,14 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
|||
if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
||||
if( teClass != null )
|
||||
tileBlock.setTileEntity( teClass );
|
||||
|
||||
factory.addPreInit( side -> {
|
||||
Class<? extends AEBaseTile> tileEntityClass = tileBlock.getTileEntityClass();
|
||||
AEBaseTile.registerTileItem( tileEntityClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
||||
AEBaseTile.registerTileItem( teClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
||||
|
||||
// TODO: Change after transition phase
|
||||
Platform.registerTileEntityWithAlternatives( tileEntityClass, AppEng.MOD_ID.toLowerCase() + ":" + registryName, registryName );
|
||||
GameRegistry.registerTileEntity( teClass, AppEng.MOD_ID.toLowerCase() + ":" + registryName);
|
||||
} );
|
||||
|
||||
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
|
||||
|
|
|
@ -22,6 +22,7 @@ package appeng.bootstrap;
|
|||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import appeng.tile.AEBaseTile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
@ -45,6 +46,8 @@ public interface IBlockBuilder
|
|||
|
||||
IBlockBuilder rendering( BlockRenderingCustomizer callback );
|
||||
|
||||
IBlockBuilder tileEntity( Class<? extends AEBaseTile> teClass );
|
||||
|
||||
/**
|
||||
* Don't register an item for this block.
|
||||
*/
|
||||
|
|
|
@ -19,6 +19,41 @@
|
|||
package appeng.core.api.definitions;
|
||||
|
||||
|
||||
import appeng.debug.TileChunkLoader;
|
||||
import appeng.debug.TileCubeGenerator;
|
||||
import appeng.debug.TileItemGen;
|
||||
import appeng.debug.TilePhantomNode;
|
||||
import appeng.tile.crafting.TileCraftingMonitorTile;
|
||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.tile.grindstone.TileCrank;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
import appeng.tile.misc.TileCellWorkbench;
|
||||
import appeng.tile.misc.TileCharger;
|
||||
import appeng.tile.misc.TileCondenser;
|
||||
import appeng.tile.misc.TileInscriber;
|
||||
import appeng.tile.misc.TileInterface;
|
||||
import appeng.tile.misc.TileLightDetector;
|
||||
import appeng.tile.misc.TilePaint;
|
||||
import appeng.tile.misc.TileQuartzGrowthAccelerator;
|
||||
import appeng.tile.misc.TileSecurityStation;
|
||||
import appeng.tile.misc.TileSkyCompass;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.networking.TileController;
|
||||
import appeng.tile.networking.TileCreativeEnergyCell;
|
||||
import appeng.tile.networking.TileDenseEnergyCell;
|
||||
import appeng.tile.networking.TileEnergyAcceptor;
|
||||
import appeng.tile.networking.TileEnergyCell;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import com.google.common.base.Verify;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -251,32 +286,39 @@ public final class ApiBlocks implements IBlocks
|
|||
|
||||
this.skyStoneChest = registry.block( "sky_stone_chest", () -> new BlockSkyChest( SkyChestType.STONE ) )
|
||||
.features( AEFeature.SKY_STONE_CHESTS )
|
||||
.tileEntity( TileSkyChest.Stone.class )
|
||||
.rendering( new SkyChestRenderingCustomizer( SkyChestType.STONE ) )
|
||||
.build();
|
||||
this.smoothSkyStoneChest = registry.block( "smooth_sky_stone_chest", () -> new BlockSkyChest( SkyChestType.BLOCK ) )
|
||||
.features( AEFeature.SKY_STONE_CHESTS )
|
||||
.tileEntity( TileSkyChest.Smooth.class )
|
||||
.rendering( new SkyChestRenderingCustomizer( SkyChestType.BLOCK ) )
|
||||
.build();
|
||||
|
||||
this.skyCompass = registry.block( "sky_compass", BlockSkyCompass::new )
|
||||
.features( AEFeature.METEORITE_COMPASS )
|
||||
.tileEntity( TileSkyCompass.class )
|
||||
.rendering( new SkyCompassRendering() )
|
||||
.build();
|
||||
this.grindstone = registry.block( "grindstone", BlockGrinder::new ).features( AEFeature.GRIND_STONE ).build();
|
||||
this.grindstone = registry.block( "grindstone", BlockGrinder::new ).features( AEFeature.GRIND_STONE ).tileEntity( TileGrinder.class ).build();
|
||||
this.crank = registry.block( "crank", BlockCrank::new )
|
||||
.features( AEFeature.GRIND_STONE )
|
||||
.tileEntity( TileCrank.class )
|
||||
.rendering( new CrankRendering() )
|
||||
.build();
|
||||
this.inscriber = registry.block( "inscriber", BlockInscriber::new )
|
||||
.features( AEFeature.INSCRIBER )
|
||||
.tileEntity( TileInscriber.class )
|
||||
.rendering( new InscriberRendering() )
|
||||
.build();
|
||||
this.wirelessAccessPoint = registry.block( "wireless_access_point", BlockWireless::new )
|
||||
.features( AEFeature.WIRELESS_ACCESS_TERMINAL )
|
||||
.tileEntity( TileWireless.class )
|
||||
.rendering( new WirelessRendering() )
|
||||
.build();
|
||||
this.charger = registry.block( "charger", BlockCharger::new )
|
||||
.features( AEFeature.CHARGER )
|
||||
.tileEntity( TileCharger.class )
|
||||
.rendering( new BlockRenderingCustomizer()
|
||||
{
|
||||
@Override
|
||||
|
@ -296,102 +338,122 @@ public final class ApiBlocks implements IBlocks
|
|||
.build();
|
||||
this.securityStation = registry.block( "security_station", BlockSecurityStation::new )
|
||||
.features( AEFeature.SECURITY )
|
||||
.tileEntity( TileSecurityStation.class )
|
||||
.rendering( new SecurityStationRendering() )
|
||||
.build();
|
||||
this.quantumRing = registry.block( "quantum_ring", BlockQuantumRing::new )
|
||||
.features( AEFeature.QUANTUM_NETWORK_BRIDGE )
|
||||
.tileEntity( TileQuantumBridge.TileQuantumBridgeRing.class )
|
||||
.rendering( new QuantumBridgeRendering() )
|
||||
.build();
|
||||
this.quantumLink = registry.block( "quantum_link", BlockQuantumLinkChamber::new )
|
||||
.features( AEFeature.QUANTUM_NETWORK_BRIDGE )
|
||||
.tileEntity( TileQuantumBridge.TileQuantumBridgeGlass.class )
|
||||
.rendering( new QuantumBridgeRendering() )
|
||||
.build();
|
||||
this.spatialPylon = registry.block( "spatial_pylon", BlockSpatialPylon::new )
|
||||
.features( AEFeature.SPATIAL_IO )
|
||||
.tileEntity( TileSpatialPylon.class )
|
||||
.useCustomItemModel()
|
||||
.rendering( new SpatialPylonRendering() )
|
||||
.build();
|
||||
this.spatialIOPort = registry.block( "spatial_io_port", BlockSpatialIOPort::new ).features( AEFeature.SPATIAL_IO ).build();
|
||||
this.spatialIOPort = registry.block( "spatial_io_port", BlockSpatialIOPort::new ).features( AEFeature.SPATIAL_IO ).tileEntity( TileSpatialIOPort.class ).build();
|
||||
this.controller = registry.block( "controller", BlockController::new )
|
||||
.features( AEFeature.CHANNELS )
|
||||
.tileEntity( TileController.class )
|
||||
.useCustomItemModel()
|
||||
.rendering( new ControllerRendering() )
|
||||
.build();
|
||||
this.drive = registry.block( "drive", BlockDrive::new )
|
||||
.features( AEFeature.STORAGE_CELLS, AEFeature.ME_DRIVE )
|
||||
.tileEntity( TileDrive.class )
|
||||
.useCustomItemModel()
|
||||
.rendering( new DriveRendering() )
|
||||
.build();
|
||||
this.chest = registry.block( "chest", BlockChest::new )
|
||||
.features( AEFeature.STORAGE_CELLS, AEFeature.ME_CHEST )
|
||||
.tileEntity( TileChest.class )
|
||||
.useCustomItemModel()
|
||||
.rendering( new ChestRendering() )
|
||||
.build();
|
||||
this.iface = registry.block( "interface", BlockInterface::new ).features( AEFeature.INTERFACE ).build();
|
||||
this.cellWorkbench = registry.block( "cell_workbench", BlockCellWorkbench::new ).features( AEFeature.STORAGE_CELLS ).build();
|
||||
this.iOPort = registry.block( "io_port", BlockIOPort::new ).features( AEFeature.STORAGE_CELLS, AEFeature.IO_PORT ).build();
|
||||
this.condenser = registry.block( "condenser", BlockCondenser::new ).features( AEFeature.CONDENSER ).build();
|
||||
this.energyAcceptor = registry.block( "energy_acceptor", BlockEnergyAcceptor::new ).features( AEFeature.ENERGY_ACCEPTOR ).build();
|
||||
this.vibrationChamber = registry.block( "vibration_chamber", BlockVibrationChamber::new ).features( AEFeature.POWER_GEN ).build();
|
||||
this.iface = registry.block( "interface", BlockInterface::new ).features( AEFeature.INTERFACE ).tileEntity( TileInterface.class ).build();
|
||||
this.cellWorkbench = registry.block( "cell_workbench", BlockCellWorkbench::new ).features( AEFeature.STORAGE_CELLS ).tileEntity( TileCellWorkbench.class ).build();
|
||||
this.iOPort = registry.block( "io_port", BlockIOPort::new ).features( AEFeature.STORAGE_CELLS, AEFeature.IO_PORT ).tileEntity( TileIOPort.class ).build();
|
||||
this.condenser = registry.block( "condenser", BlockCondenser::new ).features( AEFeature.CONDENSER ).tileEntity( TileCondenser.class ).build();
|
||||
this.energyAcceptor = registry.block( "energy_acceptor", BlockEnergyAcceptor::new ).features( AEFeature.ENERGY_ACCEPTOR ).tileEntity( TileEnergyAcceptor.class ).build();
|
||||
this.vibrationChamber = registry.block( "vibration_chamber", BlockVibrationChamber::new ).features( AEFeature.POWER_GEN ).tileEntity( TileVibrationChamber.class ).build();
|
||||
this.quartzGrowthAccelerator = registry.block( "quartz_growth_accelerator", BlockQuartzGrowthAccelerator::new )
|
||||
.tileEntity( TileQuartzGrowthAccelerator.class )
|
||||
.features( AEFeature.CRYSTAL_GROWTH_ACCELERATOR )
|
||||
.build();
|
||||
this.energyCell = registry.block( "energy_cell", BlockEnergyCell::new )
|
||||
.features( AEFeature.ENERGY_CELLS )
|
||||
.item( AEBaseItemBlockChargeable::new )
|
||||
.tileEntity( TileEnergyCell.class )
|
||||
.rendering( new BlockEnergyCellRendering( new ResourceLocation( AppEng.MOD_ID, "energy_cell" ) ) )
|
||||
.build();
|
||||
this.energyCellDense = registry.block( "dense_energy_cell", BlockDenseEnergyCell::new )
|
||||
.features( AEFeature.ENERGY_CELLS, AEFeature.DENSE_ENERGY_CELLS )
|
||||
.item( AEBaseItemBlockChargeable::new )
|
||||
.tileEntity( TileDenseEnergyCell.class )
|
||||
.rendering( new BlockEnergyCellRendering( new ResourceLocation( AppEng.MOD_ID, "dense_energy_cell" ) ) )
|
||||
.build();
|
||||
this.energyCellCreative = registry.block( "creative_energy_cell", BlockCreativeEnergyCell::new )
|
||||
.features( AEFeature.CREATIVE )
|
||||
.item( AEBaseItemBlockChargeable::new )
|
||||
.tileEntity( TileCreativeEnergyCell.class )
|
||||
.build();
|
||||
|
||||
FeatureFactory crafting = registry.features( AEFeature.CRAFTING_CPU );
|
||||
this.craftingUnit = crafting.block( "crafting_unit", () -> new BlockCraftingUnit( CraftingUnitType.UNIT ) )
|
||||
.rendering( new CraftingCubeRendering( "crafting_unit", CraftingUnitType.UNIT ) )
|
||||
.tileEntity( TileCraftingTile.class )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.craftingAccelerator = crafting.block( "crafting_accelerator", () -> new BlockCraftingUnit( CraftingUnitType.ACCELERATOR ) )
|
||||
.rendering( new CraftingCubeRendering( "crafting_accelerator", CraftingUnitType.ACCELERATOR ) )
|
||||
.tileEntity( TileCraftingTile.TileCraftingTileAccelerator.class )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.craftingStorage1k = crafting.block( "crafting_storage_1k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_1K ) )
|
||||
.item( ItemCraftingStorage::new )
|
||||
.tileEntity( TileCraftingStorageTile.TileCraftingStorageTile1k.class )
|
||||
.rendering( new CraftingCubeRendering( "crafting_storage_1k", CraftingUnitType.STORAGE_1K ) )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.craftingStorage4k = crafting.block( "crafting_storage_4k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_4K ) )
|
||||
.item( ItemCraftingStorage::new )
|
||||
.tileEntity( TileCraftingStorageTile.TileCraftingStorageTile4k.class )
|
||||
.rendering( new CraftingCubeRendering( "crafting_storage_4k", CraftingUnitType.STORAGE_4K ) )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.craftingStorage16k = crafting.block( "crafting_storage_16k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_16K ) )
|
||||
.item( ItemCraftingStorage::new )
|
||||
.tileEntity( TileCraftingStorageTile.TileCraftingStorageTile16k.class )
|
||||
.rendering( new CraftingCubeRendering( "crafting_storage_16k", CraftingUnitType.STORAGE_16K ) )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.craftingStorage64k = crafting.block( "crafting_storage_64k", () -> new BlockCraftingStorage( CraftingUnitType.STORAGE_64K ) )
|
||||
.item( ItemCraftingStorage::new )
|
||||
.tileEntity( TileCraftingStorageTile.TileCraftingStorageTile64k.class )
|
||||
.rendering( new CraftingCubeRendering( "crafting_storage_64k", CraftingUnitType.STORAGE_64K ) )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.craftingMonitor = crafting.block( "crafting_monitor", BlockCraftingMonitor::new )
|
||||
.tileEntity( TileCraftingMonitorTile.class )
|
||||
.rendering( new CraftingCubeRendering( "crafting_monitor", CraftingUnitType.MONITOR ) )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
|
||||
this.molecularAssembler = registry.block( "molecular_assembler", BlockMolecularAssembler::new ).features( AEFeature.MOLECULAR_ASSEMBLER ).build();
|
||||
this.molecularAssembler = registry.block( "molecular_assembler", BlockMolecularAssembler::new ).features( AEFeature.MOLECULAR_ASSEMBLER ).tileEntity( TileMolecularAssembler.class ).build();
|
||||
this.lightDetector = registry.block( "light_detector", BlockLightDetector::new )
|
||||
.features( AEFeature.LIGHT_DETECTOR )
|
||||
.tileEntity( TileLightDetector.class )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.paint = registry.block( "paint", BlockPaint::new )
|
||||
.features( AEFeature.PAINT_BALLS )
|
||||
.tileEntity( TilePaint.class )
|
||||
.rendering( new PaintRendering() )
|
||||
.build();
|
||||
|
||||
|
@ -406,6 +468,7 @@ public final class ApiBlocks implements IBlocks
|
|||
|
||||
this.multiPart = registry.block( "cable_bus", BlockCableBus::new )
|
||||
.rendering( new CableBusRendering( partModels ) )
|
||||
.tileEntity( TileCableBus.class )
|
||||
.postInit( ( block, item ) ->
|
||||
{
|
||||
( (BlockCableBus) block ).setupTile();
|
||||
|
@ -423,18 +486,22 @@ public final class ApiBlocks implements IBlocks
|
|||
|
||||
this.itemGen = registry.block( "debug_item_gen", BlockItemGen::new )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.tileEntity( TileItemGen.class )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.chunkLoader = registry.block( "debug_chunk_loader", BlockChunkloader::new )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.tileEntity( TileChunkLoader.class )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.phantomNode = registry.block( "debug_phantom_node", BlockPhantomNode::new )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.tileEntity( TilePhantomNode.class )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
this.cubeGenerator = registry.block( "debug_cube_gen", BlockCubeGenerator::new )
|
||||
.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE )
|
||||
.tileEntity( TileCubeGenerator.class )
|
||||
.useCustomItemModel()
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ public class BlockChunkloader extends AEBaseTileBlock implements LoadingCallback
|
|||
public BlockChunkloader()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileChunkLoader.class );
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback( AppEng.instance(), this );
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@ public class BlockCubeGenerator extends AEBaseTileBlock
|
|||
public BlockCubeGenerator()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileCubeGenerator.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,6 @@ public class BlockItemGen extends AEBaseTileBlock
|
|||
public BlockItemGen()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TileItemGen.class );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ public class BlockPhantomNode extends AEBaseTileBlock
|
|||
public BlockPhantomNode()
|
||||
{
|
||||
super( Material.IRON );
|
||||
this.setTileEntity( TilePhantomNode.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,34 @@ public class TileCraftingStorageTile extends TileCraftingTile
|
|||
{
|
||||
private static final int KILO_SCALAR = 1024;
|
||||
|
||||
public static class TileCraftingStorageTile1k extends TileCraftingTile
|
||||
{
|
||||
public TileCraftingStorageTile1k() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileCraftingStorageTile4k extends TileCraftingTile
|
||||
{
|
||||
public TileCraftingStorageTile4k() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileCraftingStorageTile16k extends TileCraftingTile
|
||||
{
|
||||
public TileCraftingStorageTile16k() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileCraftingStorageTile64k extends TileCraftingTile
|
||||
{
|
||||
public TileCraftingStorageTile64k() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemStack getItemFromTile( final Object obj )
|
||||
{
|
||||
|
|
|
@ -60,6 +60,13 @@ import appeng.util.Platform;
|
|||
public class TileCraftingTile extends AENetworkTile implements IAEMultiBlock, IPowerChannelState
|
||||
{
|
||||
|
||||
public static class TileCraftingTileAccelerator extends TileCraftingTile
|
||||
{
|
||||
public TileCraftingTileAccelerator() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
private final CraftingCPUCalculator calc = new CraftingCPUCalculator( this );
|
||||
private NBTTagCompound previousState = null;
|
||||
private boolean isCoreBlock = false;
|
||||
|
|
|
@ -55,6 +55,21 @@ import appeng.util.Platform;
|
|||
|
||||
public class TileQuantumBridge extends AENetworkInvTile implements IAEMultiBlock, ITickable
|
||||
{
|
||||
|
||||
public static class TileQuantumBridgeGlass extends TileQuantumBridge
|
||||
{
|
||||
public TileQuantumBridgeGlass() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileQuantumBridgeRing extends TileQuantumBridge
|
||||
{
|
||||
public TileQuantumBridgeRing() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
private final byte corner = 16;
|
||||
private final int[] sidesRing = {};
|
||||
private final int[] sidesLink = { 0 };
|
||||
|
|
|
@ -39,6 +39,20 @@ import appeng.tile.inventory.InvOperation;
|
|||
public class TileSkyChest extends AEBaseInvTile implements ITickable
|
||||
{
|
||||
|
||||
public static class Smooth extends TileSkyChest
|
||||
{
|
||||
public Smooth() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
public static class Stone extends TileSkyChest
|
||||
{
|
||||
public Stone() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
private final int[] sides = {
|
||||
0,
|
||||
1,
|
||||
|
|
|
@ -1821,24 +1821,4 @@ public class Platform
|
|||
|
||||
return isPurified;
|
||||
}
|
||||
|
||||
/**
|
||||
* Added because the internal Forge GameRegistry method changed a bit
|
||||
* @param tileEntityClass
|
||||
* @param id
|
||||
* @param alternatives
|
||||
*/
|
||||
public static void registerTileEntityWithAlternatives(Class<? extends TileEntity> tileEntityClass, String id, String... alternatives)
|
||||
{
|
||||
ResourceLocation rloc = GameData.getTileEntityRegistry().getNameForObject(tileEntityClass);
|
||||
|
||||
/**
|
||||
* If there's no mention of said TE in the registry, add it, otherwise add the aliases.
|
||||
*/
|
||||
if(rloc == null) {
|
||||
GameRegistry.registerTileEntityWithAlternatives( tileEntityClass, AppEng.MOD_ID.toLowerCase() + ":" + id, id );
|
||||
} else {
|
||||
GameData.getTileEntityRegistry().addLegacyName(new ResourceLocation(id), new ResourceLocation(AppEng.MOD_ID.toLowerCase() + ":" + id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue