Fixed blocks registration globally

This commit is contained in:
LemADEC 2015-09-26 04:46:09 +02:00
parent 87d4547230
commit 22fba522f0
23 changed files with 139 additions and 147 deletions

View file

@ -3,7 +3,6 @@ package cr0s.warpdrive;
import java.util.List; import java.util.List;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
@ -201,30 +200,30 @@ public class WarpDrive implements LoadingCallback {
WarpDriveConfig.onFMLInitialization(); WarpDriveConfig.onFMLInitialization();
// CORE CONTROLLER // CORE CONTROLLER
blockShipController = new BlockShipController(0, Material.rock); blockShipController = new BlockShipController();
GameRegistry.registerBlock(blockShipController, "blockShipController"); GameRegistry.registerBlock(blockShipController, "blockShipController");
GameRegistry.registerTileEntity(TileEntityShipController.class, MODID + ":blockShipController"); GameRegistry.registerTileEntity(TileEntityShipController.class, MODID + ":blockShipController");
// WARP CORE // WARP CORE
blockShipCore = new BlockShipCore(0, Material.rock); blockShipCore = new BlockShipCore();
GameRegistry.registerBlock(blockShipCore, "blockShipCore"); GameRegistry.registerBlock(blockShipCore, "blockShipCore");
GameRegistry.registerTileEntity(TileEntityShipCore.class, MODID + ":blockShipCore"); GameRegistry.registerTileEntity(TileEntityShipCore.class, MODID + ":blockShipCore");
// WARP RADAR // WARP RADAR
blockRadar = new BlockRadar(0, Material.rock); blockRadar = new BlockRadar();
GameRegistry.registerBlock(blockRadar, "blockRadar"); GameRegistry.registerBlock(blockRadar, "blockRadar");
GameRegistry.registerTileEntity(TileEntityRadar.class, MODID + ":blockRadar"); GameRegistry.registerTileEntity(TileEntityRadar.class, MODID + ":blockRadar");
// WARP ISOLATION // WARP ISOLATION
blockWarpIsolation = new BlockWarpIsolation(0, Material.rock); blockWarpIsolation = new BlockWarpIsolation();
GameRegistry.registerBlock(blockWarpIsolation, "blockWarpIsolation"); GameRegistry.registerBlock(blockWarpIsolation, "blockWarpIsolation");
// AIR GENERATOR // AIR GENERATOR
blockAirGenerator = new BlockAirGenerator(0, Material.rock); blockAirGenerator = new BlockAirGenerator();
GameRegistry.registerBlock(blockAirGenerator, "blockAirGenerator"); GameRegistry.registerBlock(blockAirGenerator, "blockAirGenerator");
GameRegistry.registerTileEntity(TileEntityAirGenerator.class, MODID + ":blockAirGenerator"); GameRegistry.registerTileEntity(TileEntityAirGenerator.class, MODID + ":blockAirGenerator");
@ -240,18 +239,18 @@ public class WarpDrive implements LoadingCallback {
GameRegistry.registerBlock(blockGas, "blockGas"); GameRegistry.registerBlock(blockGas, "blockGas");
// LASER EMITTER // LASER EMITTER
blockLaser = new BlockLaser(0, Material.rock); blockLaser = new BlockLaser();
GameRegistry.registerBlock(blockLaser, "blockLaser"); GameRegistry.registerBlock(blockLaser, "blockLaser");
GameRegistry.registerTileEntity(TileEntityLaser.class, MODID + ":blockLaser"); GameRegistry.registerTileEntity(TileEntityLaser.class, MODID + ":blockLaser");
// LASER EMITTER WITH CAMERA // LASER EMITTER WITH CAMERA
blockLaserCamera = new BlockLaserCamera(0, Material.rock); blockLaserCamera = new BlockLaserCamera();
GameRegistry.registerBlock(blockLaserCamera, "blockLaserCamera"); GameRegistry.registerBlock(blockLaserCamera, "blockLaserCamera");
// CAMERA // CAMERA
blockCamera = new BlockCamera(0, Material.rock); blockCamera = new BlockCamera();
GameRegistry.registerBlock(blockCamera, "blockCamera"); GameRegistry.registerBlock(blockCamera, "blockCamera");
GameRegistry.registerTileEntity(TileEntityCamera.class, MODID + ":blockCamera"); GameRegistry.registerTileEntity(TileEntityCamera.class, MODID + ":blockCamera");
@ -263,25 +262,25 @@ public class WarpDrive implements LoadingCallback {
GameRegistry.registerTileEntity(TileEntityMonitor.class, MODID + ":blockMonitor"); GameRegistry.registerTileEntity(TileEntityMonitor.class, MODID + ":blockMonitor");
// MINING LASER // MINING LASER
blockMiningLaser = new BlockMiningLaser(0, Material.rock); blockMiningLaser = new BlockMiningLaser();
GameRegistry.registerBlock(blockMiningLaser, "blockMiningLaser"); GameRegistry.registerBlock(blockMiningLaser, "blockMiningLaser");
GameRegistry.registerTileEntity(TileEntityMiningLaser.class, MODID + ":blockMiningLaser"); GameRegistry.registerTileEntity(TileEntityMiningLaser.class, MODID + ":blockMiningLaser");
// LASER TREE FARM // LASER TREE FARM
blockLaserTreeFarm = new BlockLaserTreeFarm(0, Material.rock); blockLaserTreeFarm = new BlockLaserTreeFarm();
GameRegistry.registerBlock(blockLaserTreeFarm, "blockLaserTreeFarm"); GameRegistry.registerBlock(blockLaserTreeFarm, "blockLaserTreeFarm");
GameRegistry.registerTileEntity(TileEntityLaserTreeFarm.class, MODID + ":blockLaserTreeFarm"); GameRegistry.registerTileEntity(TileEntityLaserTreeFarm.class, MODID + ":blockLaserTreeFarm");
// LASER MEDIUM // LASER MEDIUM
blockLaserMedium = new BlockLaserMedium(0, Material.rock); blockLaserMedium = new BlockLaserMedium();
GameRegistry.registerBlock(blockLaserMedium, "blockLaserMedium"); GameRegistry.registerBlock(blockLaserMedium, "blockLaserMedium");
GameRegistry.registerTileEntity(TileEntityLaserMedium.class, MODID + ":blockLaserMedium"); GameRegistry.registerTileEntity(TileEntityLaserMedium.class, MODID + ":blockLaserMedium");
// LIFT // LIFT
blockLift = new BlockLift(0, Material.rock); blockLift = new BlockLift();
GameRegistry.registerBlock(blockLift, "blockLift"); GameRegistry.registerBlock(blockLift, "blockLift");
GameRegistry.registerTileEntity(TileEntityLift.class, MODID + ":blockLift"); GameRegistry.registerTileEntity(TileEntityLift.class, MODID + ":blockLift");
@ -299,31 +298,31 @@ public class WarpDrive implements LoadingCallback {
} }
// SHIP SCANNER // SHIP SCANNER
blockShipScanner = new BlockShipScanner(0, Material.rock); blockShipScanner = new BlockShipScanner();
GameRegistry.registerBlock(blockShipScanner, "blockShipScanner"); GameRegistry.registerBlock(blockShipScanner, "blockShipScanner");
GameRegistry.registerTileEntity(TileEntityShipScanner.class, MODID + ":blockShipScanner"); GameRegistry.registerTileEntity(TileEntityShipScanner.class, MODID + ":blockShipScanner");
// CLOAKING DEVICE CORE // CLOAKING DEVICE CORE
blockCloakingCore = new BlockCloakingCore(0, Material.rock); blockCloakingCore = new BlockCloakingCore();
GameRegistry.registerBlock(blockCloakingCore, "blockCloakingCore"); GameRegistry.registerBlock(blockCloakingCore, "blockCloakingCore");
GameRegistry.registerTileEntity(TileEntityCloakingCore.class, MODID + ":blockCloakingCore"); GameRegistry.registerTileEntity(TileEntityCloakingCore.class, MODID + ":blockCloakingCore");
// CLOAKING DEVICE COIL // CLOAKING DEVICE COIL
blockCloakingCoil = new BlockCloakingCoil(0, Material.rock); blockCloakingCoil = new BlockCloakingCoil();
GameRegistry.registerBlock(blockCloakingCoil, "blockCloakingCoil"); GameRegistry.registerBlock(blockCloakingCoil, "blockCloakingCoil");
// TRANSPORTER // TRANSPORTER
blockTransporter = new BlockTransporter(Material.rock); blockTransporter = new BlockTransporter();
GameRegistry.registerBlock(blockTransporter, "blockTransporter"); GameRegistry.registerBlock(blockTransporter, "blockTransporter");
GameRegistry.registerTileEntity(TileEntityTransporter.class, MODID + ":blockTransporter"); GameRegistry.registerTileEntity(TileEntityTransporter.class, MODID + ":blockTransporter");
// IC2 REACTOR LASER MONITOR // IC2 REACTOR LASER MONITOR
if (WarpDriveConfig.isIndustrialCraft2loaded) { if (WarpDriveConfig.isIndustrialCraft2loaded) {
blockIC2reactorLaserMonitor = new BlockIC2reactorLaserMonitor(Material.rock); blockIC2reactorLaserMonitor = new BlockIC2reactorLaserMonitor();
GameRegistry.registerBlock(blockIC2reactorLaserMonitor, "blockIC2reactorLaserMonitor"); GameRegistry.registerBlock(blockIC2reactorLaserMonitor, "blockIC2reactorLaserMonitor");
GameRegistry.registerTileEntity(TileEntityIC2reactorLaserMonitor.class, MODID + ":blockIC2reactorLaserMonitor"); GameRegistry.registerTileEntity(TileEntityIC2reactorLaserMonitor.class, MODID + ":blockIC2reactorLaserMonitor");
@ -445,12 +444,12 @@ public class WarpDrive implements LoadingCallback {
public Ticket registerChunkLoadTE(TileEntityAbstractChunkLoading tileEntity, boolean refreshLoading) { public Ticket registerChunkLoadTE(TileEntityAbstractChunkLoading tileEntity, boolean refreshLoading) {
World worldObj = tileEntity.getWorldObj(); World worldObj = tileEntity.getWorldObj();
if (ForgeChunkManager.ticketCountAvailableFor(this, worldObj) > 0) { if (ForgeChunkManager.ticketCountAvailableFor(this, worldObj) > 0) {
Ticket t = ForgeChunkManager.requestTicket(this, worldObj, Type.NORMAL); Ticket ticket = ForgeChunkManager.requestTicket(this, worldObj, Type.NORMAL);
if (t != null) { if (ticket != null) {
tileEntity.giveTicket(t); // FIXME calling the caller is a bad idea tileEntity.giveTicket(ticket); // FIXME calling the caller is a bad idea
if (refreshLoading) if (refreshLoading)
tileEntity.refreshLoading(); tileEntity.refreshLoading();
return t; return ticket;
} else { } else {
WarpDrive.logger.error("Ticket not granted"); WarpDrive.logger.error("Ticket not granted");
} }

View file

@ -9,27 +9,22 @@ import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.api.IBlockUpdateDetector; import cr0s.warpdrive.api.IBlockUpdateDetector;
public abstract class BlockAbstractContainer extends BlockContainer { public abstract class BlockAbstractContainer extends BlockContainer {
protected BlockAbstractContainer() { protected BlockAbstractContainer(Material material) {
super(Material.iron); super(material);
}
protected BlockAbstractContainer(Material m) {
super(m);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);
} }
@Override @Override
public void onBlockAdded(World w, int x, int y, int z) { public void onBlockAdded(World world, int x, int y, int z) {
super.onBlockAdded(w, x, y, z); super.onBlockAdded(world, x, y, z);
TileEntity tileEntity = w.getTileEntity(x, y, z); TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof IBlockUpdateDetector) { if (tileEntity instanceof IBlockUpdateDetector) {
((IBlockUpdateDetector) tileEntity).updatedNeighbours(); ((IBlockUpdateDetector) tileEntity).updatedNeighbours();
} }
} }
// FIXME untested // FIXME untested
/* /*
@Override @Override
@ -63,9 +58,9 @@ public abstract class BlockAbstractContainer extends BlockContainer {
/**/ /**/
@Override @Override
public void onNeighborBlockChange(World w, int x, int y, int z, Block b) { public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
super.onNeighborBlockChange(w, x, y, z, b); super.onNeighborBlockChange(world, x, y, z, block);
TileEntity tileEntity = w.getTileEntity(x, y, z); TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof IBlockUpdateDetector) { if (tileEntity instanceof IBlockUpdateDetector) {
((IBlockUpdateDetector) tileEntity).updatedNeighbours(); ((IBlockUpdateDetector) tileEntity).updatedNeighbours();
} }

View file

@ -18,15 +18,13 @@ import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.api.IAirCanister; import cr0s.warpdrive.api.IAirCanister;
import cr0s.warpdrive.config.WarpDriveConfig; import cr0s.warpdrive.config.WarpDriveConfig;
public class BlockAirGenerator extends BlockContainer public class BlockAirGenerator extends BlockContainer {
{
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
private final int ICON_INACTIVE_SIDE = 0, ICON_BOTTOM = 1, ICON_SIDE_ACTIVATED = 2; private final int ICON_INACTIVE_SIDE = 0, ICON_BOTTOM = 1, ICON_SIDE_ACTIVATED = 2;
public BlockAirGenerator(int texture, Material material) public BlockAirGenerator() {
{ super(Material.rock);
super(material);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);
@ -34,8 +32,7 @@ public class BlockAirGenerator extends BlockContainer
} }
@Override @Override
public void registerBlockIcons(IIconRegister par1IconRegister) public void registerBlockIcons(IIconRegister par1IconRegister) {
{
iconBuffer = new IIcon[3]; iconBuffer = new IIcon[3];
iconBuffer[ICON_INACTIVE_SIDE] = par1IconRegister.registerIcon("warpdrive:airGeneratorSideInactive"); iconBuffer[ICON_INACTIVE_SIDE] = par1IconRegister.registerIcon("warpdrive:airGeneratorSideInactive");
iconBuffer[ICON_BOTTOM] = par1IconRegister.registerIcon("warpdrive:airGeneratorBottom"); iconBuffer[ICON_BOTTOM] = par1IconRegister.registerIcon("warpdrive:airGeneratorBottom");

View file

@ -1,5 +1,6 @@
package cr0s.warpdrive.block; package cr0s.warpdrive.block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
@ -9,6 +10,7 @@ public class BlockChunkLoader extends BlockAbstractContainer {
IIcon iconBuffer; IIcon iconBuffer;
public BlockChunkLoader() { public BlockChunkLoader() {
super(Material.iron);
} }
@Override @Override
@ -25,5 +27,4 @@ public class BlockChunkLoader extends BlockAbstractContainer {
public IIcon getIcon(int side, int damage) { public IIcon getIcon(int side, int damage) {
return iconBuffer; return iconBuffer;
} }
} }

View file

@ -19,8 +19,8 @@ public class BlockLaser extends BlockContainer {
private final int ICON_SIDE = 0; private final int ICON_SIDE = 0;
public BlockLaser(int texture, Material material) { public BlockLaser() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -17,8 +17,8 @@ import cr0s.warpdrive.WarpDrive;
public class BlockLaserMedium extends BlockContainer { public class BlockLaserMedium extends BlockContainer {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockLaserMedium(int texture, Material material) { public BlockLaserMedium() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -18,8 +18,8 @@ import cr0s.warpdrive.block.TileEntityAbstractEnergy;
public class BlockShipScanner extends BlockContainer { public class BlockShipScanner extends BlockContainer {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockShipScanner(int texture, Material material) { public BlockShipScanner() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);
@ -70,14 +70,14 @@ public class BlockShipScanner extends BlockContainer {
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
@Override @Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
return false; return false;
} }
TileEntityAbstractEnergy te = (TileEntityAbstractEnergy)par1World.getTileEntity(par2, par3, par4); TileEntityAbstractEnergy te = (TileEntityAbstractEnergy)world.getTileEntity(x, y, z);
if (te != null && (par5EntityPlayer.getHeldItem() == null)) { if (te != null && (entityPlayer.getHeldItem() == null)) {
WarpDrive.addChatMessage(par5EntityPlayer, te.getStatus()); WarpDrive.addChatMessage(entityPlayer, te.getStatus());
return true; return true;
} }

View file

@ -15,8 +15,8 @@ import cr0s.warpdrive.WarpDrive;
public class BlockLaserTreeFarm extends BlockContainer { public class BlockLaserTreeFarm extends BlockContainer {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockLaserTreeFarm(int texture, Material material) { public BlockLaserTreeFarm() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -23,8 +23,8 @@ public class BlockMiningLaser extends BlockContainer {
public final static int ICON_SCANNINGLOWPOWER = 3; public final static int ICON_SCANNINGLOWPOWER = 3;
public final static int ICON_SCANNINGPOWERED = 4; public final static int ICON_SCANNINGPOWERED = 4;
public BlockMiningLaser(int texture, Material material) { public BlockMiningLaser() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -20,8 +20,8 @@ public class BlockCamera extends BlockContainer {
private final int ICON_SIDE = 0; private final int ICON_SIDE = 0;
public BlockCamera(int texture, Material material) { public BlockCamera() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -13,8 +13,8 @@ import cr0s.warpdrive.WarpDrive;
public class BlockCloakingCoil extends Block { public class BlockCloakingCoil extends Block {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockCloakingCoil(int texture, Material material) { public BlockCloakingCoil() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -17,8 +17,8 @@ import cr0s.warpdrive.WarpDrive;
public class BlockCloakingCore extends BlockContainer { public class BlockCloakingCore extends BlockContainer {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockCloakingCore(int texture, Material material) { public BlockCloakingCore() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -25,8 +25,8 @@ public class BlockRadar extends BlockContainer
private final int ICON_SIDE_ACTIVATED = 3; private final int ICON_SIDE_ACTIVATED = 3;
private final int ICON_SIDE_ACTIVATED_SCAN = 4; private final int ICON_SIDE_ACTIVATED_SCAN = 4;
public BlockRadar(int texture, Material material) { public BlockRadar() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -12,8 +12,8 @@ import cr0s.warpdrive.WarpDrive;
public class BlockWarpIsolation extends Block { public class BlockWarpIsolation extends Block {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockWarpIsolation(int texture, Material material) { public BlockWarpIsolation() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -2,6 +2,7 @@ package cr0s.warpdrive.block.energy;
import cr0s.warpdrive.block.BlockAbstractContainer; import cr0s.warpdrive.block.BlockAbstractContainer;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
@ -11,7 +12,7 @@ public class BlockEnanReactorCore extends BlockAbstractContainer {
IIcon[] iconBuffer = new IIcon[17]; IIcon[] iconBuffer = new IIcon[17];
public BlockEnanReactorCore() { public BlockEnanReactorCore() {
super(); super(Material.iron);
setBlockName("warpdrive.energy.EnanReactorCore"); setBlockName("warpdrive.energy.EnanReactorCore");
} }

View file

@ -1,6 +1,7 @@
package cr0s.warpdrive.block.energy; package cr0s.warpdrive.block.energy;
import cr0s.warpdrive.block.BlockAbstractContainer; import cr0s.warpdrive.block.BlockAbstractContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
@ -10,6 +11,7 @@ public class BlockEnanReactorLaser extends BlockAbstractContainer {
static IIcon[] iconBuffer = new IIcon[16]; static IIcon[] iconBuffer = new IIcon[16];
public BlockEnanReactorLaser() { public BlockEnanReactorLaser() {
super(Material.iron);
setResistance(100.0F); setResistance(100.0F);
setBlockName("warpdrive.energy.EnanReactorLaser"); setBlockName("warpdrive.energy.EnanReactorLaser");
} }

View file

@ -1,5 +1,6 @@
package cr0s.warpdrive.block.energy; package cr0s.warpdrive.block.energy;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -14,6 +15,7 @@ public class BlockEnergyBank extends BlockAbstractContainer {
private IIcon iconBuffer; private IIcon iconBuffer;
public BlockEnergyBank() { public BlockEnergyBank() {
super(Material.iron);
setBlockName("warpdrive.energy.EnergyBank"); setBlockName("warpdrive.energy.EnergyBank");
} }
@ -36,14 +38,14 @@ public class BlockEnergyBank extends BlockAbstractContainer {
* Called upon block activation (right click on the block.) * Called upon block activation (right click on the block.)
*/ */
@Override @Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
return false; return false;
} }
TileEntityAbstractEnergy te = (TileEntityAbstractEnergy) par1World.getTileEntity(par2, par3, par4); TileEntityAbstractEnergy tileEntity = (TileEntityAbstractEnergy) world.getTileEntity(x, y, z);
if (te != null && (par5EntityPlayer.getHeldItem() == null)) { if (tileEntity != null && (entityPlayer.getHeldItem() == null)) {
WarpDrive.addChatMessage(par5EntityPlayer, te.getStatus()); WarpDrive.addChatMessage(entityPlayer, tileEntity.getStatus());
return true; return true;
} }

View file

@ -11,21 +11,16 @@ import net.minecraft.world.World;
import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.WarpDrive;
public class BlockIC2reactorLaserMonitor extends BlockContainer { public class BlockIC2reactorLaserMonitor extends BlockContainer {
public BlockIC2reactorLaserMonitor(int texture, Material material) { public BlockIC2reactorLaserMonitor() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);
this.setBlockName("warpdrive.energy.IC2ReactorLaserMonitor"); this.setBlockName("warpdrive.energy.IC2ReactorLaserMonitor");
} }
public BlockIC2reactorLaserMonitor(Material material) {
this(0, material);
}
@Override @Override
public void registerBlockIcons(IIconRegister par1IconRegister) { public void registerBlockIcons(IIconRegister par1IconRegister) {
// Solid textures
blockIcon = par1IconRegister.registerIcon("warpdrive:energy/IC2reactorLaserMonitor"); blockIcon = par1IconRegister.registerIcon("warpdrive:energy/IC2reactorLaserMonitor");
} }

View file

@ -19,8 +19,8 @@ public class BlockLift extends BlockContainer
{ {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockLift(int texture, Material material) { public BlockLift() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -21,8 +21,8 @@ public class BlockShipController extends BlockContainer {
private final int ICON_INACTIVE_SIDE = 0, ICON_BOTTOM = 1, ICON_TOP = 2, ICON_SIDE_ACTIVATED = 3; private final int ICON_INACTIVE_SIDE = 0, ICON_BOTTOM = 1, ICON_TOP = 2, ICON_SIDE_ACTIVATED = 3;
public BlockShipController(int id, Material material) { public BlockShipController() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -19,8 +19,8 @@ public class BlockShipCore extends BlockContainer {
private final int ICON_SIDE_INACTIVE = 0, ICON_BOTTOM = 1, ICON_TOP = 2, ICON_SIDE_ACTIVATED = 3, ICON_SIDE_HEATED = 4; private final int ICON_SIDE_INACTIVE = 0, ICON_BOTTOM = 1, ICON_TOP = 2, ICON_SIDE_ACTIVATED = 3, ICON_SIDE_HEATED = 4;
public BlockShipCore(int texture, Material material) { public BlockShipCore() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);

View file

@ -11,8 +11,8 @@ public class BlockTransporter extends BlockAbstractContainer {
private IIcon[] iconBuffer; private IIcon[] iconBuffer;
public BlockTransporter(Material par2Material) { public BlockTransporter() {
super(par2Material); super(Material.rock);
setBlockName("warpdrive.movement.Transporter"); setBlockName("warpdrive.movement.Transporter");
} }

View file

@ -22,8 +22,8 @@ public class BlockLaserCamera extends BlockContainer {
private final int ICON_SIDE = 0; private final int ICON_SIDE = 0;
public BlockLaserCamera(int texture, Material material) { public BlockLaserCamera() {
super(material); super(Material.rock);
setHardness(0.5F); setHardness(0.5F);
setStepSound(Block.soundTypeMetal); setStepSound(Block.soundTypeMetal);
setCreativeTab(WarpDrive.creativeTabWarpDrive); setCreativeTab(WarpDrive.creativeTabWarpDrive);