aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/block/base
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
commitcbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch)
treeb85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/core/block/base
parentc40416b036c0e89451e1558253ccf07bbee028d0 (diff)
downloadGT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747. # Conflicts: # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java Revert "% Cleaned up Imports." This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/core/block/base')
-rw-r--r--src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java38
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BasicBlock.java80
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java196
-rw-r--r--src/Java/gtPlusPlus/core/block/base/MetaBlock.java36
-rw-r--r--src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java47
5 files changed, 197 insertions, 200 deletions
diff --git a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
index 0160da883f..b7ac24a71b 100644
--- a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
@@ -9,25 +9,23 @@ import net.minecraft.world.World;
public class AdvancedBlock extends Block {
- protected AdvancedBlock(final String unlocalizedName, final Material material, final CreativeTabs x,
- final float blockHardness, final float blockResistance, final float blockLightLevel,
- final String blockHarvestTool, final int blockHarvestLevel, final SoundType BlockSound) {
- super(material);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(x);
- this.setHardness(blockHardness); // block Hardness
- this.setResistance(blockResistance);
- this.setLightLevel(blockLightLevel);
- this.setHarvestLevel(blockHarvestTool, blockHarvestLevel);
- this.setStepSound(BlockSound);
- }
-
- @Override
- public boolean onBlockActivated(final World p_149727_1_, final int p_149727_2_, final int p_149727_3_,
- final int p_149727_4_, final EntityPlayer p_149727_5_, final int p_149727_6_, final float p_149727_7_,
- final float p_149727_8_, final float p_149727_9_) {
- return false;
- }
+ protected AdvancedBlock(String unlocalizedName, Material material, CreativeTabs x, float blockHardness, float blockResistance, float blockLightLevel,
+ String blockHarvestTool, int blockHarvestLevel, SoundType BlockSound) {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(x);
+ this.setHardness(blockHardness); //block Hardness
+ this.setResistance(blockResistance);
+ this.setLightLevel(blockLightLevel);
+ this.setHarvestLevel(blockHarvestTool, blockHarvestLevel);
+ this.setStepSound(BlockSound);
+ }
+
+ @Override
+ public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
+ {
+ return false;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
index 64ee68224e..c95f37d9c5 100644
--- a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
@@ -8,43 +8,45 @@ import net.minecraft.block.material.Material;
public class BasicBlock extends Block {
- public static enum BlockTypes {
- STANDARD("blockBlock", "pickaxe", Block.soundTypeStone), FRAME("blockFrameGt", "wrench", Block.soundTypeMetal);
-
- private String TEXTURE_NAME;
- private String HARVEST_TOOL;
- private SoundType soundOfBlock;
-
- private BlockTypes(final String textureName, final String harvestTool, final SoundType blockSound) {
- this.TEXTURE_NAME = textureName;
- this.HARVEST_TOOL = harvestTool;
- this.soundOfBlock = blockSound;
- }
-
- public SoundType getBlockSoundType() {
- return this.soundOfBlock;
- }
-
- public String getHarvestTool() {
- return this.HARVEST_TOOL;
- }
-
- public String getTexture() {
- return this.TEXTURE_NAME;
- }
-
- }
-
- public BasicBlock(final String unlocalizedName, final Material material) {
- super(material);
- this.setBlockName(Utils.sanitizeString(unlocalizedName));
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(2.0F);
- this.setResistance(6.0F);
- this.setLightLevel(0.0F);
- this.setHarvestLevel("pickaxe", 2);
- this.setStepSound(Block.soundTypeMetal);
- }
-
+ public BasicBlock(final String unlocalizedName, final Material material) {
+ super(material);
+ this.setBlockName(Utils.sanitizeString(unlocalizedName));
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(2.0F);
+ this.setResistance(6.0F);
+ this.setLightLevel(0.0F);
+ this.setHarvestLevel("pickaxe", 2);
+ this.setStepSound(soundTypeMetal);
+ }
+
+
+ public static enum BlockTypes {
+ STANDARD("blockBlock", "pickaxe", soundTypeStone),
+ FRAME("blockFrameGt", "wrench", soundTypeMetal);
+
+ private String TEXTURE_NAME;
+ private String HARVEST_TOOL;
+ private SoundType soundOfBlock;
+ private BlockTypes (final String textureName, final String harvestTool, final SoundType blockSound)
+ {
+ this.TEXTURE_NAME = textureName;
+ this.HARVEST_TOOL = harvestTool;
+ this.soundOfBlock = blockSound;
+ }
+
+ public String getTexture() {
+ return TEXTURE_NAME;
+ }
+
+ public String getHarvestTool(){
+ return HARVEST_TOOL;
+ }
+
+ public SoundType getBlockSoundType(){
+ return soundOfBlock;
+ }
+
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
index f389f5bf32..a2d2589f5e 100644
--- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -1,9 +1,5 @@
package gtPlusPlus.core.block.base;
-import cpw.mods.fml.common.registry.GameRegistry;
-import cpw.mods.fml.common.registry.LanguageRegistry;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock;
import gtPlusPlus.core.item.base.itemblock.ItemBlockGtFrameBox;
import gtPlusPlus.core.lib.CORE;
@@ -12,142 +8,142 @@ import gtPlusPlus.core.util.math.MathUtils;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.world.IBlockAccess;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
-public class BlockBaseModular extends BasicBlock {
+public class BlockBaseModular extends BasicBlock{
- protected int blockColour;
- protected BlockTypes thisBlock;
- protected String thisBlockMaterial;
- protected final String thisBlockType;
+ protected int blockColour;
+ protected BlockTypes thisBlock;
+ protected String thisBlockMaterial;
+ protected final String thisBlockType;
- public BlockBaseModular(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType,
- final int colour) {
- super(blockType.getTexture() + unlocalizedName, Material.iron);
+ public BlockBaseModular(String unlocalizedName, String blockMaterial, BlockTypes blockType, int colour) {
+ super(blockType.getTexture()+unlocalizedName, Material.iron);
this.setHarvestLevel(blockType.getHarvestTool(), 2);
- this.setBlockTextureName(CORE.MODID + ":" + blockType.getTexture());
+ this.setBlockTextureName(CORE.MODID+":"+blockType.getTexture());
this.blockColour = colour;
this.thisBlock = blockType;
this.thisBlockMaterial = blockMaterial;
this.thisBlockType = blockType.name().toUpperCase();
- this.setBlockName(this.GetProperName());
-
- 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("==========================================");
+ this.setBlockName(GetProperName());
+
+ 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 (this.thisBlockType == BlockTypes.STANDARD.name().toUpperCase()) {
- LanguageRegistry.addName(this, "Block of " + blockMaterial);
- // Utils.LOG_INFO("Registered Block in Language Registry as:
- // "+"Block of "+blockMaterial);
+
+ 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 (this.thisBlockType == BlockTypes.FRAME.name().toUpperCase()) {
- LanguageRegistry.addName(this, blockMaterial + " Frame Box");
- // Utils.LOG_INFO("Registered Block in Language Registry as:
- // "+blockMaterial+ " Frame Box");
+ 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 (this.thisBlockType == BlockTypes.STANDARD.name().toUpperCase()) {
- GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
- Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
- // Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block
- // of "+blockMaterial);
+ //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial);
+ }
+
+ //setOreDict(unlocalizedName, blockType);
+ if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){
+ GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block of "+blockMaterial);
}
- else if (this.thisBlockType == BlockTypes.FRAME.name().toUpperCase()) {
- GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class,
- Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
- // Utils.LOG_INFO("Registered Block in Block Registry as:
- // "+blockMaterial+" Frame Box");
+ else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){
+ GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box");
}
else {
- GameRegistry.registerBlock(this, ItemBlockGtBlock.class,
- Utils.sanitizeString(blockType.getTexture() + unlocalizedName));
- // Utils.LOG_INFO("Registered Block in Block Registry as:
- // "+blockMaterial);
+ GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial);
}
-
+
+
}
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
@Override
- public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) {
-
- if (this.blockColour == 0) {
- return MathUtils.generateSingularRandomHexValue();
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass()
+ {
+ if (thisBlock == BlockTypes.FRAME){
+ return 1;
}
-
- return this.blockColour;
+ return 0;
}
+
+ /*@Override
+ public String getLocalizedName() {
+ String tempIngot;
+ if (thisBlock == BlockTypes.STANDARD){
+ tempIngot = "Block of "+thisBlockMaterial;
+ }
+ else if (thisBlock == BlockTypes.FRAME){
+ tempIngot = thisBlockMaterial + " Frame Box";
+ }
+ else {
- /*
- * @Override public String getLocalizedName() { String tempIngot; if
- * (thisBlock == BlockTypes.STANDARD){ tempIngot = "Block of "
- * +thisBlockMaterial; } else if (thisBlock == BlockTypes.FRAME){ tempIngot
- * = thisBlockMaterial + " Frame Box"; } else {
- *
- * tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot"); }
- * return tempIngot; }
- */
-
+ tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot");
+ }
+ return tempIngot;
+ }*/
+
public String GetProperName() {
- String tempIngot;
- if (this.thisBlock == BlockTypes.STANDARD) {
- tempIngot = "Block of " + this.thisBlockMaterial;
+ String tempIngot;
+ if (thisBlock == BlockTypes.STANDARD){
+ tempIngot = "Block of "+thisBlockMaterial;
}
- else if (this.thisBlock == BlockTypes.FRAME) {
- tempIngot = this.thisBlockMaterial + " Frame Box";
+ else if (thisBlock == BlockTypes.FRAME){
+ tempIngot = thisBlockMaterial + " Frame Box";
}
else {
- tempIngot = this.getUnlocalizedName().replace("tile.blockGt", "ingot");
+ tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot");
}
return tempIngot;
}
- /**
- * Returns which pass should this block be rendered on. 0 for solids and 1
- * for alpha
- */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
@Override
@SideOnly(Side.CLIENT)
- public int getRenderBlockPass() {
- if (this.thisBlock == BlockTypes.FRAME) {
- return 1;
- }
- return 0;
+ public void registerBlockIcons(IIconRegister iIcon)
+ {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + thisBlock.getTexture());
}
@Override
- public int getRenderColor(final int aMeta) {
- if (this.blockColour == 0) {
+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){
+
+ if (this.blockColour == 0){
return MathUtils.generateSingularRandomHexValue();
}
-
+
return this.blockColour;
}
-
- @Override
- public boolean isOpaqueCube() {
- return false;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public void registerBlockIcons(final IIconRegister iIcon) {
- this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture());
- }
+
+ @Override
+ public int getRenderColor(int aMeta) {
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/block/base/MetaBlock.java b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
index 3763b71448..4009c36726 100644
--- a/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
@@ -7,22 +7,22 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-public class MetaBlock extends MultiTextureBlock {
+public class MetaBlock extends MultiTextureBlock {
- protected MetaBlock(final String unlocalizedName, final Material material, final SoundType soundType) {
- super(unlocalizedName, material, soundType);
- }
-
- @Override
- public int damageDropped(final int meta) {
- return meta;
- }
-
- @Override
- public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
- for (int i = 0; i < 6; i++) {
- list.add(new ItemStack(item, 1, i));
- }
- }
-
-} \ No newline at end of file
+ protected MetaBlock(String unlocalizedName, Material material, SoundType soundType) {
+ super(unlocalizedName, material, soundType);
+ }
+
+ @Override
+ public int damageDropped(int meta) {
+ return meta;
+ }
+
+ @Override
+ public void getSubBlocks(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 6; i ++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
index 9953dfa991..4f022bae6d 100644
--- a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
+++ b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
@@ -7,29 +7,30 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
-public class MultiTextureBlock extends Block {
+public class MultiTextureBlock extends Block {
public IIcon[] icons = new IIcon[6];
-
- protected MultiTextureBlock(final String unlocalizedName, final Material material, final SoundType blockSound) {
- super(material);
- this.setBlockName(unlocalizedName);
- this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
- this.setCreativeTab(AddToCreativeTab.tabBlock);
- this.setHardness(2.0F);
- this.setResistance(6.0F);
- this.setStepSound(blockSound);
- }
-
- @Override
- public IIcon getIcon(final int side, final int meta) {
- return this.icons[side];
- }
-
- @Override
- public void registerBlockIcons(final IIconRegister reg) {
- for (int i = 0; i < 6; i++) {
- this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
- }
- }
+
+ protected MultiTextureBlock(String unlocalizedName, Material material, SoundType blockSound)
+ {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(2.0F);
+ this.setResistance(6.0F);
+ this.setStepSound(blockSound);
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister reg) {
+ for (int i = 0; i < 6; i ++) {
+ this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
+ }
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return this.icons[side];
+ }
} \ No newline at end of file