Re-add Debug blocks

This commit is contained in:
DarkGuardsman 2014-01-19 22:13:51 -05:00
parent 0e901070d7
commit c1f8082fe4
6 changed files with 121 additions and 137 deletions

View file

@ -28,7 +28,6 @@ public class BlockDebug extends BlockRI implements IBlockInfo
public BlockDebug() public BlockDebug()
{ {
super("DebugBlock"); super("DebugBlock");
this.setCreativeTab(ResonantInductionTabs.CORE);
} }
@Override @Override
@ -37,13 +36,10 @@ public class BlockDebug extends BlockRI implements IBlockInfo
{ {
super.registerIcons(iconReg); super.registerIcons(iconReg);
for (DebugBlocks block : DebugBlocks.values()) for (DebugBlocks block : DebugBlocks.values())
{
if (block.enabled)
{ {
block.icon = iconReg.registerIcon(Reference.PREFIX + block.getTextureName()); block.icon = iconReg.registerIcon(Reference.PREFIX + block.getTextureName());
} }
} }
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@ -79,38 +75,22 @@ public class BlockDebug extends BlockRI implements IBlockInfo
return null; return null;
} }
@Override
public void onBlockAdded(World world, int x, int y, int z)
{
super.onBlockAdded(world, x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if (meta >= DebugBlocks.values().length || !DebugBlocks.values()[meta].enabled)
{
world.setBlock(x, y, z, 0);
}
}
@Override @Override
public void getSubBlocks(int blockID, CreativeTabs tab, List creativeTabList) public void getSubBlocks(int blockID, CreativeTabs tab, List creativeTabList)
{ {
for (DebugBlocks block : DebugBlocks.values()) for (DebugBlocks block : DebugBlocks.values())
{
if (block.enabled)
{ {
creativeTabList.add(new ItemStack(blockID, 1, block.ordinal())); creativeTabList.add(new ItemStack(blockID, 1, block.ordinal()));
} }
} }
}
@Override @Override
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list) public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
{ {
for (DebugBlocks block : DebugBlocks.values()) for (DebugBlocks block : DebugBlocks.values())
{
if (block.enabled && block.clazz != null && block.name != null)
{ {
list.add(new Pair<String, Class<? extends TileEntity>>(block.name, block.clazz)); list.add(new Pair<String, Class<? extends TileEntity>>(block.name, block.clazz));
}
} }
} }
@ -147,7 +127,6 @@ public class BlockDebug extends BlockRI implements IBlockInfo
public Icon icon; public Icon icon;
public String name; public String name;
public String texture; public String texture;
public boolean enabled;
Class<? extends TileEntity> clazz; Class<? extends TileEntity> clazz;
private DebugBlocks(String name, Class<? extends TileEntity> clazz) private DebugBlocks(String name, Class<? extends TileEntity> clazz)

View file

@ -16,6 +16,11 @@ item.resonantinduction\:oreDust.name=%v Dust
item.resonantinduction\:oreRefinedDust.name=%v Refined Dust item.resonantinduction\:oreRefinedDust.name=%v Refined Dust
item.resonantinduction\:oreRubble.name=%v Rubble item.resonantinduction\:oreRubble.name=%v Rubble
tile.resonantinduction\:DebugBlock.0.name=Infinite Power
tile.resonantinduction\:DebugBlock.1.name=Infinite Fluid
tile.resonantinduction\:DebugBlock.2.name=Fluid Void
tile.resonantinduction\:DebugBlock.3.name=Power Void
### Archaic Module ### Archaic Module
## Items ## Items
item.resonantinduction\:imprint.name=Imprint item.resonantinduction\:imprint.name=Imprint

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B