aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/block/machine
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-03-04 12:58:47 +1000
commitae21012d216df71f31aed6fbc9d76215fc24ceed (patch)
treecc89accbe6ce5c04b72ed3c5e46b2a185f88be6a /src/Java/gtPlusPlus/core/block/machine
parentba89972a22a316030f8c3bd99974f915b1d7aefc (diff)
downloadGT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.gz
GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.tar.bz2
GT5-Unofficial-ae21012d216df71f31aed6fbc9d76215fc24ceed.zip
+ 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.
Diffstat (limited to 'src/Java/gtPlusPlus/core/block/machine')
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java28
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/FishTrap.java96
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java134
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java32
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java286
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java29
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java107
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java40
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java247
9 files changed, 505 insertions, 494 deletions
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_149691_1_, int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.textureFront));
- }
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
+ {
+ return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
- @Override
+ @Override
@SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
- }
+ public void registerBlockIcons(final IIconRegister p_149651_1_)
+ {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "fishtrap");
+ }
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
{
- if (world.isRemote) return true;
+ if (world.isRemote) {
+ return true;
+ }
- TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityFishTrap){
- player.openGui(GTplusplus.instance, 5, world, x, y, z);
- return true;
- }
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityFishTrap)){
+ player.openGui(GTplusplus.instance, 5, world, x, y, z);
+ return true;
+ }
return false;
}
@@ -84,8 +86,8 @@ public class FishTrap extends BlockContainer
}
@Override
- public TileEntity createNewTileEntity(World world, int p_149915_2_) {
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileEntityFishTrap();
}
-
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java
index 9d33550bc3..64a5c5af8b 100644
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java
@@ -1,5 +1,10 @@
package gtPlusPlus.core.block.machine;
+import cpw.mods.fml.common.Optional;
+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;
@@ -17,81 +22,76 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import buildcraft.api.tools.IToolWrench;
-import cpw.mods.fml.common.Optional;
-import cpw.mods.fml.common.Optional.Interface;
-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;
@Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO")
public class Machine_Workbench extends BlockContainer
{
- @SideOnly(Side.CLIENT)
- private IIcon textureTop;
- @SideOnly(Side.CLIENT)
- private IIcon textureBottom;
- @SideOnly(Side.CLIENT)
- private IIcon textureFront;
-
- @SuppressWarnings("deprecation")
+ @SideOnly(Side.CLIENT)
+ private IIcon textureTop;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureBottom;
+ @SideOnly(Side.CLIENT)
+ private IIcon textureFront;
+
+ @SuppressWarnings("deprecation")
public Machine_Workbench()
- {
- super(Material.iron);
- this.setBlockName("blockWorkbenchGT");
- this.setCreativeTab(AddToCreativeTab.tabMachines);
- GameRegistry.registerBlock(this, "blockWorkbenchGT");
+ {
+ super(Material.iron);
+ this.setBlockName("blockWorkbenchGT");
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerBlock(this, "blockWorkbenchGT");
LanguageRegistry.addName(this, "Bronze Workbench");
-
- }
- /**
- * 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_149691_1_, int p_149691_2_)
- {
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.textureFront));
- }
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
+ {
+ return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
+ }
- @Override
+ @Override
@SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister p_149651_1_)
- {
- this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
- this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_top_crafting");
- this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side");
- this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
- }
-
- /**
- * Called upon block activation (right click on the block.)
- */
- @Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ public void registerBlockIcons(final IIconRegister p_149651_1_)
+ {
+ this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
+ this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_top_crafting");
+ this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side");
+ this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet");
+ }
+
+ /**
+ * Called upon block activation (right click on the block.)
+ */
+ @Override
+ public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
{
ItemStack heldItem = null;
- if (world.isRemote){
- heldItem = PlayerUtils.getItemStackInPlayersHand();
- }
+ if (world.isRemote){
+ heldItem = PlayerUtils.getItemStackInPlayersHand();
+ }
boolean holdingWrench = false;
if (heldItem != null){
- holdingWrench = isWrench(heldItem);
+ holdingWrench = isWrench(heldItem);
}
- if (world.isRemote) return true;
+ if (world.isRemote) {
+ return true;
+ }
- TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityWorkbench)
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityWorkbench))
{
if (!holdingWrench){
player.openGui(GTplusplus.instance, 3, world, x, y, z);
- return true;
+ return true;
}
Utils.LOG_INFO("Holding a Wrench, doing wrench things instead.");
}
@@ -99,11 +99,11 @@ public class Machine_Workbench extends BlockContainer
}
@Override
- public TileEntity createNewTileEntity(World world, int p_149915_2_) {
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileEntityWorkbench();
}
-
- public static boolean isWrench(ItemStack item){
+
+ public static boolean isWrench(final ItemStack item){
if (item.getItem() instanceof ItemToolWrench){
return true;
}
@@ -112,12 +112,12 @@ public class Machine_Workbench extends BlockContainer
}
if (LoadedMods.EnderIO){
return checkEnderIOWrench(item);
- }
+ }
return false;
}
-
+
@Optional.Method(modid = "EnderIO")
- private static boolean checkEnderIOWrench(ItemStack item){
+ private static boolean checkEnderIOWrench(final ItemStack item){
if (ReflectionUtils.doesClassExist("crazypants.enderio.api.tool.ITool")){
Class<?> wrenchClass;
try {
@@ -126,15 +126,15 @@ public class Machine_Workbench extends BlockContainer
return true;
}
}
- catch (ClassNotFoundException e1) {
+ catch (final ClassNotFoundException e1) {
return false;
- }
- }
+ }
+ }
return false;
}
-
+
@Optional.Method(modid = "Buildcraft")
- private static boolean checkBuildcraftWrench(ItemStack item){
+ private static boolean checkBuildcraftWrench(final ItemStack item){
if (ReflectionUtils.doesClassExist("buildcraft.api.tools.IToolWrench")){
Class<?> wrenchClass;
try {
@@ -143,11 +143,11 @@ public class Machine_Workbench extends BlockContainer
return true;
}
}
- catch (ClassNotFoundException e1) {
+ catch (final ClassNotFoundException e1) {
return false;
- }
- }
+ }
+ }
return false;
}
-
+
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java b/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
index d634535699..436fc5bf39 100644
--- a/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java
@@ -1,5 +1,10 @@
package gtPlusPlus.core.block.machine;
+import buildcraft.api.tools.IToolWrench;
+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;
@@ -15,11 +20,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
-import buildcraft.api.tools.IToolWrench;
-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 Machine_WorkbenchAdvanced extends BlockContainer
{
@@ -46,14 +46,14 @@ public class Machine_WorkbenchAdvanced extends BlockContainer
*/
@Override
@SideOnly(Side.CLIENT)
- public IIcon getIcon(int p_149691_1_, int p_149691_2_)
+ public IIcon getIcon(final int p_149691_1_, final int p_149691_2_)
{
- return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.textureFront));
+ return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront));
}
@Override
@SideOnly(Side.CLIENT)
- public void registerBlockIcons(IIconRegister p_149651_1_)
+ public void registerBlockIcons(final IIconRegister p_149651_1_)
{
this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top");
this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "cover_crafting");
@@ -65,11 +65,13 @@ public class Machine_WorkbenchAdvanced extends BlockContainer
* Called upon block activation (right click on the block.)
*/
@Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz)
+ public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz)
{
- ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player);
- if (world.isRemote) return true;
+ final ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player);
+ if (world.isRemote) {
+ return true;
+ }
boolean holdingWrench = false;
if (heldItem != null){
@@ -94,12 +96,12 @@ public class Machine_WorkbenchAdvanced extends BlockContainer
}
- TileEntity te = world.getTileEntity(x, y, z);
- if (te != null && te instanceof TileEntityWorkbenchAdvanced)
+ final TileEntity te = world.getTileEntity(x, y, z);
+ if ((te != null) && (te instanceof TileEntityWorkbenchAdvanced))
{
if (!holdingWrench){
player.openGui(GTplusplus.instance, 4, world, x, y, z);
- return true;
+ return true;
}
Utils.LOG_INFO("Holding a Wrench, doing wrench things instead.");
}
@@ -107,7 +109,7 @@ public class Machine_WorkbenchAdvanced extends BlockContainer
}
@Override
- public TileEntity createNewTileEntity(World world, int p_149915_2_) {
+ public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileEntityWorkbenchAdvanced(128000, 2);
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
index 7a76b09cca..ddfcf62306 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
@@ -1,12 +1,13 @@
package gtPlusPlus.core.block.machine.heliumgen.block;
+import java.util.Random;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
-
-import java.util.Random;
-
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -21,145 +22,152 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
-import cpw.mods.fml.relauncher.Side;
-import cpw.mods.fml.relauncher.SideOnly;
public class HeliumGenerator extends BlockContainer {
- private IIcon top, sides, front;
- private Random randy = new Random();
-
- public HeliumGenerator(){
- super(Material.iron);
- setStepSound(Block.soundTypeMetal);
- setHardness(20.0F);
- setBlockName("helium_collector");
- setHarvestLevel("pickaxe", 3);
- setCreativeTab(AddToCreativeTab.tabMachines);
- }
-
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons (IIconRegister iconRegister)
- {
- this.top = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
- this.sides = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
- this.front = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_FRONT");
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
- if(side == 1)
- return top;
- int facing = 2;
- TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
- if(machine != null)
- facing = machine.getFacing();
- if(side == facing)
- return front;
- else
- return sides;
- }
-
- @Override
- @SideOnly(Side.CLIENT)
- public IIcon getIcon (int side, int metadata)
- {
- if(side == 1)
- return top;
- if(side == 3)
- return front;
- return sides;
- }
-
- @Override
- public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
- {
- if (world.isRemote)
- {
- return true;
- }
+ private IIcon top, sides, front;
+ private final Random randy = new Random();
+
+ public HeliumGenerator(){
+ super(Material.iron);
+ this.setStepSound(Block.soundTypeMetal);
+ this.setHardness(20.0F);
+ this.setBlockName("helium_collector");
+ this.setHarvestLevel("pickaxe", 3);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons (final IIconRegister iconRegister)
+ {
+ this.top = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
+ this.sides = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
+ this.front = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_FRONT");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side){
+ if(side == 1) {
+ return this.top;
+ }
+ int facing = 2;
+ final TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
+ if(machine != null) {
+ facing = machine.getFacing();
+ }
+ if(side == facing) {
+ return this.front;
+ } else {
+ return this.sides;
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon (final int side, final int metadata)
+ {
+ if(side == 1) {
+ return this.top;
+ }
+ if(side == 3) {
+ return this.front;
+ }
+ return this.sides;
+ }
+
+ @Override
+ public boolean onBlockActivated (final World world, final int x, final int y, final int z, final EntityPlayer player, final int par6, final float par7, final float par8, final float par9)
+ {
+ if (world.isRemote)
+ {
+ return true;
+ }
player.openGui(GTplusplus.instance, 2, world, x, y, z);
return true;
- }
-
- @Override
- public TileEntity createNewTileEntity(World world, int meta)
- {
- return new TileEntityHeliumGenerator();
- }
-
- @Override
- public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack item)
- {
- TileEntity tile = world.getTileEntity(x, y, z);
- if(tile instanceof TileEntityHeliumGenerator) {
- TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)tile;
- int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
-
- if (l == 0)
- machine.setFacing((short) 2);
-
- if (l == 1)
- machine.setFacing((short) 5);
-
- if (l == 2)
- machine.setFacing((short) 3);
-
- if (l == 3)
- machine.setFacing((short) 4);
- }
-
- }
-
- @Override
- public void breakBlock(World world, int x, int y, int z, Block block, int wut)
- {
- TileEntityHeliumGenerator collector = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
-
- if (collector != null)
- {
- int i = 0;
- for (i = 0; i < collector.getSizeInventory(); i++){
-
- ItemStack itemstack = collector.getStackInSlot(i);
-
- if (itemstack != null)
- {
- float f = this.randy.nextFloat() * 0.8F + 0.1F;
- float f1 = this.randy.nextFloat() * 0.8F + 0.1F;
- float f2 = this.randy.nextFloat() * 0.8F + 0.1F;
-
- while (itemstack.stackSize > 0)
- {
- int j1 = this.randy.nextInt(21) + 10;
-
- if (j1 > itemstack.stackSize)
- {
- j1 = itemstack.stackSize;
- }
-
- itemstack.stackSize -= j1;
- EntityItem entityitem = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
-
- if (itemstack.hasTagCompound())
- {
- entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
- }
-
- float f3 = 0.05F;
- entityitem.motionX = (double)((float)this.randy.nextGaussian() * f3);
- entityitem.motionY = (double)((float)this.randy.nextGaussian() * f3 + 0.2F);
- entityitem.motionZ = (double)((float)this.randy.nextGaussian() * f3);
- world.spawnEntityInWorld(entityitem);
- }
- }
-
- world.func_147453_f(x, y, z, block);
- }
- }
-
- super.breakBlock(world, x, y, z, block, wut);
- }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(final World world, final int meta)
+ {
+ return new TileEntityHeliumGenerator();
+ }
+
+ @Override
+ public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase player, final ItemStack item)
+ {
+ final TileEntity tile = world.getTileEntity(x, y, z);
+ if(tile instanceof TileEntityHeliumGenerator) {
+ final TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)tile;
+ final int l = MathHelper.floor_double((player.rotationYaw * 4.0F) / 360.0F + 0.5D) & 3;
+
+ if (l == 0) {
+ machine.setFacing((short) 2);
+ }
+
+ if (l == 1) {
+ machine.setFacing((short) 5);
+ }
+
+ if (l == 2) {
+ machine.setFacing((short) 3);
+ }
+
+ if (l == 3) {
+ machine.setFacing((short) 4);
+ }
+ }
+
+ }
+
+ @Override
+ public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int wut)
+ {
+ final TileEntityHeliumGenerator collector = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
+
+ if (collector != null)
+ {
+ int i = 0;
+ for (i = 0; i < collector.getSizeInventory(); i++){
+
+ final ItemStack itemstack = collector.getStackInSlot(i);
+
+ if (itemstack != null)
+ {
+ final float f = (this.randy.nextFloat() * 0.8F) + 0.1F;
+ final float f1 = (this.randy.nextFloat() * 0.8F) + 0.1F;
+ final float f2 = (this.randy.nextFloat() * 0.8F) + 0.1F;
+
+ while (itemstack.stackSize > 0)
+ {
+ int j1 = this.randy.nextInt(21) + 10;
+
+ if (j1 > itemstack.stackSize)
+ {
+ j1 = itemstack.stackSize;
+ }
+
+ itemstack.stackSize -= j1;
+ final EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
+
+ if (itemstack.hasTagCompound())
+ {
+ entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
+ }
+
+ final float f3 = 0.05F;
+ entityitem.motionX = (float)this.randy.nextGaussian() * f3;
+ entityitem.motionY = ((float)this.randy.nextGaussian() * f3) + 0.2F;
+ entityitem.motionZ = (float)this.randy.nextGaussian() * f3;
+ world.spawnEntityInWorld(entityitem);
+ }
+ }
+
+ world.func_147453_f(x, y, z, block);
+ }
+ }
+
+ super.breakBlock(world, x, y, z, block, wut);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
index d701f6f125..4ce1238bde 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
@@ -1,11 +1,10 @@
package gtPlusPlus.core.block.machine.heliumgen.container;
+import java.util.List;
+
import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
import ic2.core.ContainerBase;
import ic2.core.slot.SlotInvSlot;
-
-import java.util.List;
-
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotFurnace;
@@ -15,11 +14,11 @@ extends ContainerBase<TileEntityHeliumGenerator>
{
public short size;
- public ContainerHeliumGenerator(InventoryPlayer player, TileEntityHeliumGenerator machine)
+ public ContainerHeliumGenerator(final InventoryPlayer player, final TileEntityHeliumGenerator machine)
{
super(machine);
//Utils.LOG_WARNING("containerHeliumGenerator");
- short sr = machine.getReactorSize();
+ final short sr = machine.getReactorSize();
this.addSlotToContainer(new SlotFurnace(player.player, machine, 2, 80, 35));
this.size = sr;
int startX = 16;
@@ -27,31 +26,31 @@ extends ContainerBase<TileEntityHeliumGenerator>
int i = 0;
for (i = 0; i < 9; i++)
{
- int x = i % this.size;
- int y = i / this.size;
+ final int x = i % this.size;
+ final int y = i / this.size;
- addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ this.addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + (18 * x), startY + (18 * y)));
}
startX = 108;
startY = 16;
for (i = 9; i < 18; i++)
{
- int x = i % this.size;
- int y = (i-9) / this.size;
+ final int x = i % this.size;
+ final int y = (i-9) / this.size;
- addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ this.addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + (18 * x), startY + (18 * y)));
}
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
- this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ this.addSlotToContainer(new Slot(player, j + (i * 9) + 9, 8 + (j * 18), 84 + (i * 18)));
}
}
for (i = 0; i < 9; ++i)
{
- this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
+ this.addSlotToContainer(new Slot(player, i, 8 + (i * 18), 142));
}
// addSlotToContainer(new SlotInvSlot(machine.coolantinputSlot, 0, 8, 25));
//addSlotToContainer(new SlotInvSlot(machine.hotcoolinputSlot, 0, 188, 25));
@@ -62,7 +61,7 @@ extends ContainerBase<TileEntityHeliumGenerator>
@Override
public List<String> getNetworkedFields()
{
- List<String> ret = super.getNetworkedFields();
+ final List<String> ret = super.getNetworkedFields();
ret.add("heat");
ret.add("maxHeat");
@@ -71,5 +70,5 @@ extends ContainerBase<TileEntityHeliumGenerator>
ret.add("outputTank");
ret.add("fluidcoolreactor");*/
return ret;
- }
+ }
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java
index 2106f144be..70e13d57e1 100644
--- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java
+++ b/src/Java/gtPlusPlus/core/bl