From ae21012d216df71f31aed6fbc9d76215fc24ceed Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 4 Mar 2017 12:58:47 +1000 Subject: + New texture for the slow builders ring. + Added the Alkalus Disk. $ Fixed Frame Box Assembler Recipes. $ Fixed Missing 7Li material. $ Fixed Tiered Tanks not showing their capacity in the tooltip. $ Fixed tooltips for alloys containing Bronze or Steel. $ Fixed Clay Pipe Extruder Recipes. - Removed a handful of Plasma cells for misc. materials. % Changed the Industrial Coke Oven's tooltip, to better describe the input/output requirements. % Cleaned up The Entire Project. --- src/Java/gtPlusPlus/core/block/ModBlocks.java | 10 +- .../gtPlusPlus/core/block/base/AdvancedBlock.java | 36 +- .../gtPlusPlus/core/block/base/BasicBlock.java | 90 ++-- .../core/block/base/BlockBaseModular.java | 104 ++--- .../gtPlusPlus/core/block/base/BlockBaseOre.java | 40 +- src/Java/gtPlusPlus/core/block/base/MetaBlock.java | 36 +- .../core/block/base/MultiTextureBlock.java | 48 +- .../gtPlusPlus/core/block/general/FirePit.java | 223 ++++----- .../gtPlusPlus/core/block/general/LightGlass.java | 81 ++-- .../core/block/general/antigrief/TowerDevice.java | 513 +++++++++++---------- .../general/fluids/BlockFluidJackDaniels.java | 78 ++-- .../core/block/machine/BlockGtFrameBox.java | 28 +- .../gtPlusPlus/core/block/machine/FishTrap.java | 96 ++-- .../core/block/machine/Machine_Workbench.java | 134 +++--- .../block/machine/Machine_WorkbenchAdvanced.java | 32 +- .../machine/heliumgen/block/HeliumGenerator.java | 286 ++++++------ .../container/ContainerHeliumGenerator.java | 29 +- .../machine/heliumgen/gui/GUIHeliumGenerator.java | 107 +++-- .../machine/heliumgen/slots/InvSlotRadiation.java | 40 +- .../tileentity/TileEntityHeliumGenerator.java | 247 +++++----- 20 files changed, 1148 insertions(+), 1110 deletions(-) (limited to 'src/Java/gtPlusPlus/core/block') diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index 1f8ca23b30..8acb757063 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.block; +import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.block.general.FirePit; @@ -11,7 +12,6 @@ import gtPlusPlus.core.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.fluids.Fluid; -import cpw.mods.fml.common.registry.GameRegistry; public final class ModBlocks { @@ -34,9 +34,9 @@ public final class ModBlocks { public static Fluid fluidJackDaniels = new Fluid("fluidJackDaniels"); public static Block blockFluidJackDaniels; public static Block blockCasings2Misc; - + public static Block blockFirePit; - + public static Block blockOreFluorite; @@ -45,7 +45,7 @@ public final class ModBlocks { Utils.LOG_INFO("Initializing Blocks."); //blockGriefSaver = new TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault"); - registerBlocks(); + registerBlocks(); } public static void registerBlocks(){ @@ -63,7 +63,7 @@ public final class ModBlocks { blockFishTrap = new FishTrap(); blockOreFluorite = new BlockBaseOre("oreFluorite", "Fluorite", Material.rock, BlockTypes.ORE, Utils.rgbtoHexValue(120, 120, 30), 3); - + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java index b7ac24a71b..7a0b715138 100644 --- a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java +++ b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java @@ -9,23 +9,23 @@ import net.minecraft.world.World; public class AdvancedBlock extends Block { - 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; - } + 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; + } } diff --git a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java index 2823fcc5b7..9e3a5fc37f 100644 --- a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java +++ b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java @@ -10,56 +10,56 @@ import net.minecraft.world.World; public class BasicBlock extends BlockContainer { - public BasicBlock(final String unlocalizedName, final Material material) { - this(unlocalizedName, material, 2); - } - - public BasicBlock(final String unlocalizedName, final Material material, int harvestLevel) { - 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", harvestLevel); - this.setStepSound(soundTypeMetal); - } + public BasicBlock(final String unlocalizedName, final Material material) { + this(unlocalizedName, material, 2); + } + + public BasicBlock(final String unlocalizedName, final Material material, final int harvestLevel) { + 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", harvestLevel); + this.setStepSound(soundTypeMetal); + } + + + public static enum BlockTypes { + STANDARD("blockBlock", "pickaxe", soundTypeMetal), + FRAME("blockFrameGt", "wrench", soundTypeMetal), + ORE("blockStone", "pickaxe", soundTypeStone); - - public static enum BlockTypes { - STANDARD("blockBlock", "pickaxe", soundTypeMetal), - FRAME("blockFrameGt", "wrench", soundTypeMetal), - ORE("blockStone", "pickaxe", soundTypeStone); - - 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; - } + 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; - } - - } + public String getTexture() { + return this.TEXTURE_NAME; + } + + public String getHarvestTool(){ + return this.HARVEST_TOOL; + } + + public SoundType getBlockSoundType(){ + return this.soundOfBlock; + } + + } @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) { return null; } - + } diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java index d694557f55..c8923a9301 100644 --- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java +++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java @@ -1,5 +1,9 @@ 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; @@ -8,10 +12,6 @@ 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{ @@ -21,11 +21,11 @@ public class BlockBaseModular extends BasicBlock{ protected final String thisBlockType; - public BlockBaseModular(String unlocalizedName, String blockMaterial, BlockTypes blockType, int colour) { + public BlockBaseModular(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType, final int colour) { this(unlocalizedName, blockMaterial, Material.iron, blockType, colour, 2); } - - public BlockBaseModular(String unlocalizedName, String blockMaterial, Material vanillaMaterial, BlockTypes blockType, int colour, int miningLevel) { + + public BlockBaseModular(final String unlocalizedName, final String blockMaterial, final Material vanillaMaterial, final BlockTypes blockType, final int colour, final int miningLevel) { super(unlocalizedName, vanillaMaterial); this.setHarvestLevel(blockType.getHarvestTool(), miningLevel); this.setBlockTextureName(CORE.MODID+":"+blockType.getTexture()); @@ -33,8 +33,8 @@ public class BlockBaseModular extends BasicBlock{ this.thisBlock = blockType; this.thisBlockMaterial = blockMaterial; this.thisBlockType = blockType.name().toUpperCase(); - this.setBlockName(GetProperName()); - + this.setBlockName(this.GetProperName()); + if (!CORE.DEBUG){ //Utils.LOG_INFO("=============Block Info Dump============="); //Utils.LOG_INFO("thisBlock.name().toLowerCase() - "+thisBlock.name().toLowerCase()); @@ -44,43 +44,43 @@ public class BlockBaseModular extends BasicBlock{ //Utils.LOG_INFO("blockMaterial - "+blockMaterial); //Utils.LOG_INFO("=========================================="); } - - if (thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())){ + + if (this.thisBlockType.equals(BlockTypes.STANDARD.name().toUpperCase())){ LanguageRegistry.addName(this, "Block of "+blockMaterial); //Utils.LOG_INFO("Registered Block in Language Registry as: "+"Block of "+blockMaterial); } - else if (thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())){ + else if (this.thisBlockType.equals(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.equals(BlockTypes.ORE.name().toUpperCase())){ + else if (this.thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())){ LanguageRegistry.addName(this, blockMaterial+ " Ore"); //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 (thisBlockType.equals(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); + if (this.thisBlockType.equals(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 (thisBlockType.equals(BlockTypes.FRAME.name().toUpperCase())){ + else if (this.thisBlockType.equals(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"); + //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box"); } - else if (thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())){ + else if (this.thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())){ GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName)); - //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box"); + //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); + //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial); } - - + + } /** @@ -90,15 +90,15 @@ public class BlockBaseModular extends BasicBlock{ @SideOnly(Side.CLIENT) public int getRenderBlockPass() { - if (thisBlock == BlockTypes.FRAME){ - return 1; + if (this.thisBlock == BlockTypes.FRAME){ + return 1; } return 0; } - + /*@Override public String getLocalizedName() { - String tempIngot; + String tempIngot; if (thisBlock == BlockTypes.STANDARD){ tempIngot = "Block of "+thisBlockMaterial; } @@ -111,55 +111,55 @@ public class BlockBaseModular extends BasicBlock{ } return tempIngot; }*/ - + public String GetProperName() { - String tempIngot; - if (thisBlock == BlockTypes.STANDARD){ - tempIngot = "Block of "+thisBlockMaterial; + String tempIngot; + if (this.thisBlock == BlockTypes.STANDARD){ + tempIngot = "Block of "+this.thisBlockMaterial; } - else if (thisBlock == BlockTypes.FRAME){ - tempIngot = thisBlockMaterial + " Frame Box"; + else if (this.thisBlock == BlockTypes.FRAME){ + tempIngot = this.thisBlockMaterial + " Frame Box"; } - else if (thisBlock == BlockTypes.ORE){ - tempIngot = thisBlockMaterial + " Ore"; + else if (this.thisBlock == BlockTypes.ORE){ + tempIngot = this.thisBlockMaterial + " Ore"; } else { - tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot"); + tempIngot = this.getUnlocalizedName().replace("tile.blockGt", "ingot"); } return tempIngot; } @Override public boolean isOpaqueCube() - { - return false; - } + { + return false; + } @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iIcon) + public void registerBlockIcons(final IIconRegister iIcon) { - this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + thisBlock.getTexture()); + this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture()); } @Override - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){ - + public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){ + if (this.blockColour == 0){ return MathUtils.generateSingularRandomHexValue(); } - + return this.blockColour; } - - @Override - public int getRenderColor(int aMeta) { - if (this.blockColour == 0){ + + @Override + public int getRenderColor(final int aMeta) { + if (this.blockColour == 0){ return MathUtils.generateSingularRandomHexValue(); } - + return this.blockColour; - } + } } diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java index c57aa248b4..c1e58e9393 100644 --- a/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java +++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseOre.java @@ -1,13 +1,13 @@ package gtPlusPlus.core.block.base; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockBaseOre extends BlockBaseModular{ @@ -21,18 +21,18 @@ public class BlockBaseOre extends BlockBaseModular{ return true; }*/ - public BlockBaseOre(String unlocalizedName, String blockMaterial, BlockTypes blockType, int colour) { + public BlockBaseOre(final String unlocalizedName, final String blockMaterial, final BlockTypes blockType, final int colour) { this(unlocalizedName, blockMaterial, Material.iron, blockType, colour, 2); } - - public BlockBaseOre(String unlocalizedName, String blockMaterial, Material vanillaMaterial, BlockTypes blockType, int colour, int miningLevel) { - super(unlocalizedName, blockMaterial, vanillaMaterial, blockType, colour, miningLevel); + + public BlockBaseOre(final String unlocalizedName, final String blockMaterial, final Material vanillaMaterial, final BlockTypes blockType, final int colour, final int miningLevel) { + super(unlocalizedName, blockMaterial, vanillaMaterial, blockType, colour, miningLevel); } /** * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha */ - + /*@Override @SideOnly(Side.CLIENT) public int getRenderBlockPass() @@ -48,30 +48,30 @@ public class BlockBaseOre extends BlockBaseModular{ @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iIcon) + public void registerBlockIcons(final IIconRegister iIcon) { - this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + thisBlock.getTexture()); - //this.base = iIcon.registerIcon(CORE.MODID + ":" + "blockStone"); + this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + this.thisBlock.getTexture()); + //this.base = iIcon.registerIcon(CORE.MODID + ":" + "blockStone"); //this.overlay = iIcon.registerIcon(CORE.MODID + ":" + "blockOre_Overlay"); } @Override - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){ + public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){ if (this.blockColour == 0){ return MathUtils.generateSingularRandomHexValue(); - } + } return this.blockColour; } - - @Override - public int getRenderColor(int aMeta) { - if (this.blockColour == 0){ + + @Override + public int getRenderColor(final 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 4009c36726..3e116eeb7f 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(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 + 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 diff --git a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java index 4f022bae6d..4e91509c6e 100644 --- a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java +++ b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java @@ -7,30 +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(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]; - } + + 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 void registerBlockIcons(final IIconRegister reg) { + for (int i = 0; i < 6; i ++) { + this.icons[i] = reg.registerIcon(this.textureName + "_" + i); + } + } + + @Override + public IIcon getIcon(final int side, final int meta) { + return this.icons[side]; + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/general/FirePit.java b/src/Java/gtPlusPlus/core/block/general/FirePit.java index 4dd58df6a4..cf24025124 100644 --- a/src/Java/gtPlusPlus/core/block/general/FirePit.java +++ b/src/Java/gtPlusPlus/core/block/general/FirePit.java @@ -1,13 +1,17 @@ package gtPlusPlus.core.block.general; import static net.minecraftforge.common.util.ForgeDirection.*; -import gtPlusPlus.core.block.base.BasicBlock; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import java.util.List; import java.util.Random; +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.block.base.BasicBlock; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -19,10 +23,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -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 FirePit extends BasicBlock{ private static IIcon[] TEXTURE; @@ -40,44 +40,44 @@ public class FirePit extends BasicBlock{ GameRegistry.registerBlock(this, "blockFirePit"); LanguageRegistry.addName(this, "Fire Pit"); } - + @Override - public int tickRate(World aParWorld) { - return 30; - } - - @Override - public TileEntity createNewTileEntity(World world, int i) { - return new TileEntityFirepit(); - } - + public int tickRate(final World aParWorld) { + return 30; + } + + @Override + public TileEntity createNewTileEntity(final World world, final int i) { + return new TileEntityFirepit(); + } + @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister){ + public void registerBlockIcons(final IIconRegister par1IconRegister){ TEXTURE = new IIcon[] {par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")}; } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List){ + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List){ par3List.add(new ItemStack(par1, 1, 2)); } @Override - public void updateTick(World par1World, int x, int y, int z, Random par5Random){ + public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random){ if (!par1World.isRemote){ //Sets meta. - meta = par1World.getBlockMetadata(x, y, z); + this.meta = par1World.getBlockMetadata(x, y, z); //If Raining, Put out. - if (par1World.isRaining() - && (par1World.canLightningStrikeAt(x, y, z) - || par1World.canLightningStrikeAt(x - 1, y, z) - || par1World.canLightningStrikeAt(x + 1, y, z) - || par1World.canLightningStrikeAt(x, y, z - 1) - || par1World.canLightningStrikeAt(x, y, z + 1))){ + if (par1World.isRaining() + && (par1World.canLightningStrikeAt(x, y, z) + || par1World.canLightningStrikeAt(x - 1, y, z) + || par1World.canLightningStrikeAt(x + 1, y, z) + || par1World.canLightningStrikeAt(x, y, z - 1) + || par1World.canLightningStrikeAt(x, y, z + 1))){ //Fire goes out - par1World.setBlockMetadataWithNotify(x, y, z, 1, 4); - } + par1World.setBlockMetadataWithNotify(x, y, z, 1, 4); + } if (isNeighborBurning(par1World, x, y, z)){ //Fire can ignite from a nearby flame source. par1World.setBlockMetadataWithNotify(x, y, z, 2, 4); @@ -86,9 +86,9 @@ public class FirePit extends BasicBlock{ } @Override - public Item getItemDropped(int meta, Random par2Random, int par3){ + public Item getItemDropped(final int meta, final Random par2Random, final int par3){ switch (meta){ - case 0: + case 0: return null; default: break; @@ -97,20 +97,20 @@ public class FirePit extends BasicBlock{ } @Override - public int damageDropped(int meta){ + public int damageDropped(final int meta){ return meta; } - + @Override public boolean isOpaqueCube(){ - return false; - } + return false; + } @Override public int getRenderType(){ - return -1; - } - + return -1; + } + @Override @SideOnly(Side.CLIENT) public int getRenderBlockPass(){ @@ -121,7 +121,7 @@ public class FirePit extends BasicBlock{ public boolean renderAsNormalBlock(){ return false; } - + /*@Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World aParWorld, int x, int y, int z){ return null; @@ -134,92 +134,95 @@ public class FirePit extends BasicBlock{ @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_){ + public void randomDisplayTick(final World p_149734_1_, final int p_149734_2_, final int p_149734_3_, final int p_149734_4_, final Random p_149734_5_){ int l; float f; float f1; float f2; - if (meta == 2) - if (p_149734_5_.nextInt(24) == 0){ - p_149734_1_.playSound((double)((float)p_149734_2_ + 0.5F), (double)((float)p_149734_3_ + 0.5F), (double)((float)p_149734_4_ + 0.5F), "fire.fire", 1.0F + p_149734_5_.nextFloat(), p_149734_5_.nextFloat() * 0.7F + 0.3F, false); + if (this.meta == 2) { + if (p_149734_5_.nextInt(24) == 0){ + p_149734_1_.playSound(p_149734_2_ + 0.5F, p_149734_3_ + 0.5F, p_149734_4_ + 0.5F, "fire.fire", 1.0F + p_149734_5_.nextFloat(), (p_149734_5_.nextFloat() * 0.7F) + 0.3F, false); + } } - if (meta == 2) - if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)){ - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat() * 0.1F; - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (this.meta == 2) { + if (!World.doesBlockHaveSolidTopSurface(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_) && !Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ - 1, p_149734_4_, UP)){ + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ - 1, p_149734_3_, p_149734_4_, EAST)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + (p_149734_5_.nextFloat() * 0.1F); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)){ - for (l = 0; l < 2; ++l){ - f = (float)(p_149734_2_ + 1) - p_149734_5_.nextFloat() * 0.1F; - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_ + 1, p_149734_3_, p_149734_4_, WEST)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + 1 - (p_149734_5_.nextFloat() * 0.1F); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat() * 0.1F; - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ - 1, SOUTH)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + (p_149734_5_.nextFloat() * 0.1F); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat(); - f2 = (float)(p_149734_4_ + 1) - p_149734_5_.nextFloat() * 0.1F; - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_, p_149734_4_ + 1, NORTH)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + p_149734_5_.nextFloat(); + f2 = p_149734_4_ + 1 - (p_149734_5_.nextFloat() * 0.1F); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } - } - if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)){ - for (l = 0; l < 2; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)(p_149734_3_ + 1) - p_149734_5_.nextFloat() * 0.1F; - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + if (Blocks.fire.canCatchFire(p_149734_1_, p_149734_2_, p_149734_3_ + 1, p_149734_4_, DOWN)){ + for (l = 0; l < 2; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + 1 - (p_149734_5_.nextFloat() * 0.1F); + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } } - } - else{ - if (meta == 2) - for (l = 0; l < 3; ++l){ - f = (float)p_149734_2_ + p_149734_5_.nextFloat(); - f1 = (float)p_149734_3_ + p_149734_5_.nextFloat() * 0.5F + 0.5F; - f2 = (float)p_149734_4_ + p_149734_5_.nextFloat(); - p_149734_1_.spawnParticle("largesmoke", (double)f, (double)f1, (double)f2, 0.0D, 0.0D, 0.0D); + else{ + if (this.meta == 2) { + for (l = 0; l < 3; ++l){ + f = p_149734_2_ + p_149734_5_.nextFloat(); + f1 = p_149734_3_ + (p_149734_5_.nextFloat() * 0.5F) + 0.5F; + f2 = p_149734_4_ + p_149734_5_.nextFloat(); + p_149734_1_.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } + } } } } - @SideOnly(Side.CLIENT) - public static IIcon getFireIcon(int p_149840_1_){ - return FirePit.TEXTURE[p_149840_1_]; - } + @SideOnly(Side.CLIENT) + public static IIcon getFireIcon(final int p_149840_1_){ + return FirePit.TEXTURE[p_149840_1_]; + } - @Override + @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(int p_149691_1_, int p_149691_2_){ - return FirePit.TEXTURE[0]; - } - - private static boolean isNeighborBurning(World world, int x, int y, int z){ - return canCatchFire(world, x + 1, y, z, WEST ) || - canCatchFire(world, x - 1, y, z, EAST ) || - canCatchFire(world, x, y - 1, z, UP ) || - canCatchFire(world, x, y + 1, z, DOWN ) || - canCatchFire(world, x, y, z - 1, SOUTH) || - canCatchFire(world, x, y, z + 1, NORTH); - } - - public static boolean canCatchFire(World world, int x, int y, int z, ForgeDirection face) - { - return world.getBlock(x, y, z).isFireSource(world, x, y, z, face); - } - + public IIcon getIcon(final int p_149691_1_, final int p_149691_2_){ + return FirePit.TEXTURE[0]; + } + + private static boolean isNeighborBurning(final World world, final int x, final int y, final int z){ + return canCatchFire(world, x + 1, y, z, WEST ) || + canCatchFire(world, x - 1, y, z, EAST ) || + canCatchFire(world, x, y - 1, z, UP ) || + canCatchFire(world, x, y + 1, z, DOWN ) || + canCatchFire(world, x, y, z - 1, SOUTH) || + canCatchFire(world, x, y, z + 1, NORTH); + } + + public static boolean canCatchFire(final World world, final int x, final int y, final int z, final ForgeDirection face) + { + return world.getBlock(x, y, z).isFireSource(world, x, y, z, face); + } + } diff --git a/src/Java/gtPlusPlus/core/block/general/LightGlass.java b/src/Java/gtPlusPlus/core/block/general/LightGlass.java index 5aa9f5b818..fd2d575158 100644 --- a/src/Java/gtPlusPlus/core/block/general/LightGlass.java +++ b/src/Java/gtPlusPlus/core/block/general/LightGlass.java @@ -1,29 +1,28 @@ package gtPlusPlus.core.block.general; +import java.util.Random; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; - -import java.util.Random; - import net.minecraft.block.BlockBreakable; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class LightGlass extends BlockBreakable { private int state = 0; - private int a = 255; + private final int a = 255; private int r = 255; private int g = 0; private int b = 0; private int hex; - public LightGlass(Material mat, boolean bool) + public LightGlass(final Material mat, final boolean bool) { super("blockMFEffect", mat, bool); this.setCreativeTab(AddToCreativeTab.tabBlock); @@ -38,7 +37,7 @@ public class LightGlass extends BlockBreakable * Returns the quantity of items to drop on block destruction. */ @Override - public int quantityDropped(Random rand) + public int quantityDropped(final Random rand) { return 0; } @@ -73,47 +72,53 @@ public class LightGlass extends BlockBreakable @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iIcon) + public void registerBlockIcons(final IIconRegister iIcon) { this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockMFEffect"); } @Override //http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4) { - if(state == 0){ - g++; - if(g == 255) - state = 1; + if(this.state == 0){ + this.g++; + if(this.g == 255) { + this.state = 1; + } } - if(state == 1){ - r--; - if(r == 0) - state = 2; + if(this.state == 1){ + this.r--; + if(this.r == 0) { + this.state = 2; + } } - if(state == 2){ - b++; - if(b == 255) - state = 3; + if(this.state == 2){ + this.b++; + if(this.b == 255) { + this.state = 3; + } } - if(state == 3){ - g--; - if(g == 0) - state = 4; + if(this.state == 3){ + this.g--; + if(this.g == 0) { + this.state = 4; + } } - if(state == 4){ - r++; - if(r == 255) - state = 5; + if(this.state == 4){ + this.r++; + if(this.r == 255) { + this.state = 5; + } } - if(state == 5){ - b--; - if(b == 0) - state = 0; + if(this.state == 5){ + this.b--; + if(this.b == 0) { + this.state = 0; + } } - hex = (a << 24) + (r << 16) + (g << 8) + (b); - return hex; + this.hex = (this.a << 24) + (this.r << 16) + (this.g << 8) + (this.b); + return this.hex; } /** @@ -121,8 +126,8 @@ public class LightGlass extends BlockBreakable */ @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, int posX, int posY, int posZ, Random random){ + public void randomDisplayTick(final World world, final int posX, final int posY, final int posZ, final Random random){ Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud"); - + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java index 7fa890b6c8..8ac4e2df8d 100644 --- a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java +++ b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java @@ -1,14 +1,16 @@ package gtPlusPlus.core.block.general.antigrief; import static gtPlusPlus.core.block.ModBlocks.blockGriefSaver; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.tileentities.general.TileEntityReverter; -import gtPlusPlus.core.util.Utils; import java.util.List; import java.util.Random; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.tileentities.general.TileEntityReverter; +import gtPlusPlus.core.util.Utils; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -23,254 +25,267 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class TowerDevice extends Block { - private static IIcon TEX_ANTIBUILDER; - public static final int META_ANTIBUILDER = 9; - private boolean bUnbreakable; - - public TowerDevice() - { - super(Material.wood); - setHardness(10.0F); - setResistance(35.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(AddToCreativeTab.tabMachines); - } - - public int tickRate() - { - return 15; - } - - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("bUnbreakable", bUnbreakable); + private static IIcon TEX_ANTIBUILDER; + public static final int META_ANTIBUILDER = 9; + private boolean bUnbreakable; + + public TowerDevice() + { + super(Material.wood); + this.setHardness(10.0F); + this.setResistance(35.0F); + this.setStepSound(Block.soundTypeWood); + this.setCreativeTab(AddToCreativeTab.tabMachines); + } + + public int tickRate() + { + return 15; + } + + public void saveNBTData(final NBTTagCompound aNBT) { + aNBT.setBoolean("bUnbreakable", this.bUnbreakable); + } + + public void loadNBTData(final NBTTagCompound aNBT) { + this.bUnbreakable = aNBT.getBoolean("bUnbreakable"); + } + + @Override + public IIcon getIcon(final int side, final int meta) + { + return TEX_ANTIBUILDER; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(final IIconRegister par1IconRegister) + { + TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief"); + } + + @Override + public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) + { + par3List.add(new ItemStack(par1, 1, 9)); + } + + @Override + public boolean onBlockActivated(final World par1World, final int x, final int y, final int z, final EntityPlayer par5EntityPlayer, final int par6, final float par7, final float par8, final float par9) + { + final int meta = par1World.getBlockMetadata(x, y, z); + return false; + } + + @Override + public float getExplosionResistance(final Entity par1Entity, final World world, final int x, final int y, final int z, final double explosionX, final double explosionY, final double explosionZ) + { + final int meta = world.getBlockMetadata(x, y, z); + return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); + } + + @Override + public float getBlockHardness(final World world, final int x, final int y, final int z) + { + final int meta = world.getBlockMetadata(x, y, z); + return super.getBlockHardness(world, x, y, z); + } + + public static boolean areNearbyLockBlocks(final World world, final int x, final int y, final int z) + { + boolean locked = false; + for (int dx = x - 2; dx <= (x + 2); dx++) { + for (int dy = y - 2; dy <= (y + 2); dy++) { + for (int dz = z - 2; dz <= (z + 2); dz++) { + if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) { + locked = true; + } + } + } + } + return locked; + } + + public static void unlockBlock(final World par1World, final int x, final int y, final int z) + { + final Block thereBlockID = par1World.getBlock(x, y, z); + final int thereBlockMeta = par1World.getBlockMetadata(x, y, z); + if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4)) + { + changeToBlockMeta(par1World, x, y, z, 5); + par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F); + } + } + + private static void changeToBlockMeta(final World par1World, final int x, final int y, final int z, final int meta) + { + final Block thereBlockID = par1World.getBlock(x, y, z); + if ((thereBlockID == blockGriefSaver)) + { + par1World.setBlock(x, y, z, thereBlockID, meta, 3); + par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID); + } + } + + @Override + public void onBlockAdded(final World par1World, final int x, final int y, final int z) + { + final int meta = par1World.getBlockMetadata(x, y, z); + if (!par1World.isRemote) { + + } + } + + @Override + public void onNeighborBlockChange(final World par1World, final int x, final int y, final int z, final Block myBlockID) + { + final int meta = par1World.getBlockMetadata(x, y, z); + if (!par1World.isRemote) + { + + } + } + + @Override + public void updateTick(final World par1World, final int x, final int y, final int z, final Random par5Random) + { + if (!par1World.isRemote) + { + final int meta = par1World.getBlockMetadata(x, y, z); + } + } + + private void letsBuild(final World par1World, final int x, final int y, final int z) + { + + } + + private boolean isInactiveTrapCharged(final World par1World, final int x, final int y, final int z) + { + return false; + } + + private boolean isReactorReady(final World world, final int x, final int y, final int z) + { + if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) || + (world.getBlock(x, y - 1, z) != Blocks.redstone_block) || + (world.getBlock(x + 1, y, z) != Blocks.redstone_block) || + (world.getBlock(x - 1, y, z) != Blocks.redstone_block) || + (world.getBlock(x, y, z + 1) != Blocks.redstone_block) || + (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) { + return false; + } + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(final World par1World, final int x, final int y, final int z, final Random par5Random) + { + final int meta = par1World.getBlockMetadata(x, y, z); + if ((meta == 3) || (meta == 1) || (meta == 9)) { + for (int i = 0; i < 1; i++) { + this.sparkle(par1World, x, y, z, par5Random); + } + } + } + + public void sparkle(final World world, final int x, final int y, final int z, final Random rand) + { + final double offset = 0.0625D; + for (int side = 0; side < 6; side++) + { + double rx = x + rand.nextFloat(); + double ry = y + rand.nextFloat(); + double rz = z + rand.nextFloat(); + if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) { + ry = y + 1 + offset; + } + if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) { + ry = (y + 0) - offset; + } + if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) { + rz = z + 1 + offset; + } + if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) { + rz = (z + 0) - offset; + } + if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) { + rx = x + 1 + offset; + } + if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) { + rx = (x + 0) - offset; + } + if ((rx < x) || (rx > (x + 1)) || (ry < 0.0D) || (ry > (y + 1)) || (rz < z) || (rz > (z + 1))) { + world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D); + } + } + } + + public static void checkAndActivateVanishBlock(final World world, final int x, final int y, final int z) + { + final Block thereID = world.getBlock(x, y, z); + final int thereMeta = world.getBlockMetadata(x, y, z); + } + + public static void changeToActiveVanishBlock(final World par1World, final int x, final int y, final int z, final int meta) + { + changeToBlockMeta(par1World, x, y, z, meta); + par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F); + + final Block thereBlockID = par1World.getBlock(x, y, z); + par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand)); + } + + private static int getTickRateFor(final Block thereBlockID, final int meta, final Random rand) + { + return 15; + } + + @Override + public int getLightValue(final IBlockAccess world, final int x, final int y, final int z) + { + final Block blockID = world.getBlock(x, y, z); + final int meta = world.getBlockMetadata(x, y, z); + if (blockID != this) { + return 0; + } + return 10; + } + + @Override + public boolean hasTileEntity(final int metadata) + { + return (metadata == 0); + } + + @Override + public TileEntity createTileEntity(final World world, final int metadata) + { + if (metadata == 0) { + Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName()); + return new TileEntityReverter(); + } + return null; + } + + @Override + public Item getItemDropped(final int meta, final Random par2Random, final int par3) + { + switch (meta) + { + case 0: + return null; + } + return Item.getItemFromBlock(this); } - public void loadNBTData(NBTTagCompound aNBT) { - bUnbreakable = aNBT.getBoolean("bUnbreakable"); + @Override + public int damageDropped(final int meta) + { + return meta; } - - public IIcon getIcon(int side, int meta) - { - return TEX_ANTIBUILDER; - } - - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief"); - } - - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) - { - par3List.add(new ItemStack(par1, 1, 9)); - } - - public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) - { - int meta = par1World.getBlockMetadata(x, y, z); - return false; - } - - public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) - { - int meta = world.getBlockMetadata(x, y, z); - return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ); - } - - public float getBlockHardness(World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - return super.getBlockHardness(world, x, y, z); - } - - public static boolean areNearbyLockBlocks(World world, int x, int y, int z) - { - boolean locked = false; - for (int dx = x - 2; dx <= x + 2; dx++) { - for (int dy = y - 2; dy <= y + 2; dy++) { - for (int dz = z - 2; dz <= z + 2; dz++) { - if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) { - locked = true; - } - } - } - } - return locked; - } - - public static void unlockBlock(World par1World, int x, int y, int z) - { - Block thereBlockID = par1World.getBlock(x, y, z); - int thereBlockMeta = par1World.getBlockMetadata(x, y, z); - if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4)) - { - changeToBlockMeta(par1World, x, y, z, 5); - par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F); - } - } - - private static void changeToBlockMeta(World par1World, int x, int y, int z, int meta) - { - Block thereBlockID = par1World.getBlock(x, y, z); - if ((thereBlockID == blockGriefSaver)) - { - par1World.setBlock(x, y, z, thereBlockID, meta, 3); - par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z); - par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID); - } - } - - public void onBlockAdded(World par1World, int x, int y, int z) - { - int meta = par1World.getBlockMetadata(x, y, z); - if (!par1World.isRemote) { - - } - } - - public void onNeighborBlockChange(World par1World, int x, int y, int z, Block myBlockID) - { - int meta = par1World.getBlockMetadata(x, y, z); - if (!par1World.isRemote) - { - - } - } - - public void updateTick(World par1World, int x, int y, int z, Random par5Random) - { - if (!par1World.isRemote) - { - int meta = par1World.getBlockMetadata(x, y, z); - } - } - - private void letsBuild(World par1World, int x, int y, int z) - { - - } - - private boolean isInactiveTrapCharged(World par1World, int x, int y, int z) - { - return false; - } - - private boolean isReactorReady(World world, int x, int y, int z) - { - if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) || - (world.getBlock(x, y - 1, z) != Blocks.redstone_block) || - (world.getBlock(x + 1, y, z) != Blocks.redstone_block) || - (world.getBlock(x - 1, y, z) != Blocks.redstone_block) || - (world.getBlock(x, y, z + 1) != Blocks.redstone_block) || - (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) { - return false; - } - return true; - } - - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int x, int y, int z, Random par5Random) - { - int meta = par1World.getBlockMetadata(x, y, z); - if ((meta == 3) || (meta == 1) || (meta == 9)) { - for (int i = 0; i < 1; i++) { - sparkle(par1World, x, y, z, par5Random); - } - } - } - - public void sparkle(World world, int x, int y, int z, Random rand) - { - double offset = 0.0625D; - for (int side = 0; side < 6; side++) - { - double rx = x + rand.nextFloat(); - double ry = y + rand.nextFloat(); - double rz = z + rand.nextFloat(); - if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) { - ry = y + 1 + offset; - } - if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) { - ry = y + 0 - offset; - } - if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) { - rz = z + 1 + offset; - } - if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) { - rz = z + 0 - offset; - } - if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) { - rx = x + 1 + offset; - } - if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) { - rx = x + 0 - offset; - } - if ((rx < x) || (rx > x + 1) || (ry < 0.0D) || (ry > y + 1) || (rz < z) || (rz > z + 1)) { - world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D); - } - } - } - - public static void checkAndActivateVanishBlock(World world, int x, int y, int z) - { - Block thereID = world.getBlock(x, y, z); - int thereMeta = world.getBlockMetadata(x, y, z); - } - - public static void changeToActiveVanishBlock(World par1World, int x, int y, int z, int meta) - { - changeToBlockMeta(par1World, x, y, z, meta); - par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F); - - Block thereBlockID = par1World.getBlock(x, y, z); - par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand)); - } - - private static int getTickRateFor(Block thereBlockID, int meta, Random rand) - { - return 15; - } - - public int getLightValue(IBlockAccess world, int x, int y, int z) - { - Block blockID = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - if (blockID != this) { - return 0; - } - return 10; - } - - public boolean hasTileEntity(int metadata) - { - return (metadata == 0); - } - - public TileEntity createTileEntity(World world, int metadata) - { - if (metadata == 0) { - Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName()); - return new TileEntityReverter(); - } - return null; - } - - public Item getItemDropped(int meta, Random par2Random, int par3) - { - switch (meta) - { - case 0: - return null; - } - return Item.getItemFromBlock(this); - } - - public int damageDropped(int meta) - { - return meta; - } } diff --git a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java index 6096da7054..9d80072b61 100644 --- a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java +++ b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.block.general.fluids; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import net.minecraft.block.material.Material; @@ -9,43 +11,45 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; public class BlockFluidJackDaniels extends BlockFluidClassic { - @SideOnly(Side.CLIENT) - protected IIcon stillIcon; - @SideOnly(Side.CLIENT) - protected IIcon flowingIcon; - - public BlockFluidJackDaniels(Fluid fluid, Material material) { - super(fluid, material); - setCreativeTab(AddToCreativeTab.tabMisc); - } - - @Override - public IIcon getIcon(int side, int meta) { - return (side == 0 || side == 1)? stillIcon : flowingIcon; - } - - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(IIconRegister register) { - stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); - flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); - } - - @Override - public boolean canDisplace(IBlockAccess world, int x, int y, int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; - return super.canDisplace(world, x, y, z); - } - - @Override - public boolean displaceIfPossible(World world, int x, int y, int z) { - if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; - return super.displaceIfPossible(world, x, y, z); - } - -} + @SideOnly(Side.CLIENT) + protected IIcon stillIcon; + @SideOnly(Side.CLIENT) + protected IIcon flowingIcon; + + public BlockFluidJackDaniels(final Fluid fluid, final Material material) { + super(fluid, material); + this.setCreativeTab(AddToCreativeTab.tabMisc); + } + + @Override + public IIcon getIcon(final int side, final int meta) { + return ((side == 0) || (side == 1))? this.stillIcon : this.flowingIcon; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(final IIconRegister register) { + this.stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); + this.flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels"); + } + + @Override + public boolean canDisplace(final IBlockAccess world, final int x, final int y, final int z) { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) { + return false; + } + return super.canDisplace(world, x, y, z); + } + + @Override + public boolean displaceIfPossible(final World world, final int x, final int y, final int z) { + if (world.getBlock(x, y, z).getMaterial().isLiquid()) { + return false; + } + return super.displaceIfPossible(world, x, y, z); + } + +} diff --git a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java index 6de87e522b..cab02f9db6 100644 --- a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java +++ b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java @@ -10,25 +10,25 @@ public class BlockGtFrameBox extends MetaBlock { private int[] colours; private int totalColours; - + public BlockGtFrameBox( - String unlocalizedName, Material material, - BlockTypes blockTypeENUM, boolean recolour, int... colour) { + final String unlocalizedName, final Material material, + final BlockTypes blockTypeENUM, final boolean recolour, final int... colour) { super(unlocalizedName, material, blockTypeENUM.getBlockSoundType()); - this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame"); - this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2); - if (recolour && (colour != null && colour.length > 0)){ - colours = colour; - totalColours = colours.length; - } + this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame"); + this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2); + if (recolour && ((colour != null) && (colour.length > 0))){ + this.colours = colour; + this.totalColours = this.colours.length; + } } @Override - public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, - int p_149720_3_, int p_149720_4_) { - for (int i : colours){ - - } + public int colorMultiplier(final IBlockAccess p_149720_1_, final int p_149720_2_, + final int p_149720_3_, final int p_149720_4_) { + for (final int i : this.colours){ + + } return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_); } diff --git a/src/Java/gtPlusPlus/core/block/machine/FishTrap.java b/src/Java/gtPlusPlus/core/block/machine/FishTrap.java index 089e63597b..a8e842f882 100644 --- a/src/Java/gtPlusPlus/core/block/machine/FishTrap.java +++ b/src/Java/gtPlusPlus/core/block/machine/FishTrap.java @@ -1,5 +1,9 @@ package gtPlusPlus.core.block.machine; +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.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; @@ -11,65 +15,63 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; -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 FishTrap extends BlockContainer { - @SideOnly(Side.CLIENT) - private IIcon textureTop; - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - @SideOnly(Side.CLIENT) - private IIcon textureFront; + @SideOnly(Side.CLIENT) + private IIcon textureTop; + @SideOnly(Side.CLIENT) + private IIcon textureBottom; + @SideOnly(Side.CLIENT) + private IIcon textureFront; + - @SuppressWarnings("deprecation") public FishTrap() - { - super(Material.wood); - this.setBlockName("blockFishTrap"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, "blockFishTrap"); + { + super(Material.wood); + this.setBlockName("blockFishTrap"); + this.setCreativeTab(AddToCreativeTab.tabMachines); + GameRegistry.registerBlock(this, "blockFishTrap"); LanguageRegistry.addName(this, "Fish Catcher"); - - } - /** - * Gets the block's texture. Args: side, meta - */ - @Override + } + + /** + * Gets the block's texture. Args: side, meta + */ + @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(int p_149