From c1f8082fe48afa1a1c079c12d58399049c67bccc Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Sun, 19 Jan 2014 22:13:51 -0500 Subject: [PATCH] Re-add Debug blocks --- .../core/debug/BlockDebug.java | 253 ++++++++---------- .../languages/en_US.properties | 5 + .../textures/blocks/infFluid.png | Bin 0 -> 231 bytes .../textures/blocks/infLoad.png | Bin 0 -> 222 bytes .../textures/blocks/infSource.png | Bin 0 -> 227 bytes .../textures/blocks/void.png | Bin 0 -> 226 bytes 6 files changed, 121 insertions(+), 137 deletions(-) create mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/infFluid.png create mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/infLoad.png create mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/infSource.png create mode 100644 src/main/resources/assets/resonantinduction/textures/blocks/void.png diff --git a/src/main/java/resonantinduction/core/debug/BlockDebug.java b/src/main/java/resonantinduction/core/debug/BlockDebug.java index 78ba83a0..4ee3ee7d 100644 --- a/src/main/java/resonantinduction/core/debug/BlockDebug.java +++ b/src/main/java/resonantinduction/core/debug/BlockDebug.java @@ -23,161 +23,140 @@ import cpw.mods.fml.relauncher.SideOnly; public class BlockDebug extends BlockRI implements IBlockInfo { - public static float DebugWattOut, DebugWattDemand; + public static float DebugWattOut, DebugWattDemand; - public BlockDebug() - { - super("DebugBlock"); - this.setCreativeTab(ResonantInductionTabs.CORE); - } + public BlockDebug() + { + super("DebugBlock"); + } - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconReg) - { - super.registerIcons(iconReg); - for (DebugBlocks block : DebugBlocks.values()) - { - if (block.enabled) - { - block.icon = iconReg.registerIcon(Reference.PREFIX + block.getTextureName()); - } - } - } + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconReg) + { + super.registerIcons(iconReg); + for (DebugBlocks block : DebugBlocks.values()) + { + block.icon = iconReg.registerIcon(Reference.PREFIX + block.getTextureName()); + } + } - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon(int side, int meta) - { - if (meta < DebugBlocks.values().length) - { - return DebugBlocks.values()[meta].icon; - } - return this.blockIcon; - } + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon(int side, int meta) + { + if (meta < DebugBlocks.values().length) + { + return DebugBlocks.values()[meta].icon; + } + return this.blockIcon; + } - @Override - public TileEntity createTileEntity(World world, int metadata) - { - if (metadata < DebugBlocks.values().length) - { - try - { - return DebugBlocks.values()[metadata].clazz.newInstance(); - } - catch (Exception e) - { - e.printStackTrace(); - } - } - return super.createTileEntity(world, metadata); - } + @Override + public TileEntity createTileEntity(World world, int metadata) + { + if (metadata < DebugBlocks.values().length) + { + try + { + return DebugBlocks.values()[metadata].clazz.newInstance(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + return super.createTileEntity(world, metadata); + } - @Override - public TileEntity createNewTileEntity(World world) - { - return null; - } + @Override + public TileEntity createNewTileEntity(World world) + { + 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 + public void getSubBlocks(int blockID, CreativeTabs tab, List creativeTabList) + { + for (DebugBlocks block : DebugBlocks.values()) + { + creativeTabList.add(new ItemStack(blockID, 1, block.ordinal())); + } + } - @Override - public void getSubBlocks(int blockID, CreativeTabs tab, List creativeTabList) - { - for (DebugBlocks block : DebugBlocks.values()) - { - if (block.enabled) - { - creativeTabList.add(new ItemStack(blockID, 1, block.ordinal())); - } - } - } + @Override + public void getTileEntities(int blockID, Set>> list) + { + for (DebugBlocks block : DebugBlocks.values()) + { + list.add(new Pair>(block.name, block.clazz)); - @Override - public void getTileEntities(int blockID, Set>> list) - { - for (DebugBlocks block : DebugBlocks.values()) - { - if (block.enabled && block.clazz != null && block.name != null) - { - list.add(new Pair>(block.name, block.clazz)); - } - } - } + } + } - @Override - public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return false; - } + @Override + public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return false; + } - @Override - public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return false; - } + @Override + public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return false; + } - @Override - public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return false; - } + @Override + public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return false; + } - @Override - public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) - { - return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); - } + @Override + public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); + } - public static enum DebugBlocks - { - SOURCE("UnlimitedPower", TileEntityInfSupply.class, "infSource"), - FLUID("UnlimitedFluid", TileEntityInfFluid.class, "infFluid"), - VOID("FluidVoid", TileEntityVoid.class, "void"), - LOAD("PowerVampire", TileEntityInfLoad.class, "infLoad"); - public Icon icon; - public String name; - public String texture; - public boolean enabled; - Class clazz; + public static enum DebugBlocks + { + SOURCE("UnlimitedPower", TileEntityInfSupply.class, "infSource"), + FLUID("UnlimitedFluid", TileEntityInfFluid.class, "infFluid"), + VOID("FluidVoid", TileEntityVoid.class, "void"), + LOAD("PowerVampire", TileEntityInfLoad.class, "infLoad"); + public Icon icon; + public String name; + public String texture; + Class clazz; - private DebugBlocks(String name, Class clazz) - { - this.name = name; - this.clazz = clazz; - } + private DebugBlocks(String name, Class clazz) + { + this.name = name; + this.clazz = clazz; + } - private DebugBlocks(String name, Class clazz, String texture) - { - this(name, clazz); - this.texture = texture; - } + private DebugBlocks(String name, Class clazz, String texture) + { + this(name, clazz); + this.texture = texture; + } - public String getTextureName() - { - if (texture == null || texture.isEmpty()) - { - return name; - } - return texture; - } + public String getTextureName() + { + if (texture == null || texture.isEmpty()) + { + return name; + } + return texture; + } - } + } - @Override - public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) - { - // TODO Auto-generated method stub + @Override + public void getClientTileEntityRenderers(List, TileEntitySpecialRenderer>> list) + { + // TODO Auto-generated method stub - } + } } diff --git a/src/main/resources/assets/resonantinduction/languages/en_US.properties b/src/main/resources/assets/resonantinduction/languages/en_US.properties index 16e8663e..15cbaffd 100644 --- a/src/main/resources/assets/resonantinduction/languages/en_US.properties +++ b/src/main/resources/assets/resonantinduction/languages/en_US.properties @@ -16,6 +16,11 @@ item.resonantinduction\:oreDust.name=%v Dust item.resonantinduction\:oreRefinedDust.name=%v Refined Dust 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 ## Items item.resonantinduction\:imprint.name=Imprint diff --git a/src/main/resources/assets/resonantinduction/textures/blocks/infFluid.png b/src/main/resources/assets/resonantinduction/textures/blocks/infFluid.png new file mode 100644 index 0000000000000000000000000000000000000000..8f4c450635afbe7d2e50b920ac814883fed942a7 GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!5U8&#}EtuWD!x(R0Y-slMKoH_D>v*+3B{C z4|F(~nH1a-L{pjyI@m?BHR^a%9T=p2kWu#p1v=p_^?(d(agZONE^}{{>sP z*$*Tr+~g0Cp5QES)5)Yz$BdztGn^$w;Av(`!^_M`e;w8>UufgR@IqT?vN2J^T=>grr;OXk;vd$@?2>>7RLPr1q literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/resonantinduction/textures/blocks/infLoad.png b/src/main/resources/assets/resonantinduction/textures/blocks/infLoad.png new file mode 100644 index 0000000000000000000000000000000000000000..3462250fcc28d60a65254c8e10e9020ce565598d GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!D3Gr#}EtuWD!x(R0Y-s6OsLGMI23Wfox(H z+>#DG2eeMGq)lefxYqDY-sko`t0d}b3!;9nXdS*Kw6`=mREIA6mr&u`4r z5?G@+%%y#0I5t#B0hJvn(G~MoW;W3inDB;ulIeswKRkTy@$fKw%TYKzJ^XqO(0T?> LS3j3^P6 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/resonantinduction/textures/blocks/infSource.png b/src/main/resources/assets/resonantinduction/textures/blocks/infSource.png new file mode 100644 index 0000000000000000000000000000000000000000..285efae313bc37a4e24d13064eed7cfc8e4344c4 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!3s|o#}EtuWD!x(R0Y-slMm+%+dpwMp4U{5 ze4xX@%%tF!Aez!t(7`T}tx?CD>cAi+&T+x?OPAAKE*1y23EgZP+ApPC?shQxzQwME zoBcq7!cG2&CeaMVJ2@tW3Y|wU7q~jG1