diff options
| author | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
|---|---|---|
| committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-11-06 19:32:27 +1000 |
| commit | cbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch) | |
| tree | b85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/core/block/machine | |
| parent | c40416b036c0e89451e1558253ccf07bbee028d0 (diff) | |
| download | GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2 GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip | |
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747.
# Conflicts:
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java
# src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java
Revert "% Cleaned up Imports."
This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/core/block/machine')
11 files changed, 1001 insertions, 927 deletions
diff --git a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java index dbbc91c902..2832d4d0a4 100644 --- a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java +++ b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java @@ -1,33 +1,34 @@ package gtPlusPlus.core.block.machine; -import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.MetaBlock; +import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.lib.CORE; import net.minecraft.block.material.Material; import net.minecraft.world.IBlockAccess; public class BlockGtFrameBox extends MetaBlock { - private int[] colours; - private int totalColours; - - public BlockGtFrameBox(final String unlocalizedName, final Material material, final BlockTypes blockTypeENUM, - final boolean recolour, final int... colour) { + private int[] colours; + private int totalColours; + + public BlockGtFrameBox( + String unlocalizedName, Material material, + BlockTypes blockTypeENUM, boolean recolour, int... colour) { super(unlocalizedName, material, blockTypeENUM.getBlockSoundType()); - 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; - } + this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame"); + this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2); + if (recolour && (colour != null && colour.length > 0)){ + colours = colour; + totalColours = colours.length; + } } @Override - 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) { - - } + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, + int p_149720_3_, int p_149720_4_) { + for (int i : 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/Machine_Charger.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java index e88c5c5b6b..4f426b99c9 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java @@ -1,11 +1,12 @@ package gtPlusPlus.core.block.machine; -import java.util.ArrayList; - import gtPlusPlus.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityCharger; + +import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -16,67 +17,67 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import scala.util.Random; -public class Machine_Charger extends BlockContainer { - private static final String name = "Charging Machine"; - - private final Random rand = new Random(); - - public Machine_Charger(final String unlocalizedName) { - super(Material.iron); - // GameRegistry.registerBlock(this, unlocalizedName); - this.setBlockName(unlocalizedName); - this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabMachines); - } - - @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, - final int par6) { - if (world.isRemote) { - return; - } - - final ArrayList drops = new ArrayList(); - - final TileEntity teRaw = world.getTileEntity(x, y, z); - - if (teRaw != null && teRaw instanceof TileEntityCharger) { - final TileEntityCharger te = (TileEntityCharger) teRaw; - - for (int i = 0; i < te.getSizeInventory(); i++) { - final ItemStack stack = te.getStackInSlot(i); - - if (stack != null) { - drops.add(stack.copy()); - } - } - } - - for (int i = 0; i < drops.size(); i++) { - final EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i)); - item.setVelocity((this.rand.nextDouble() - 0.5) * 0.25, this.rand.nextDouble() * 0.5 * 0.25, - (this.rand.nextDouble() - 0.5) * 0.25); - world.spawnEntityInWorld(item); - } - } - - @Override - public TileEntity createNewTileEntity(final World world, final int par2) { - return new TileEntityCharger(); - } - - @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; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileEntityCharger) { - player.openGui(GTplusplus.instance, 1, world, x, y, z); - return true; - } - return false; - } +public class Machine_Charger extends BlockContainer +{ + private static final String name = "Charging Machine"; + + private final Random rand = new Random(); + + public Machine_Charger(String unlocalizedName) + { + super(Material.iron); + //GameRegistry.registerBlock(this, unlocalizedName); + this.setBlockName(unlocalizedName); + this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabMachines); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz) + { + if (world.isRemote) return true; + + TileEntity te = world.getTileEntity(x, y, z); + if (te != null && te instanceof TileEntityCharger) + { + player.openGui(GTplusplus.instance, 1, world, x, y, z); + return true; + } + return false; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int par6) + { + if (world.isRemote) return; + + ArrayList drops = new ArrayList(); + + TileEntity teRaw = world.getTileEntity(x, y, z); + + if (teRaw != null && teRaw instanceof TileEntityCharger) + { + TileEntityCharger te = (TileEntityCharger) teRaw; + + for (int i = 0; i < te.getSizeInventory(); i++) + { + ItemStack stack = te.getStackInSlot(i); + + if (stack != null) drops.add(stack.copy()); + } + } + + for (int i = 0;i < drops.size();i++) + { + EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i)); + item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25); + world.spawnEntityInWorld(item); + } + } + + @Override + public TileEntity createNewTileEntity(World world, int par2) + { + return new TileEntityCharger(); + } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java b/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java index cfad3006b9..011e293000 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java @@ -1,11 +1,12 @@ package gtPlusPlus.core.block.machine; -import java.util.ArrayList; - import gtPlusPlus.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.machines.TileEntityNHG; + +import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -16,67 +17,67 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import scala.util.Random; -public class Machine_NHG extends BlockContainer { - private static final String name = "Nuclear Fueled Helium Generator"; - - private final Random rand = new Random(); - - public Machine_NHG(final String unlocalizedName) { - super(Material.iron); - // GameRegistry.registerBlock(this, unlocalizedName); - this.setBlockName(unlocalizedName); - this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); - this.setCreativeTab(AddToCreativeTab.tabMachines); - } - - @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, - final int par6) { - if (world.isRemote) { - return; - } - - final ArrayList drops = new ArrayList(); - - final TileEntity teRaw = world.getTileEntity(x, y, z); - - if (teRaw != null && teRaw instanceof TileEntityNHG) { - final TileEntityNHG te = (TileEntityNHG) teRaw; - - for (int i = 0; i < te.getSizeInventory(); i++) { - final ItemStack stack = te.getStackInSlot(i); - - if (stack != null) { - drops.add(stack.copy()); - } - } - } - - for (int i = 0; i < drops.size(); i++) { - final EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i)); - item.setVelocity((this.rand.nextDouble() - 0.5) * 0.25, this.rand.nextDouble() * 0.5 * 0.25, - (this.rand.nextDouble() - 0.5) * 0.25); - world.spawnEntityInWorld(item); - } - } - - @Override - public TileEntity createNewTileEntity(final World world, final int par2) { - return new TileEntityNHG(); - } - - @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; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileEntityNHG) { - player.openGui(GTplusplus.instance, 0, world, x, y, z); - return true; - } - return false; - } +public class Machine_NHG extends BlockContainer +{ + private static final String name = "Nuclear Fueled Helium Generator"; + + private final Random rand = new Random(); + + public Machine_NHG(String unlocalizedName) + { + super(Material.iron); + //GameRegistry.registerBlock(this, unlocalizedName); + this.setBlockName(unlocalizedName); + this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName); + this.setCreativeTab(AddToCreativeTab.tabMachines); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz) + { + if (world.isRemote) return true; + + TileEntity te = world.getTileEntity(x, y, z); + if (te != null && te instanceof TileEntityNHG) + { + player.openGui(GTplusplus.instance, 0, world, x, y, z); + return true; + } + return false; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int par6) + { + if (world.isRemote) return; + + ArrayList drops = new ArrayList(); + + TileEntity teRaw = world.getTileEntity(x, y, z); + + if (teRaw != null && teRaw instanceof TileEntityNHG) + { + TileEntityNHG te = (TileEntityNHG) teRaw; + + for (int i = 0; i < te.getSizeInventory(); i++) + { + ItemStack stack = te.getStackInSlot(i); + + if (stack != null) drops.add(stack.copy()); + } + } + + for (int i = 0;i < drops.size();i++) + { + EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i)); + item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25); + world.spawnEntityInWorld(item); + } + } + + @Override + public TileEntity createNewTileEntity(World world, int par2) + { + return new TileEntityNHG(); + } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java b/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java index e881d40d35..e964a9da01 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.block.machine; -public class Machine_WireiusDeletus { // A Block that removes GT Cable and Wire - // from it's inventory. +public class Machine_WireiusDeletus { //A Block that removes GT Cable and Wire from it's inventory. } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java index 1921aa8000..ed986b756e 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Workbench.java @@ -1,11 +1,5 @@ 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 crazypants.enderio.api.tool.ITool; import gtPlusPlus.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; @@ -21,85 +15,96 @@ 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; +import crazypants.enderio.api.tool.ITool; -public class Machine_Workbench extends BlockContainer { - @SideOnly(Side.CLIENT) - private IIcon textureTop; - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - @SideOnly(Side.CLIENT) - private IIcon textureFront; +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") - public Machine_Workbench() { - super(Material.iron); - this.setBlockName("blockWorkbenchGT"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, "blockWorkbenchGT"); + @SuppressWarnings("deprecation") + public Machine_Workbench() + { + super(Material.iron); + this.setBlockName("blockWorkbenchGT"); + this.setCreativeTab(AddToCreativeTab.tabMachines); + GameRegistry.registerBlock(this, "blockWorkbenchGT"); LanguageRegistry.addName(this, "Bronze Workbench"); + + } - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityWorkbench(); - } + /** + * 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)); + } - /** - * Gets the block's texture. Args: side, meta - */ - @Override + @Override @SideOnly(Side.CLIENT) - 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; - } + 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(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) { + /** + * 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) + { ItemStack heldItem = null; - if (world.isRemote) { - heldItem = PlayerUtils.getItemStackInPlayersHand(); - } + if (world.isRemote){ + heldItem = PlayerUtils.getItemStackInPlayersHand(); + } boolean holdingWrench = false; - if (heldItem != null) { - if (heldItem.getItem() instanceof ItemToolWrench) { + if (heldItem != null){ + if (heldItem.getItem() instanceof ItemToolWrench){ holdingWrench = true; } - else if (heldItem.getItem() instanceof IToolWrench) { + else if (heldItem.getItem() instanceof IToolWrench){ holdingWrench = true; } - else if (heldItem.getItem() instanceof ITool) { + else if (heldItem.getItem() instanceof ITool){ holdingWrench = true; } - /* - * else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){ - * GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) - * heldItem.getItem(); if (testTool.canWrench(player, x, y, z)){ - * holdingWrench = true; } } - */ + /*else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){ + GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) heldItem.getItem(); + if (testTool.canWrench(player, x, y, z)){ + holdingWrench = true; + } + }*/ else { holdingWrench = false; } } - if (world.isRemote) { - return true; - } + if (world.isRemote) return true; - final TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileEntityWorkbench) { - if (!holdingWrench) { + 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."); } @@ -107,11 +112,7 @@ public class Machine_Workbench extends BlockContainer { } @Override - @SideOnly(Side.CLIENT) - 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"); + public TileEntity createNewTileEntity(World world, int p_149915_2_) { + return new TileEntityWorkbench(); } }
\ 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 20d6c8601c..2f061ea298 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java @@ -1,11 +1,5 @@ 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 crazypants.enderio.api.tool.ITool; import gtPlusPlus.GTplusplus; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; @@ -21,17 +15,25 @@ 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; +import crazypants.enderio.api.tool.ITool; -public class Machine_WorkbenchAdvanced extends BlockContainer { +public class Machine_WorkbenchAdvanced extends BlockContainer +{ @SideOnly(Side.CLIENT) - private IIcon textureTop; + private IIcon textureTop; @SideOnly(Side.CLIENT) - private IIcon textureBottom; + private IIcon textureBottom; @SideOnly(Side.CLIENT) - private IIcon textureFront; + private IIcon textureFront; @SuppressWarnings("deprecation") - public Machine_WorkbenchAdvanced() { + public Machine_WorkbenchAdvanced() + { super(Material.iron); this.setBlockName("blockWorkbenchGTAdvanced"); this.setCreativeTab(AddToCreativeTab.tabMachines); @@ -40,61 +42,65 @@ public class Machine_WorkbenchAdvanced extends BlockContainer { } - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityWorkbenchAdvanced(128000, 2); - } - /** * Gets the block's texture. Args: side, meta */ @Override @SideOnly(Side.CLIENT) - 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; + 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)); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(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"); + this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top"); + this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top"); } /** * 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) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, float lz) + { - final ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player); - if (world.isRemote) { - return true; - } + ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player); + if (world.isRemote) return true; boolean holdingWrench = false; - if (heldItem != null) { - if (heldItem.getItem() instanceof ItemToolWrench) { + if (heldItem != null){ + if (heldItem.getItem() instanceof ItemToolWrench){ holdingWrench = true; } - else if (heldItem.getItem() instanceof IToolWrench) { + else if (heldItem.getItem() instanceof IToolWrench){ holdingWrench = true; } - else if (heldItem.getItem() instanceof ITool) { + else if (heldItem.getItem() instanceof ITool){ holdingWrench = true; } - /* - * else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){ - * GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) - * heldItem.getItem(); if (testTool.canWrench(player, x, y, z)){ - * holdingWrench = true; } } - */ + /*else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){ + GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) heldItem.getItem(); + if (testTool.canWrench(player, x, y, z)){ + holdingWrench = true; + } + }*/ else { holdingWrench = false; } } - final TileEntity te = world.getTileEntity(x, y, z); - if (te != null && te instanceof TileEntityWorkbenchAdvanced) { - if (!holdingWrench) { + + 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."); } @@ -102,11 +108,7 @@ public class Machine_WorkbenchAdvanced extends BlockContainer { } @Override - @SideOnly(Side.CLIENT) - 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"); - this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top"); - this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top"); + public TileEntity createNewTileEntity(World world, 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 19e9b09e8f..7a76b09cca 100644 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java +++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java @@ -1,13 +1,12 @@ 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; @@ -22,145 +21,145 @@ 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 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); - } - - @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); - } - - @Override - public TileEntity createNewTileEntity(final World world, final int meta) { - return new TileEntityHeliumGenerator(); - } - - @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; - } + 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(); |
