diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 02:07:40 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-01-20 02:07:40 +1000 |
commit | a6bb1b33da251f4a2ec7a6d6facb4864e9905341 (patch) | |
tree | 84d47440794cadd5c64598355903b123e18e0662 /src/Java/gtPlusPlus/core/block | |
parent | 142fe00070526484862f15f3a125400a22a2fe96 (diff) | |
download | GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.gz GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.tar.bz2 GT5-Unofficial-a6bb1b33da251f4a2ec7a6d6facb4864e9905341.zip |
+ Added a power cost of 32eu/action for the Tree Farmer. (Will eventually get a config option).
% Moved the internal power buffer variable out of the cut method into the class.
% Massive project tidy up, lots of old unused code removed or tidied up.
$ Fixed lots of String comparisons that used == instead of .equals().
$ Fixed Double/Triple/Quad null checks in certain places.
$ Fixed returns that set values at the same time.
$ Swapped 3.14 and 1.57 to Math.PI and Math.PI/2.
$ Fixed possible cases where a NPE may be thrown, by calling logging outside of null checks.
+ Added PI to CORE.java, since it's a double and MC uses it as a float in each instance.
- Stripped 95% of the useless code out of Meta_GT_Proxy.java
Diffstat (limited to 'src/Java/gtPlusPlus/core/block')
4 files changed, 7 insertions, 173 deletions
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java index 9e71370197..d694557f55 100644 --- a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java +++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java @@ -45,15 +45,15 @@ public class BlockBaseModular extends BasicBlock{ //Utils.LOG_INFO("=========================================="); } - if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){ + if (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 == BlockTypes.FRAME.name().toUpperCase()){ + else if (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 == BlockTypes.ORE.name().toUpperCase()){ + else if (thisBlockType.equals(BlockTypes.ORE.name().toUpperCase())){ LanguageRegistry.addName(this, blockMaterial+ " Ore"); //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial+ " Frame Box"); } @@ -63,15 +63,15 @@ public class BlockBaseModular extends BasicBlock{ } //setOreDict(unlocalizedName, blockType); - if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){ + 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); } - else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){ + else if (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"); } - else if (thisBlockType == BlockTypes.ORE.name().toUpperCase()){ + else if (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"); } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java deleted file mode 100644 index 4f426b99c9..0000000000 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java +++ /dev/null @@ -1,83 +0,0 @@ -package gtPlusPlus.core.block.machine; - -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; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -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(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 deleted file mode 100644 index 011e293000..0000000000 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java +++ /dev/null @@ -1,83 +0,0 @@ -package gtPlusPlus.core.block.machine; - -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; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -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(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/heliumgen/tileentity/TileEntityHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java index 343f37527e..ffc4745059 100644 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java +++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java @@ -249,7 +249,6 @@ public class TileEntityHeliumGenerator extends TileEntityInventory implements II private boolean redstone = false; private boolean fluidcoolreactor = false; private boolean active = true; - public boolean prevActive = false; public short getReactorSize() @@ -273,6 +272,7 @@ public class TileEntityHeliumGenerator extends TileEntityInventory implements II return cols; } + @Override protected void updateEntityServer() { Utils.LOG_WARNING("updateEntityServer"); |