diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-29 16:16:08 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-08-29 16:16:08 +1000 |
commit | a7636713e19e421e4db63f90a670c20793b41393 (patch) | |
tree | b20e66dfb9f8a91632327872d9d24e5f44e20b5d /src/Java/miscutil | |
parent | 6726e41c6f3b3885980fea811568fb3164a88ef6 (diff) | |
download | GT5-Unofficial-a7636713e19e421e4db63f90a670c20793b41393.tar.gz GT5-Unofficial-a7636713e19e421e4db63f90a670c20793b41393.tar.bz2 GT5-Unofficial-a7636713e19e421e4db63f90a670c20793b41393.zip |
$ Fixed mishandling of block registration for generated types.
Diffstat (limited to 'src/Java/miscutil')
-rw-r--r-- | src/Java/miscutil/core/block/base/BlockBaseModular.java | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/Java/miscutil/core/block/base/BlockBaseModular.java b/src/Java/miscutil/core/block/base/BlockBaseModular.java index 1b07339246..e1fbde6d39 100644 --- a/src/Java/miscutil/core/block/base/BlockBaseModular.java +++ b/src/Java/miscutil/core/block/base/BlockBaseModular.java @@ -3,6 +3,7 @@ package miscutil.core.block.base; import miscutil.core.item.base.itemblock.ItemBlockGtBlock; import miscutil.core.item.base.itemblock.ItemBlockGtFrameBox; import miscutil.core.lib.CORE; +import miscutil.core.util.Utils; import miscutil.core.util.math.MathUtils; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -17,6 +18,7 @@ public class BlockBaseModular extends BasicBlock{ protected int blockColour; protected BlockTypes thisBlock; protected String thisBlockMaterial; + protected final String thisBlockType; public BlockBaseModular(String unlocalizedName, String blockMaterial, BlockTypes blockType, int colour) { super(blockType.getTexture()+unlocalizedName, Material.iron); @@ -25,24 +27,44 @@ public class BlockBaseModular extends BasicBlock{ this.blockColour = colour; this.thisBlock = blockType; this.thisBlockMaterial = blockMaterial; + this.thisBlockType = blockType.name().toUpperCase(); this.setBlockName(getLocalizedName()); - if (thisBlock.name().toLowerCase() == BlockTypes.STANDARD.name().toLowerCase()){ + if (!CORE.DEBUG){ + Utils.LOG_INFO("=============Block Info Dump============="); + Utils.LOG_INFO("thisBlock.name().toLowerCase() - "+thisBlock.name().toLowerCase()); + Utils.LOG_INFO("This Blocks Type - "+thisBlockType); + Utils.LOG_INFO("BlockTypes.STANDARD.name().toLowerCase() - "+BlockTypes.STANDARD.name().toLowerCase()); + Utils.LOG_INFO("BlockTypes.FRAME.name().toLowerCase() - "+BlockTypes.FRAME.name().toLowerCase()); + Utils.LOG_INFO("blockMaterial - "+blockMaterial); + Utils.LOG_INFO("=========================================="); + } + + if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){ LanguageRegistry.addName(this, "Block of "+blockMaterial); + Utils.LOG_INFO("Registered Block in Language Registry as: "+"Block of "+blockMaterial); } - else if (thisBlock.name().toLowerCase() == BlockTypes.FRAME.name().toLowerCase()){ + else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){ LanguageRegistry.addName(this, blockMaterial+ " Frame Box"); + Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial+ " Frame Box"); } else { LanguageRegistry.addName(this, blockMaterial); + Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial); } //setOreDict(unlocalizedName, blockType); - if (thisBlock.name().toLowerCase() == BlockTypes.STANDARD.name().toLowerCase()){ - GameRegistry.registerBlock(this, ItemBlockGtBlock.class, blockType.getTexture()+unlocalizedName); + if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){ + GameRegistry.registerBlock(this, ItemBlockGtBlock.class, blockType.getTexture()+unlocalizedName); + Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block of "+blockMaterial); } - else if (thisBlock.name().toLowerCase() == BlockTypes.FRAME.name().toLowerCase()){ - GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, blockType.getTexture()+unlocalizedName); + else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){ + GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, blockType.getTexture()+unlocalizedName); + Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box"); + } + else { + GameRegistry.registerBlock(this, ItemBlockGtBlock.class, blockType.getTexture()+unlocalizedName); + Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial); } |