From b905837bf19788749cd360a2d13b165a0c96cca7 Mon Sep 17 00:00:00 2001 From: Bob Date: Sun, 20 Sep 2020 23:31:37 +0200 Subject: [PATCH] finished cyclotron, recipe tweaks --- src/main/java/assets/hbm/lang/en_US.lang | 2 +- .../gui/generators/gui_turbine_large.png | Bin 3121 -> 3221 bytes .../textures/gui/machine/gui_cyclotron.png | Bin 5281 -> 5276 bytes .../hbm/textures/items/ingot_schrabidate.png | Bin 0 -> 338 bytes .../hbm/textures/items/powder_schrabidate.png | Bin 0 -> 346 bytes src/main/java/com/hbm/blocks/ModBlocks.java | 2 +- .../blocks/machine/DummyBlockIGenerator.java | 22 +- .../blocks/machine/MachineCrystallizer.java | 1 - .../hbm/blocks/machine/MachineCyclotron.java | 18 + .../hbm/blocks/machine/MachineIGenerator.java | 56 ++- .../hbm/entity/projectile/EntityShrapnel.java | 7 +- .../com/hbm/explosion/ExplosionThermo.java | 54 +-- .../handler/nei/CyclotronRecipeHandler.java | 10 +- .../com/hbm/inventory/AssemblerRecipes.java | 14 +- .../com/hbm/inventory/CyclotronRecipes.java | 136 +++++-- .../container/ContainerMachineCyclotron.java | 93 +++-- .../com/hbm/inventory/gui/GUIIGenerator.java | 9 - .../inventory/gui/GUIMachineCyclotron.java | 19 +- .../hbm/inventory/gui/GUIMachineRadar.java | 1 - .../hbm/items/machine/ItemMachineUpgrade.java | 27 ++ src/main/java/com/hbm/lib/RefStrings.java | 2 +- .../java/com/hbm/main/CraftingManager.java | 2 + .../java/com/hbm/main/ModEventHandler.java | 42 +-- .../render/tileentity/RenderSmallReactor.java | 65 +++- .../tileentity/machine/TileEntityBarrel.java | 1 - .../machine/TileEntityMachineCMBFactory.java | 4 +- .../machine/TileEntityMachineCyclotron.java | 231 ++++++++++-- .../machine/TileEntityMachineIGenerator.java | 351 +---------------- .../TileEntityMachineReactorSmall.java | 355 +++++++++--------- 29 files changed, 742 insertions(+), 782 deletions(-) create mode 100644 src/main/java/assets/hbm/textures/items/ingot_schrabidate.png create mode 100644 src/main/java/assets/hbm/textures/items/powder_schrabidate.png diff --git a/src/main/java/assets/hbm/lang/en_US.lang b/src/main/java/assets/hbm/lang/en_US.lang index 09635c3ce..e8c66bd11 100644 --- a/src/main/java/assets/hbm/lang/en_US.lang +++ b/src/main/java/assets/hbm/lang/en_US.lang @@ -1606,7 +1606,7 @@ item.rod_dual_tritium.name=Dual Tritium Cell item.rod_dual_u233.name=U233 Dual Rod item.rod_dual_u235.name=U235 Dual Rod item.rod_dual_u238.name=U238 Dual Rod -item.rod_dual_uranium.name=Uranium Dual Fuel Rod +item.rod_dual_uranium.name=Uranium Dual Rod item.rod_dual_uranium_fuel.name=Uranium Dual Fuel Rod item.rod_dual_uranium_fuel_depleted.name=Depleted Uranium Dual Fuel Rod item.rod_dual_waste.name=Nuclear Waste Dual Rod diff --git a/src/main/java/assets/hbm/textures/gui/generators/gui_turbine_large.png b/src/main/java/assets/hbm/textures/gui/generators/gui_turbine_large.png index 66d3d954c76580cc87d393578db4da6e21d917d7..9eea8062a81b99607c70c8d69e201a54eabd51e6 100644 GIT binary patch delta 2856 zcmV+@3)l3q7?l~2Gk*+BNkl?*&7aeR5^8ouOwT(SzAHeA|foy&U66pp`jx)Bt=OiMfv~z072skC{0f4zgOUjv}&%4FHjs5U?x1<}g@@6#%X#5m1xu zb}J$xyWLLy*Zjl#cmF;9A|m}Nc+)hhx&VJ`zo7DCZvOc8ckh=GyI*VE|KD`~2~e+4 z7hw5M_mSUJ^nZ5CKx5?>v04DY+n{9Kb+1c1oP_20Ge-BKEB zwOUDvo3R#)MUoJhTRH#nm;W^2+5eZ9%5GkxBLGqy5mFo>ja2LN`1qJ)IVq0(sqVyl zzC*5>mVZF0a_)6EpnMMjyYg!egU%MfX0sXf26uONNt;(G*5~o@QU3Mouff0j@xzC+ z*I(}M&zJM`l)TwEW_jD~R<5tFlZ8Nv@_BrG%)bBh2>_Aq%CD^>kfaM>C;ixsKIFao zzNftdr~doC+B^Avzjq$>d_T`2SNROxUOu6-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 diff --git a/src/main/java/assets/hbm/textures/items/powder_schrabidate.png b/src/main/java/assets/hbm/textures/items/powder_schrabidate.png new file mode 100644 index 0000000000000000000000000000000000000000..e7349f73d1ed8bdb32c90e846cb140471c6b5cf5 GIT binary patch literal 346 zcmV-g0j2(lP)RX8&X-M$OR(g2C0JGil9wS zU>6Udovjlhcmwx=Ajb9uZy;k46ZS18ptkJVfgSzQ|s308A1CFlk+4 z(nVbs*$OA=>Px0bH zo39`2u$#T}b`}*U=v0nrWZl63^5>`Q7J#`p=De`95d>1)dA~iti(8HF(^b literal 0 HcmV?d00001 diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 83f70739e..e9aa56ac8 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -1820,7 +1820,7 @@ public class ModBlocks { GameRegistry.registerBlock(machine_generator, machine_generator.getUnlocalizedName()); GameRegistry.registerBlock(machine_controller, machine_controller.getUnlocalizedName()); GameRegistry.registerBlock(machine_reactor_small, machine_reactor_small.getUnlocalizedName()); - //GameRegistry.registerBlock(machine_industrial_generator, machine_industrial_generator.getUnlocalizedName()); + GameRegistry.registerBlock(machine_industrial_generator, machine_industrial_generator.getUnlocalizedName()); GameRegistry.registerBlock(machine_radgen, machine_radgen.getUnlocalizedName()); GameRegistry.registerBlock(machine_cyclotron, machine_cyclotron.getUnlocalizedName()); GameRegistry.registerBlock(machine_rtg_grey, machine_rtg_grey.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/machine/DummyBlockIGenerator.java b/src/main/java/com/hbm/blocks/machine/DummyBlockIGenerator.java index 9a0c0c393..257cebc20 100644 --- a/src/main/java/com/hbm/blocks/machine/DummyBlockIGenerator.java +++ b/src/main/java/com/hbm/blocks/machine/DummyBlockIGenerator.java @@ -17,6 +17,7 @@ import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; public class DummyBlockIGenerator extends BlockContainer implements IDummy { @@ -80,23 +81,12 @@ public class DummyBlockIGenerator extends BlockContainer implements IDummy { @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(world.isRemote) - { + + if(world.isRemote) { return true; - } else if(!player.isSneaking()) - { - TileEntity te = world.getTileEntity(x, y, z); - if(te != null && te instanceof TileEntityDummy) { - int a = ((TileEntityDummy)te).targetX; - int b = ((TileEntityDummy)te).targetY; - int c = ((TileEntityDummy)te).targetZ; - - TileEntityMachineIGenerator entity = (TileEntityMachineIGenerator) world.getTileEntity(a, b, c); - if(entity != null) - { - FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_industrial_generator, world, a, b, c); - } - } + } else if(!player.isSneaking()) { + + player.addChatComponentMessage(new ChatComponentText("The IGen has been retired, you may break it for recycling.")); return true; } else { return false; diff --git a/src/main/java/com/hbm/blocks/machine/MachineCrystallizer.java b/src/main/java/com/hbm/blocks/machine/MachineCrystallizer.java index e6503d92e..198c320a0 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineCrystallizer.java +++ b/src/main/java/com/hbm/blocks/machine/MachineCrystallizer.java @@ -13,7 +13,6 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; diff --git a/src/main/java/com/hbm/blocks/machine/MachineCyclotron.java b/src/main/java/com/hbm/blocks/machine/MachineCyclotron.java index b65e555d3..a976fb669 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineCyclotron.java +++ b/src/main/java/com/hbm/blocks/machine/MachineCyclotron.java @@ -3,6 +3,7 @@ package com.hbm.blocks.machine; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.main.MainRegistry; +import com.hbm.tileentity.TileEntityProxyCombo; import com.hbm.tileentity.machine.TileEntityMachineCyclotron; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; @@ -10,6 +11,7 @@ import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; public class MachineCyclotron extends BlockDummyable { @@ -23,6 +25,9 @@ public class MachineCyclotron extends BlockDummyable { if(meta >= 12) return new TileEntityMachineCyclotron(); + if(meta >= 6) + return new TileEntityProxyCombo(false, true, true); + return null; } @@ -69,4 +74,17 @@ public class MachineCyclotron extends BlockDummyable { public int getOffset() { return 2; } + + protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) { + super.fillSpace(world, x, y, z, dir, o); + + this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o + 1); + this.makeExtra(world, x + dir.offsetX * o + 2, y, z + dir.offsetZ * o - 1); + this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o + 1); + this.makeExtra(world, x + dir.offsetX * o - 2, y, z + dir.offsetZ * o - 1); + this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o + 2); + this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o + 2); + this.makeExtra(world, x + dir.offsetX * o + 1, y, z + dir.offsetZ * o - 2); + this.makeExtra(world, x + dir.offsetX * o - 1, y, z + dir.offsetZ * o - 2); + } } diff --git a/src/main/java/com/hbm/blocks/machine/MachineIGenerator.java b/src/main/java/com/hbm/blocks/machine/MachineIGenerator.java index 172affe53..3f65d2de9 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineIGenerator.java +++ b/src/main/java/com/hbm/blocks/machine/MachineIGenerator.java @@ -1,10 +1,12 @@ package com.hbm.blocks.machine; +import java.util.ArrayList; import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.handler.MultiblockHandler; import com.hbm.interfaces.IMultiblock; +import com.hbm.items.ModItems; import com.hbm.main.MainRegistry; import com.hbm.tileentity.machine.TileEntityDummy; import com.hbm.tileentity.machine.TileEntityMachineIGenerator; @@ -16,11 +18,13 @@ import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.MathHelper; import net.minecraft.world.World; @@ -37,9 +41,41 @@ public class MachineIGenerator extends BlockContainer implements IMultiblock { } @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { - return Item.getItemFromBlock(ModBlocks.machine_industrial_generator); - } + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + + ArrayList ret = new ArrayList(); + + //front + ret.add(new ItemStack(ModItems.ingot_steel, 3)); + ret.add(new ItemStack(ModItems.plate_steel, 6)); + ret.add(new ItemStack(ModItems.tank_steel, 4)); + ret.add(new ItemStack(ModItems.turbine_titanium, 1)); + ret.add(new ItemStack(ModItems.wire_red_copper, 6)); + ret.add(new ItemStack(ModItems.wire_gold, 4)); + + //body + ret.add(new ItemStack(ModItems.wire_gold, 42)); + ret.add(new ItemStack(Items.iron_ingot, 6)); + ret.add(new ItemStack(ModItems.ingot_steel, 3)); + + ret.add(new ItemStack(ModItems.plate_iron, 1)); + ret.add(new ItemStack(ModItems.wire_gold, 42)); + ret.add(new ItemStack(ModItems.ingot_steel, 3)); + + //rotor + ret.add(new ItemStack(ModItems.wire_gold, 42)); + ret.add(new ItemStack(Items.iron_ingot, 6)); + ret.add(new ItemStack(ModItems.ingot_steel, 3)); + + ret.add(new ItemStack(ModItems.ingot_steel, 6)); + ret.add(new ItemStack(ModItems.board_copper, 4)); + ret.add(new ItemStack(ModItems.wire_gold, 8)); + ret.add(new ItemStack(ModBlocks.red_wire_coated, 2)); + ret.add(new ItemStack(ModItems.pedestal_steel, 2)); + ret.add(new ItemStack(ModItems.circuit_copper, 4)); + + return ret; + } @Override public int getRenderType() { @@ -180,16 +216,12 @@ public class MachineIGenerator extends BlockContainer implements IMultiblock { @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(world.isRemote) - { + + if(world.isRemote) { return true; - } else if(!player.isSneaking()) - { - TileEntityMachineIGenerator entity = (TileEntityMachineIGenerator) world.getTileEntity(x, y, z); - if(entity != null) - { - FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_industrial_generator, world, x, y, z); - } + } else if(!player.isSneaking()) { + + player.addChatComponentMessage(new ChatComponentText("The IGen has been retired, you may break it for recycling.")); return true; } else { return false; diff --git a/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java b/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java index e6afdbd35..db855bfbe 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java +++ b/src/main/java/com/hbm/entity/projectile/EntityShrapnel.java @@ -48,8 +48,11 @@ public class EntityShrapnel extends EntityThrowable { if(this.ticksExisted > 5) { this.setDead(); - if(!this.worldObj.isRemote) - worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 0.1F, true); + + for(int i = 0; i < 5; i++) + worldObj.spawnParticle("lava", posX, posY, posZ, 0.0, 0.0, 0.0); + + worldObj.playSoundEffect(posX, posY, posZ, "random.fizz", 1.0F, 1.0F); } } diff --git a/src/main/java/com/hbm/explosion/ExplosionThermo.java b/src/main/java/com/hbm/explosion/ExplosionThermo.java index 890a730b6..b878197c7 100644 --- a/src/main/java/com/hbm/explosion/ExplosionThermo.java +++ b/src/main/java/com/hbm/explosion/ExplosionThermo.java @@ -459,49 +459,23 @@ public class ExplosionThermo { bombStartStrength = (int)f; } - public static void setEntitiesOnFire(World world, int x, int y, int z, int bombStartStrength) { - float f = bombStartStrength; - new HashSet(); - int i; - int j; - int k; - double d5; - double d6; - double d7; - double wat = bombStartStrength; - bombStartStrength *= 2.0F; - i = MathHelper.floor_double(x - wat - 1.0D); - j = MathHelper.floor_double(x + wat + 1.0D); - k = MathHelper.floor_double(y - wat - 1.0D); - int i2 = MathHelper.floor_double(y + wat + 1.0D); - int l = MathHelper.floor_double(z - wat - 1.0D); - int j2 = MathHelper.floor_double(z + wat + 1.0D); - List list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2)); - Vec3.createVectorHelper(x, y, z); + public static void setEntitiesOnFire(World world, double x, double y, double z, int radius) { - for (int i1 = 0; i1 < list.size(); ++i1) - { - Entity entity = (Entity)list.get(i1); - double d4 = entity.getDistance(x, y, z) / bombStartStrength; + List list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(x - radius, y - radius, z - radius, x + radius, y + radius, z + radius)); - if (d4 <= 1.0D) - { - d5 = entity.posX - x; - d6 = entity.posY + entity.getEyeHeight() - y; - d7 = entity.posZ - z; - double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); - if (d9 < wat && !(entity instanceof EntityOcelot) && entity instanceof EntityLivingBase) - { + for(Entity e : list) { + + if(e.getDistance(x, y, z) <= radius) { - if(!(entity instanceof EntityPlayer && ArmorUtil.checkForAsbestos((EntityPlayer) entity))) { - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 15 * 20, 4)); - entity.setFire(10); - } - } - } - } - - bombStartStrength = (int)f; + if(!(e instanceof EntityPlayer && ArmorUtil.checkForAsbestos((EntityPlayer) e))) { + + if(e instanceof EntityLivingBase) + ((EntityLivingBase) e).addPotionEffect(new PotionEffect(Potion.weakness.getId(), 15 * 20, 4)); + + e.setFire(10); + } + } + } } } diff --git a/src/main/java/com/hbm/handler/nei/CyclotronRecipeHandler.java b/src/main/java/com/hbm/handler/nei/CyclotronRecipeHandler.java index fc729c900..25a374c9d 100644 --- a/src/main/java/com/hbm/handler/nei/CyclotronRecipeHandler.java +++ b/src/main/java/com/hbm/handler/nei/CyclotronRecipeHandler.java @@ -6,7 +6,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import com.hbm.inventory.MachineRecipes; +import com.hbm.inventory.CyclotronRecipes; import com.hbm.inventory.gui.GUIMachineCyclotron; import com.hbm.lib.RefStrings; @@ -61,7 +61,7 @@ public class CyclotronRecipeHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(String outputId, Object... results) { if ((outputId.equals("cyclotronProcessing")) && getClass() == CyclotronRecipeHandler.class) { - Map recipes = MachineRecipes.instance().getCyclotronRecipes(); + Map recipes = CyclotronRecipes.getRecipes(); for (Map.Entry recipe : recipes.entrySet()) { this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey()[0], (ItemStack)recipe.getKey()[1], (ItemStack)recipe.getValue())); } @@ -72,7 +72,7 @@ public class CyclotronRecipeHandler extends TemplateRecipeHandler { @Override public void loadCraftingRecipes(ItemStack result) { - Map recipes = MachineRecipes.instance().getCyclotronRecipes(); + Map recipes = CyclotronRecipes.getRecipes(); for (Map.Entry recipe : recipes.entrySet()) { if (NEIServerUtils.areStacksSameType((ItemStack)recipe.getValue(), result)) this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey()[0], (ItemStack)recipe.getKey()[1], (ItemStack)recipe.getValue())); @@ -90,7 +90,7 @@ public class CyclotronRecipeHandler extends TemplateRecipeHandler { @Override public void loadUsageRecipes(ItemStack ingredient) { - Map recipes = MachineRecipes.instance().getCyclotronRecipes(); + Map recipes = CyclotronRecipes.getRecipes(); for (Map.Entry recipe : recipes.entrySet()) { if (NEIServerUtils.areStacksSameType(ingredient, (ItemStack)recipe.getKey()[0]) || NEIServerUtils.areStacksSameType(ingredient, (ItemStack)recipe.getKey()[1])) this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey()[0], (ItemStack)recipe.getKey()[1], (ItemStack)recipe.getValue())); @@ -109,7 +109,7 @@ public class CyclotronRecipeHandler extends TemplateRecipeHandler { guiGui = new LinkedList>(); transferRects.add(new RecipeTransferRect(new Rectangle(83 - 3 + 16 - 52, 5 + 18 + 1, 24, 18), "cyclotronProcessing")); - transferRectsGui.add(new RecipeTransferRect(new Rectangle(61 - 4, 26 - 10, 36, 36), "cyclotronProcessing")); + transferRectsGui.add(new RecipeTransferRect(new Rectangle(47, 15, 36, 36), "cyclotronProcessing")); guiGui.add(GUIMachineCyclotron.class); RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects); RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui); diff --git a/src/main/java/com/hbm/inventory/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/AssemblerRecipes.java index c170a081e..821a1ece2 100644 --- a/src/main/java/com/hbm/inventory/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/AssemblerRecipes.java @@ -159,7 +159,6 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModItems.telepad, 1), new AStack[] {new ComparableStack(ModItems.ingot_polymer, 12), new ComparableStack(ModItems.plate_schrabidium, 2), new ComparableStack(ModItems.plate_combine_steel, 4), new OreDictStack("plateSteel", 2), new ComparableStack(ModItems.wire_gold, 6), new ComparableStack(ModItems.circuit_schrabidium, 1), },300); makeRecipe(new ComparableStack(ModItems.entanglement_kit, 1), new AStack[] {new ComparableStack(ModItems.coil_magnetized_tungsten, 6), new OreDictStack("plateLead", 16), new OreDictStack("plateDenseLead", 4), new ComparableStack(ModItems.singularity_counter_resonant, 1), new ComparableStack(ModItems.singularity_super_heated, 1), new ComparableStack(ModItems.powder_power, 4), },200); makeRecipe(new ComparableStack(ModItems.dysfunctional_reactor, 1), new AStack[] {new OreDictStack("plateSteel", 15), new OreDictStack("ingotLead", 5), new ComparableStack(ModItems.rod_quad_empty, 10), new OreDictStack("dyeBrown", 3), },200); - makeRecipe(new ComparableStack(ModItems.generator_front, 1), new AStack[] {new OreDictStack("ingotSteel", 3), new OreDictStack("plateSteel", 6), new ComparableStack(ModItems.tank_steel, 4), new ComparableStack(ModItems.turbine_titanium, 1), new ComparableStack(ModItems.wire_red_copper, 6), new ComparableStack(ModItems.wire_gold, 4), },200); makeRecipe(new ComparableStack(ModItems.missile_assembly, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 1), new ComparableStack(ModItems.hull_small_aluminium, 4), new OreDictStack("ingotSteel", 2), new OreDictStack("plateTitanium", 6), new ComparableStack(ModItems.wire_aluminium, 6), new ComparableStack(ModItems.canister_kerosene, 3), new ComparableStack(ModItems.circuit_targeting_tier1, 1), },200); makeRecipe(new ComparableStack(ModItems.missile_carrier, 1), new AStack[] {new ComparableStack(ModItems.fluid_barrel_full, 16, 21), new ComparableStack(ModItems.thruster_medium, 4), new ComparableStack(ModItems.thruster_large, 1), new ComparableStack(ModItems.hull_big_titanium, 6), new ComparableStack(ModItems.hull_big_steel, 2), new ComparableStack(ModItems.hull_small_aluminium, 12), new OreDictStack("plateTitanium", 24), new ComparableStack(ModItems.plate_polymer, 128), new ComparableStack(ModBlocks.det_cord, 8), new ComparableStack(ModItems.circuit_targeting_tier3, 12), new ComparableStack(ModItems.circuit_targeting_tier4, 3), },4800); makeRecipe(new ComparableStack(ModItems.warhead_generic_small, 1), new AStack[] {new OreDictStack("plateTitanium", 5), new OreDictStack("plateSteel", 3), new ComparableStack(Blocks.tnt, 2), },100); @@ -243,11 +242,11 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModItems.fuse, 1), new AStack[] {new OreDictStack("plateSteel", 2), new ComparableStack(Blocks.glass_pane, 1), new ComparableStack(ModItems.wire_aluminium, 1), },100); makeRecipe(new ComparableStack(ModItems.redcoil_capacitor, 1), new AStack[] {new OreDictStack("plateGold", 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), new ComparableStack(ModItems.coil_advanced_alloy, 6), new ComparableStack(Blocks.redstone_block, 2), },200); makeRecipe(new ComparableStack(ModItems.titanium_filter, 1), new AStack[] {new OreDictStack("plateLead", 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_tungsten, 4), new OreDictStack("plateTitanium", 6), new ComparableStack(ModItems.ingot_u238, 2), },200); - makeRecipe(new ComparableStack(ModItems.part_lithium, 1), new AStack[] {new OreDictStack("plateSteel", 2), new ComparableStack(ModItems.powder_lithium, 2), },50); - makeRecipe(new ComparableStack(ModItems.part_beryllium, 1), new AStack[] {new OreDictStack("plateSteel", 2), new ComparableStack(ModItems.powder_beryllium, 2), },50); - makeRecipe(new ComparableStack(ModItems.part_carbon, 1), new AStack[] {new OreDictStack("plateSteel", 2), new OreDictStack("dustCoal", 2), },50); - makeRecipe(new ComparableStack(ModItems.part_copper, 1), new AStack[] {new OreDictStack("plateSteel", 2), new OreDictStack("dustCopper", 2), },50); - makeRecipe(new ComparableStack(ModItems.part_plutonium, 1), new AStack[] {new OreDictStack("plateSteel", 2), new ComparableStack(ModItems.powder_plutonium, 2), },50); + makeRecipe(new ComparableStack(ModItems.part_lithium, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new ComparableStack(ModItems.powder_lithium, 1), },50); + makeRecipe(new ComparableStack(ModItems.part_beryllium, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new ComparableStack(ModItems.powder_beryllium, 1), },50); + makeRecipe(new ComparableStack(ModItems.part_carbon, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new OreDictStack("dustCoal", 1), },50); + makeRecipe(new ComparableStack(ModItems.part_copper, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new OreDictStack("dustCopper", 1), },50); + makeRecipe(new ComparableStack(ModItems.part_plutonium, 1), new AStack[] {new ComparableStack(ModItems.plate_polymer, 1), new ComparableStack(ModItems.powder_plutonium, 1), },50); makeRecipe(new ComparableStack(ModItems.thermo_element, 1), new AStack[] {new OreDictStack("plateSteel", 3), new OreDictStack("plateIron", 1), new OreDictStack("plateCopper", 2), new ComparableStack(ModItems.wire_red_copper, 2), new ComparableStack(ModItems.wire_aluminium, 2), new OreDictStack("dustNetherQuartz", 4), },150); makeRecipe(new ComparableStack(ModItems.limiter, 1), new AStack[] {new OreDictStack("plateSteel", 3), new OreDictStack("plateIron", 1), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.wire_copper, 4), },150); makeRecipe(new ComparableStack(ModItems.plate_dalekanium, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), },50); @@ -266,7 +265,6 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModBlocks.machine_diesel, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(Blocks.piston, 4), new OreDictStack("ingotSteel", 6), new OreDictStack("ingotRedCopperAlloy", 2), new OreDictStack("plateCopper", 4), new ComparableStack(ModItems.wire_red_copper, 6), },200); makeRecipe(new ComparableStack(ModBlocks.machine_selenium, 1), new AStack[] {new OreDictStack("ingotSteel", 4), new OreDictStack("plateTitanium", 6), new OreDictStack("plateCopper", 8), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.hull_small_steel, 9), new ComparableStack(ModItems.pedestal_steel, 1), new ComparableStack(ModItems.coil_copper, 4), },250); makeRecipe(new ComparableStack(ModBlocks.machine_reactor_small, 1), new AStack[] {new OreDictStack("ingotSteel", 6), new ComparableStack(ModItems.ingot_polymer, 4), new OreDictStack("plateLead", 8), new OreDictStack("plateCopper", 4), new OreDictStack("ingotLead", 12), new OreDictStack("ingotRedCopperAlloy", 6), new ComparableStack(ModItems.circuit_copper, 8), new ComparableStack(ModItems.circuit_red_copper, 4), },300); - makeRecipe(new ComparableStack(ModBlocks.machine_industrial_generator, 1), new AStack[] {new ComparableStack(ModItems.generator_front, 1), new ComparableStack(ModItems.generator_steel, 3), new ComparableStack(ModItems.rotor_steel, 3), new OreDictStack("ingotSteel", 6), new ComparableStack(ModItems.board_copper, 4), new ComparableStack(ModItems.wire_gold, 8), new ComparableStack(ModBlocks.red_wire_coated, 2), new ComparableStack(ModItems.pedestal_steel, 2), new ComparableStack(ModItems.circuit_copper, 4), },500); makeRecipe(new ComparableStack(ModBlocks.machine_cyclotron, 1), new AStack[] {new ComparableStack(ModItems.cyclotron_tower, 1), new ComparableStack(ModItems.board_copper, 4), new OreDictStack("ingotSteel", 16), new ComparableStack(ModItems.ingot_polymer, 24), new OreDictStack("plateSteel", 6), new ComparableStack(ModBlocks.machine_battery, 4), new ComparableStack(ModItems.wire_red_copper, 20), new ComparableStack(ModItems.circuit_red_copper, 12), new ComparableStack(ModItems.circuit_gold, 3), },600); makeRecipe(new ComparableStack(ModBlocks.machine_rtg_grey, 1), new AStack[] {new ComparableStack(ModItems.rtg_unit, 5), new OreDictStack("plateSteel", 8), new ComparableStack(ModItems.wire_red_copper, 4), new ComparableStack(ModItems.ingot_polymer, 6), },200); makeRecipe(new ComparableStack(ModBlocks.machine_battery, 1), new AStack[] {new OreDictStack("ingotSteel", 4), new OreDictStack("dustSulfur", 12), new OreDictStack("dustLead", 12), new OreDictStack("ingotRedCopperAlloy", 2), new ComparableStack(ModItems.wire_red_copper, 4), },200); @@ -301,8 +299,6 @@ public class AssemblerRecipes { makeRecipe(new ComparableStack(ModBlocks.fusion_center, 1), new AStack[] {new OreDictStack("ingotTungsten", 4), new OreDictStack("plateSteel", 6), new ComparableStack(ModItems.wire_advanced_alloy, 24), },200); makeRecipe(new ComparableStack(ModBlocks.fusion_motor, 1), new AStack[] {new OreDictStack("ingotTitanium", 4), new OreDictStack("ingotSteel", 2), new ComparableStack(ModItems.motor, 4), },250); makeRecipe(new ComparableStack(ModBlocks.fusion_heater, 1), new AStack[] {new OreDictStack("ingotTungsten", 4), new OreDictStack("plateSteel", 2), new OreDictStack("plateDenseLead", 2), new OreDictStack("plateCopper", 4), new ComparableStack(ModItems.magnetron, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), },150); - makeRecipe(new ComparableStack(ModBlocks.fusion_hatch, 1), new AStack[] {new ComparableStack(ModBlocks.fusion_heater, 1), new OreDictStack("plateTitanium", 6), },250); - makeRecipe(new ComparableStack(ModBlocks.fusion_core, 1), new AStack[] {new ComparableStack(ModBlocks.fusion_center, 3), new ComparableStack(ModItems.circuit_red_copper, 48), new ComparableStack(ModItems.circuit_gold, 12), },350); makeRecipe(new ComparableStack(ModBlocks.watz_element, 1), new AStack[] {new OreDictStack("ingotTungsten", 4), new ComparableStack(ModItems.plate_advanced_alloy, 4), new ComparableStack(ModItems.rod_empty, 2), new ComparableStack(ModItems.wire_magnetized_tungsten, 2), new ComparableStack(ModItems.wire_advanced_alloy, 4), },200); makeRecipe(new ComparableStack(ModBlocks.watz_control, 1), new AStack[] {new OreDictStack("ingotTungsten", 4), new ComparableStack(ModItems.ingot_advanced_alloy, 4), new OreDictStack("ingotLead", 2), new ComparableStack(ModItems.wire_magnetized_tungsten, 4), new ComparableStack(ModItems.wire_advanced_alloy, 2), },250); makeRecipe(new ComparableStack(ModBlocks.watz_cooler, 1), new AStack[] {new OreDictStack("ingotTungsten", 2), new OreDictStack("ingotSteel", 2), new OreDictStack("dustSaltpeter", 4), },300); diff --git a/src/main/java/com/hbm/inventory/CyclotronRecipes.java b/src/main/java/com/hbm/inventory/CyclotronRecipes.java index 08a84c52c..3cb1f6d56 100644 --- a/src/main/java/com/hbm/inventory/CyclotronRecipes.java +++ b/src/main/java/com/hbm/inventory/CyclotronRecipes.java @@ -1,13 +1,16 @@ package com.hbm.inventory; import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; -import com.hbm.inventory.RecipesCommon.AStack; import com.hbm.inventory.RecipesCommon.ComparableStack; -import com.hbm.inventory.RecipesCommon.OreDictStack; import com.hbm.items.ModItems; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; public class CyclotronRecipes { @@ -16,75 +19,102 @@ public class CyclotronRecipes { private static HashMap carbon = new HashMap(); private static HashMap copper = new HashMap(); private static HashMap plutonium = new HashMap(); + private static HashMap liAmat = new HashMap(); + private static HashMap beAmat = new HashMap(); + private static HashMap caAmat = new HashMap(); + private static HashMap coAmat = new HashMap(); + private static HashMap plAmat = new HashMap(); public static void register() { /// LITHIUM START /// - lithium.put("dustNetherQuartz", new ItemStack(ModItems.powder_fire)); - lithium.put("dustPhosphorus", new ItemStack(ModItems.sulfur)); - lithium.put("dustIron", new ItemStack(ModItems.powder_cobalt)); - lithium.put("dustGold", new ItemStack(ModItems.nugget_mercury)); - lithium.put("dustPolonium", new ItemStack(ModItems.powder_astatine)); - lithium.put("dustLanthanium", new ItemStack(ModItems.powder_cerium)); - lithium.put("dustActinium", new ItemStack(ModItems.powder_thorium)); - lithium.put("dustUranium", new ItemStack(ModItems.powder_neptunium)); - lithium.put("dustNeptunium", new ItemStack(ModItems.powder_plutonium)); + int liA = 50; + + makeRecipe(lithium, liAmat, "dustNetherQuartz", new ItemStack(ModItems.powder_fire), liA); + makeRecipe(lithium, liAmat, "dustPhosphorus", new ItemStack(ModItems.sulfur), liA); + makeRecipe(lithium, liAmat, "dustIron", new ItemStack(ModItems.powder_cobalt), liA); + makeRecipe(lithium, liAmat, "dustGold", new ItemStack(ModItems.nugget_mercury), liA); + makeRecipe(lithium, liAmat, "dustPolonium", new ItemStack(ModItems.powder_astatine), liA); + makeRecipe(lithium, liAmat, "dustLanthanium", new ItemStack(ModItems.powder_cerium), liA); + makeRecipe(lithium, liAmat, "dustActinium", new ItemStack(ModItems.powder_thorium), liA); + makeRecipe(lithium, liAmat, "dustUranium", new ItemStack(ModItems.powder_neptunium), liA); + makeRecipe(lithium, liAmat, "dustNeptunium", new ItemStack(ModItems.powder_plutonium), liA); /// LITHIUM END /// /// BERYLLIUM START /// - beryllium.put("dustNetherQuartz", new ItemStack(ModItems.sulfur)); - beryllium.put(new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_niobium)); - beryllium.put(new ComparableStack(ModItems.powder_cerium), new ItemStack(ModItems.powder_neodymium)); - beryllium.put("dustThorium", new ItemStack(ModItems.powder_uranium)); + int beA = 25; + + makeRecipe(beryllium, beAmat, "dustNetherQuartz", new ItemStack(ModItems.sulfur), beA); + makeRecipe(beryllium, beAmat, new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_niobium), beA); + makeRecipe(beryllium, beAmat, new ComparableStack(ModItems.powder_cerium), new ItemStack(ModItems.powder_neodymium), beA); + makeRecipe(beryllium, beAmat, "dustThorium", new ItemStack(ModItems.powder_uranium), beA); /// BERYLLIUM END /// /// CARBON START /// - carbon.put("dustSulfur", new ItemStack(ModItems.powder_titanium)); - carbon.put("dustTitanium", new ItemStack(ModItems.powder_iron)); - carbon.put(new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_lanthanium)); - carbon.put(new ComparableStack(ModItems.powder_neodymium), new ItemStack(ModItems.powder_gold)); - carbon.put(new ComparableStack(ModItems.nugget_mercury), new ItemStack(ModItems.powder_polonium)); - carbon.put(new ComparableStack(ModItems.powder_astatine), new ItemStack(ModItems.powder_actinium)); + int caA = 10; + + makeRecipe(carbon, caAmat, "dustSulfur", new ItemStack(ModItems.powder_titanium), caA); + makeRecipe(carbon, caAmat, "dustTitanium", new ItemStack(ModItems.powder_iron), caA); + makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_lanthanium), caA); + makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_neodymium), new ItemStack(ModItems.powder_gold), caA); + makeRecipe(carbon, caAmat, new ComparableStack(ModItems.nugget_mercury), new ItemStack(ModItems.powder_polonium), caA); + makeRecipe(carbon, caAmat, new ComparableStack(ModItems.powder_astatine), new ItemStack(ModItems.powder_actinium), caA); /// CARBON END /// /// COPPER START /// - copper.put("dustBeryllium", new ItemStack(ModItems.powder_quartz)); - copper.put("dustCoal", new ItemStack(ModItems.powder_bromine)); - copper.put("dustTitanium", new ItemStack(ModItems.powder_strontium)); - copper.put("dustIron", new ItemStack(ModItems.powder_niobium)); - copper.put(new ComparableStack(ModItems.powder_bromine), new ItemStack(ModItems.powder_iodine)); - copper.put(new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_neodymium)); - copper.put(new ComparableStack(ModItems.powder_niobium), new ItemStack(ModItems.powder_caesium)); - copper.put(new ComparableStack(ModItems.powder_iodine), new ItemStack(ModItems.powder_polonium)); - copper.put(new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_actinium)); - copper.put("dustGold", new ItemStack(ModItems.powder_uranium)); + int coA = 15; + + makeRecipe(copper, coAmat, "dustBeryllium", new ItemStack(ModItems.powder_quartz), coA); + makeRecipe(copper, coAmat, "dustCoal", new ItemStack(ModItems.powder_bromine), coA); + makeRecipe(copper, coAmat, "dustTitanium", new ItemStack(ModItems.powder_strontium), coA); + makeRecipe(copper, coAmat, "dustIron", new ItemStack(ModItems.powder_niobium), coA); + makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_bromine), new ItemStack(ModItems.powder_iodine), coA); + makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_strontium), new ItemStack(ModItems.powder_neodymium), coA); + makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_niobium), new ItemStack(ModItems.powder_caesium), coA); + makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_iodine), new ItemStack(ModItems.powder_polonium), coA); + makeRecipe(copper, coAmat, new ComparableStack(ModItems.powder_caesium), new ItemStack(ModItems.powder_actinium), coA); + makeRecipe(copper, coAmat, "dustGold", new ItemStack(ModItems.powder_uranium), coA); /// COPPER END /// /// PLUTONIUM START /// - plutonium.put("dustPhosphorus", new ItemStack(ModItems.powder_tennessine)); - plutonium.put("dustPlutonium", new ItemStack(ModItems.powder_tennessine)); + int plA = 100; + + makeRecipe(plutonium, plAmat, "dustPhosphorus", new ItemStack(ModItems.powder_tennessine), plA); + makeRecipe(plutonium, plAmat, "dustPlutonium", new ItemStack(ModItems.powder_tennessine), plA); + makeRecipe(plutonium, plAmat, new ComparableStack(ModItems.pellet_charged), new ItemStack(ModItems.nugget_schrabidium), 200); /// PLUTONIUM END /// ///TODO: fictional elements } - public static ItemStack getOutput(ItemStack stack, ItemStack box) { + private static void makeRecipe(HashMap map, HashMap aMap, Object in, ItemStack out, int amat) { + map.put(in, out); + aMap.put(in, amat); + } + + public static Object[] getOutput(ItemStack stack, ItemStack box) { if(stack == null || stack.getItem() == null || box == null) return null; - + HashMap pool = null; + HashMap aPool = null; if(box.getItem() == ModItems.part_lithium) { pool = lithium; + aPool = liAmat; } else if(box.getItem() == ModItems.part_beryllium) { pool = beryllium; + aPool = beAmat; } else if(box.getItem() == ModItems.part_carbon) { pool = carbon; + aPool = caAmat; } else if(box.getItem() == ModItems.part_copper) { pool = copper; + aPool = coAmat; } else if(box.getItem() == ModItems.part_plutonium) { pool = plutonium; + aPool = plAmat; } if(pool == null) @@ -93,16 +123,48 @@ public class CyclotronRecipes { ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage()); if(pool.containsKey(comp)) - return pool.get(comp).copy(); + return new Object[] {pool.get(comp).copy(), aPool.get(comp)}; String[] dictKeys = comp.getDictKeys(); for(String key : dictKeys) { if(pool.containsKey(key)) - return pool.get(key).copy(); + return new Object[] {pool.get(key).copy(), aPool.get(key)}; } return null; } + + public static Map getRecipes() { + + Map recipes = new HashMap(); + + addRecipes(recipes, lithium, ModItems.part_lithium); + addRecipes(recipes, beryllium, ModItems.part_beryllium); + addRecipes(recipes, carbon, ModItems.part_carbon); + addRecipes(recipes, copper, ModItems.part_copper); + addRecipes(recipes, plutonium, ModItems.part_plutonium); + + return recipes; + } + + private static void addRecipes(Map recipes, HashMap map, Item part) { + + for(Entry entry : map.entrySet()) { + + if(entry.getKey() instanceof ItemStack) { + + recipes.put(new ItemStack[] { new ItemStack(part), (ItemStack) entry.getKey() }, entry.getValue()); + + } else if(entry.getKey() instanceof String) { + + List ores = OreDictionary.getOres((String) entry.getKey()); + + for(ItemStack ore : ores) { + recipes.put(new ItemStack[] { new ItemStack(part), ore }, entry.getValue()); + } + } + } + } } diff --git a/src/main/java/com/hbm/inventory/container/ContainerMachineCyclotron.java b/src/main/java/com/hbm/inventory/container/ContainerMachineCyclotron.java index 29e7bfe93..e163f931b 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerMachineCyclotron.java +++ b/src/main/java/com/hbm/inventory/container/ContainerMachineCyclotron.java @@ -1,8 +1,14 @@ package com.hbm.inventory.container; +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.inventory.FluidContainerRegistry; import com.hbm.inventory.SlotMachineOutput; +import com.hbm.inventory.SlotUpgrade; +import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemMachineUpgrade; import com.hbm.tileentity.machine.TileEntityMachineCyclotron; +import api.hbm.energy.IBatteryItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -40,8 +46,8 @@ public class ContainerMachineCyclotron extends Container { //Battery this.addSlotToContainer(new Slot(tile, 13, 62, 108)); //Upgrades - this.addSlotToContainer(new Slot(tile, 14, 17, 90)); - this.addSlotToContainer(new Slot(tile, 15, 17, 108)); + this.addSlotToContainer(new SlotUpgrade(tile, 14, 17, 90)); + this.addSlotToContainer(new SlotUpgrade(tile, 15, 17, 108)); for(int i = 0; i < 3; i++) { @@ -58,41 +64,66 @@ public class ContainerMachineCyclotron extends Container { } @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) - { - /*ItemStack var3 = null; - Slot var4 = (Slot) this.inventorySlots.get(par2); + public ItemStack transferStackInSlot(EntityPlayer player, int index) { - if (var4 != null && var4.getHasStack()) - { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - if (par2 <= 15) { - if (!this.mergeItemStack(var5, 16, this.inventorySlots.size(), true)) - { + ItemStack var3 = null; + Slot slot = (Slot) this.inventorySlots.get(index); + + if(slot != null && slot.getHasStack()) { + ItemStack stack = slot.getStack(); + var3 = stack.copy(); + + if(index <= 15) { + if(!this.mergeItemStack(stack, 16, this.inventorySlots.size(), true)) { return null; } + + } else { + + if(stack.getItem() instanceof IBatteryItem || stack.getItem() == ModItems.battery_creative) { + if(!this.mergeItemStack(stack, 13, 14, true)) + return null; + + } else if(FluidContainerRegistry.getFluidContent(stack, FluidType.COOLANT) > 0) { + if(!this.mergeItemStack(stack, 11, 12, true)) + return null; + + } else if(FluidContainerRegistry.getFullContainer(stack, FluidType.AMAT) != null) { + if(!this.mergeItemStack(stack, 9, 10, true)) + return null; + + } else if(stack.getItem() instanceof ItemMachineUpgrade) { + if(!this.mergeItemStack(stack, 14, 15, true)) + if(!this.mergeItemStack(stack, 15, 16, true)) + return null; + + } else { + + if(stack.getItem() == ModItems.part_lithium || + stack.getItem() == ModItems.part_beryllium || + stack.getItem() == ModItems.part_carbon || + stack.getItem() == ModItems.part_copper || + stack.getItem() == ModItems.part_plutonium) { + + if(!this.mergeItemStack(stack, 0, 3, true)) + return null; + } else { + + if(!this.mergeItemStack(stack, 3, 6, true)) + return null; + } + } } - else if (!this.mergeItemStack(var5, 0, 16, false)) - { - return null; - } - - if (var5.stackSize == 0) - { - var4.putStack((ItemStack) null); - } - else - { - var4.onSlotChanged(); + + if(stack.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); } } - - return var3;*/ - - return null; - } + + return var3; + } @Override public boolean canInteractWith(EntityPlayer player) { diff --git a/src/main/java/com/hbm/inventory/gui/GUIIGenerator.java b/src/main/java/com/hbm/inventory/gui/GUIIGenerator.java index be3129e42..699485c9f 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIIGenerator.java +++ b/src/main/java/com/hbm/inventory/gui/GUIIGenerator.java @@ -87,14 +87,5 @@ public class GUIIGenerator extends GuiInfoContainer { } else { drawTexturedModalRect(guiLeft + 12, guiTop + 59 + 24, 230, 0, 6, 6); } - if(diFurnace.canLocateThermalElement() > 0) { - drawTexturedModalRect(guiLeft + 12, guiTop + 59 + 12, 230, 0, 6, 6); - } - if(diFurnace.lubricant > 0) { - drawTexturedModalRect(guiLeft + 12, guiTop + 59 + 36, 230, 0, 6, 6); - } - if(diFurnace.hasLimiter()) { - drawTexturedModalRect(guiLeft + 12, guiTop + 59 + 48, 230, 0, 6, 6); - } } } diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineCyclotron.java b/src/main/java/com/hbm/inventory/gui/GUIMachineCyclotron.java index 3b433a81e..e7d24f87b 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineCyclotron.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineCyclotron.java @@ -2,6 +2,7 @@ package com.hbm.inventory.gui; import org.lwjgl.opengl.GL11; +import com.hbm.inventory.FluidTank; import com.hbm.inventory.container.ContainerMachineCyclotron; import com.hbm.lib.RefStrings; import com.hbm.packet.AuxButtonPacket; @@ -31,7 +32,16 @@ public class GUIMachineCyclotron extends GuiInfoContainer { public void drawScreen(int mouseX, int mouseY, float f) { super.drawScreen(mouseX, mouseY, f); - this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 106 - 88, 16, 88, cyclotron.power, cyclotron.maxPower); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 72, 7, 52, cyclotron.power, cyclotron.maxPower); + + cyclotron.coolant.renderTankInfo(this, mouseX, mouseY, guiLeft + 53, guiTop + 72, 7, 52); + cyclotron.amat.renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 90, 7, 34); + + String[] text = new String[] { "Acceptable upgrades:", + " -Speed (stacks to level 3)", + " -Effectiveness (stacks to level 3)", + " -Power Saving (stacks to level 3)"}; + this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 21, guiTop + 75, 8, 8, mouseX, mouseY, text); } @Override @@ -67,5 +77,12 @@ public class GUIMachineCyclotron extends GuiInfoContainer { if(cyclotron.isOn) drawTexturedModalRect(guiLeft + 97, guiTop + 107, 219, 0, 18, 18); + + this.drawInfoPanel(guiLeft + 21, guiTop + 75, 8, 8, 8); + + Minecraft.getMinecraft().getTextureManager().bindTexture(cyclotron.coolant.getSheet()); + cyclotron.coolant.renderTank(this, guiLeft + 53, guiTop + 124, cyclotron.coolant.getTankType().textureX() * FluidTank.x, cyclotron.coolant.getTankType().textureY() * FluidTank.y, 7, 52); + Minecraft.getMinecraft().getTextureManager().bindTexture(cyclotron.amat.getSheet()); + cyclotron.amat.renderTank(this, guiLeft + 134, guiTop + 124, cyclotron.amat.getTankType().textureX() * FluidTank.x, cyclotron.amat.getTankType().textureY() * FluidTank.y, 7, 34); } } diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java b/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java index eb87dd6b7..2d4f06960 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineRadar.java @@ -7,7 +7,6 @@ import org.lwjgl.opengl.GL11; import com.hbm.config.WeaponConfig; import com.hbm.inventory.container.ContainerMachineRadar; import com.hbm.lib.RefStrings; -import com.hbm.main.MainRegistry; import com.hbm.tileentity.machine.TileEntityMachineRadar; import api.hbm.entity.IRadarDetectable.RadarTargetType; diff --git a/src/main/java/com/hbm/items/machine/ItemMachineUpgrade.java b/src/main/java/com/hbm/items/machine/ItemMachineUpgrade.java index 7bcf0fc52..ddc886e04 100644 --- a/src/main/java/com/hbm/items/machine/ItemMachineUpgrade.java +++ b/src/main/java/com/hbm/items/machine/ItemMachineUpgrade.java @@ -26,6 +26,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Crystallizer"); list.add("Delay -10% / Consumption +1000"); + list.add(""); + list.add("Cyclotron"); + list.add("Speed x2"); } if(this == ModItems.upgrade_speed_2) @@ -41,6 +44,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Crystallizer"); list.add("Delay -20% / Consumption +2000"); + list.add(""); + list.add("Cyclotron"); + list.add("Speed x3"); } if(this == ModItems.upgrade_speed_3) @@ -56,6 +62,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Crystallizer"); list.add("Speed Delay -30% / Consumption +3000"); + list.add(""); + list.add("Cyclotron"); + list.add("Speed x4"); } if(this == ModItems.upgrade_effect_1) @@ -65,6 +74,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Crystallizer"); list.add("+5% chance of not consuming an item / Acid consumption +1000mB"); + list.add(""); + list.add("Cyclotron"); + list.add("-50% chance of incrementing overheat counter"); } if(this == ModItems.upgrade_effect_2) @@ -74,6 +86,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Crystallizer"); list.add("+10% chance of not consuming an item / Acid consumption +2000mB"); + list.add(""); + list.add("Cyclotron"); + list.add("-66% chance of incrementing overheat counter"); } if(this == ModItems.upgrade_effect_3) @@ -83,6 +98,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Crystallizer"); list.add("+15% chance of not consuming an item / Acid consumption +3000mB"); + list.add(""); + list.add("Cyclotron"); + list.add("-75% chance of incrementing overheat counter"); } if(this == ModItems.upgrade_power_1) @@ -95,6 +113,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Chemical Plant:"); list.add("Consumption -30 / Delay +5"); + list.add(""); + list.add("Cyclotron"); + list.add("Consumption -100k"); } if(this == ModItems.upgrade_power_2) @@ -107,6 +128,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Chemical Plant:"); list.add("Consumption -60 / Delay +10"); + list.add(""); + list.add("Cyclotron"); + list.add("Consumption -200k"); } if(this == ModItems.upgrade_power_3) @@ -119,6 +143,9 @@ public class ItemMachineUpgrade extends Item { list.add(""); list.add("Chemical Plant:"); list.add("Consumption -90 / Delay +15"); + list.add(""); + list.add("Cyclotron"); + list.add("Consumption -300k"); } if(this == ModItems.upgrade_fortune_1) diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 0a1ff8182..c778d7616 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (3626)"; + public static final String VERSION = "1.0.27 BETA (3633)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 83e6ec28c..b7f31e257 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -1614,6 +1614,8 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.cladding_lead, 1), new Object[] { "DPD", "PRP", "DPD", 'R', ModItems.cladding_rubber, 'P', "plateLead", 'D', ModItems.ducttape })); GameRegistry.addRecipe(new ItemStack(ModItems.cladding_desh, 1), new Object[] { "DPD", "PRP", "DPD", 'R', ModItems.cladding_lead, 'P', ModItems.plate_desh, 'D', ModItems.ducttape }); GameRegistry.addRecipe(new ItemStack(ModBlocks.struct_plasma_core, 1), new Object[] { "CBC", "BHB", "CBC", 'C', ModItems.circuit_gold, 'B', ModBlocks.machine_lithium_battery, 'H', ModBlocks.fusion_heater }); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.circuit_red_copper, 48), new Object[] { ModBlocks.fusion_core }); + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.fusion_heater), new Object[] { ModBlocks.fusion_hatch }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgrade_nullifier, 1), new Object[] { "SPS", "PUP", "SPS", 'S', "plateSteel", 'P', ModItems.powder_fire, 'U', ModItems.upgrade_template })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgrade_smelter, 1), new Object[] { "PHP", "CUC", "DTD", 'P', "plateCopper", 'H', Blocks.hopper, 'C', ModItems.coil_tungsten, 'U', ModItems.upgrade_template, 'D', ModItems.coil_copper, 'T', ModBlocks.machine_transformer })); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 4fc43f1f9..bf22bffc6 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -528,44 +528,14 @@ public class ModEventHandler int i = player.ticksExisted * 3; Vec3 vec = Vec3.createVectorHelper(3, 0, 0); + vec.rotateAroundY((float) (i * Math.PI / 180D)); - NBTTagCompound p1 = new NBTTagCompound(); - p1.setString("type", "vanillaExt"); - p1.setString("mode", "reddust"); - p1.setDouble("posX", player.posX + vec.xCoord); - p1.setDouble("posY", player.posY + 1.5); - p1.setDouble("posZ", player.posZ + vec.zCoord); - p1.setDouble("mX", 51F/256F); - p1.setDouble("mY", 64F/256F); - p1.setDouble("mZ", 119F/256F); - MainRegistry.proxy.effectNT(p1); - - vec.rotateAroundY((float) (Math.PI * 2D / 3D)); - - NBTTagCompound p2 = new NBTTagCompound(); - p2.setString("type", "vanillaExt"); - p2.setString("mode", "reddust"); - p2.setDouble("posX", player.posX + vec.xCoord); - p2.setDouble("posY", player.posY + 1.5); - p2.setDouble("posZ", player.posZ + vec.zCoord); - p2.setDouble("mX", 106F/256F); - p2.setDouble("mY", 41F/256F); - p2.setDouble("mZ", 143F/256F); - MainRegistry.proxy.effectNT(p2); - - vec.rotateAroundY((float) (Math.PI * 2D / 3D)); - - NBTTagCompound p3 = new NBTTagCompound(); - p3.setString("type", "vanillaExt"); - p3.setString("mode", "reddust"); - p3.setDouble("posX", player.posX + vec.xCoord); - p3.setDouble("posY", player.posY + 1.5); - p3.setDouble("posZ", player.posZ + vec.zCoord); - p3.setDouble("mX", 223F/256F); - p3.setDouble("mY", 55F/256F); - p3.setDouble("mZ", 149F/256F); - MainRegistry.proxy.effectNT(p3); + for(int k = 0; k < 5; k++) { + + vec.rotateAroundY((float) (1F * Math.PI / 180D)); + player.worldObj.spawnParticle("townaura", player.posX + vec.xCoord, player.posY + 1 + player.worldObj.rand.nextDouble() * 0.05, player.posZ + vec.zCoord, 0.0, 0.0, 0.0); + } } } } diff --git a/src/main/java/com/hbm/render/tileentity/RenderSmallReactor.java b/src/main/java/com/hbm/render/tileentity/RenderSmallReactor.java index 1e1e03ee8..5a403ecbb 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderSmallReactor.java +++ b/src/main/java/com/hbm/render/tileentity/RenderSmallReactor.java @@ -4,6 +4,8 @@ import org.lwjgl.opengl.GL11; import com.hbm.main.ResourceManager; import com.hbm.tileentity.machine.TileEntityMachineReactorSmall; + +import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; @@ -22,12 +24,73 @@ public class RenderSmallReactor extends TileEntitySpecialRenderer { bindTexture(ResourceManager.reactor_small_base_tex); ResourceManager.reactor_small_base.renderAll(); - + + GL11.glPushMatrix(); GL11.glTranslated(0.0D, reactor.rods / 100D, 0.0D); bindTexture(ResourceManager.reactor_small_rods_tex); ResourceManager.reactor_small_rods.renderAll(); GL11.glPopMatrix(); + + if(reactor.coreHeat > 0 && reactor.isSubmerged()) { + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_ALPHA_TEST); + + Tessellator tess = Tessellator.instance; + + for(double d = 0.285; d < 0.7; d += 0.025) { + + tess.startDrawingQuads(); + tess.setColorRGBA_F(0.4F, 0.9F, 1.0F, 0.15F); + + double top = 1.375; + double bottom = 1.375; + + tess.addVertex(d, bottom - d, -d); + tess.addVertex(d, top + d, -d); + tess.addVertex(d, top + d, d); + tess.addVertex(d, bottom - d, d); + + tess.addVertex(-d, bottom - d, -d); + tess.addVertex(-d, top + d, -d); + tess.addVertex(-d, top + d, d); + tess.addVertex(-d, bottom - d, d); + + tess.addVertex(-d, bottom - d, d); + tess.addVertex(-d, top + d, d); + tess.addVertex(d, top + d, d); + tess.addVertex(d, bottom - d, d); + + tess.addVertex(-d, bottom - d, -d); + tess.addVertex(-d, top + d, -d); + tess.addVertex(d, top + d, -d); + tess.addVertex(d, bottom - d, -d); + + tess.addVertex(-d, top + d, -d); + tess.addVertex(-d, top + d, d); + tess.addVertex(d, top + d, d); + tess.addVertex(d, top + d, -d); + + tess.addVertex(-d, bottom - d, -d); + tess.addVertex(-d, bottom - d, d); + tess.addVertex(d, bottom - d, d); + tess.addVertex(d, bottom - d, -d); + + tess.draw(); + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + + GL11.glPopMatrix(); } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityBarrel.java b/src/main/java/com/hbm/tileentity/machine/TileEntityBarrel.java index 75a8cebe5..1a5d0a37c 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityBarrel.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityBarrel.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import com.hbm.blocks.ModBlocks; -import com.hbm.blocks.machine.BlockFluidBarrel; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidSource; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java index a47d33c89..7a262d440 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCMBFactory.java @@ -236,7 +236,7 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv boolean b = false; - if(tank.getFill() >= 10 && power >= 100000 && slots[1] != null && slots[3] != null && (slots[4] == null || slots[4].stackSize <= 60)) + if(tank.getFill() >= 1 && power >= 100000 && slots[1] != null && slots[3] != null && (slots[4] == null || slots[4].stackSize <= 60)) { boolean flag0 = slots[1].getItem() == ModItems.ingot_magnetized_tungsten || slots[1].getItem() == ModItems.powder_magnetized_tungsten; boolean flag1 = slots[3].getItem() == ModItems.ingot_advanced_alloy || slots[3].getItem() == ModItems.powder_advanced_alloy; @@ -252,7 +252,7 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv } public void process() { - tank.setFill(tank.getFill() - 10); + tank.setFill(tank.getFill() - 1); power -= 100000; process++; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java index 0c8c02303..9851c77d8 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCyclotron.java @@ -4,17 +4,29 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import com.hbm.config.BombConfig; +import com.hbm.entity.effect.EntityBlackHole; +import com.hbm.entity.logic.EntityBalefire; +import com.hbm.entity.logic.EntityNukeExplosionMK4; +import com.hbm.explosion.ExplosionLarge; +import com.hbm.explosion.ExplosionParticle; +import com.hbm.explosion.ExplosionParticleB; +import com.hbm.explosion.ExplosionThermo; import com.hbm.handler.FluidTypeHandler.FluidType; import com.hbm.interfaces.IFluidAcceptor; import com.hbm.interfaces.IFluidSource; import com.hbm.inventory.CyclotronRecipes; import com.hbm.inventory.FluidTank; import com.hbm.items.ModItems; +import com.hbm.items.machine.ItemMachineUpgrade; import com.hbm.lib.Library; import com.hbm.tileentity.TileEntityMachineBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; public class TileEntityMachineCyclotron extends TileEntityMachineBase implements IFluidSource, IFluidAcceptor { @@ -25,6 +37,7 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements public boolean isOn; private int age; + private int countdown; public int progress; public static final int duration = 690; @@ -66,10 +79,12 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements if(isOn) { - if(canProcess()) { + int defConsumption = consumption - 100000 * getConsumption(); + + if(canProcess() && power >= defConsumption) { - progress++; - power -= consumption; + progress += this.getSpeed(); + power -= defConsumption; if(progress >= duration) { process(); @@ -78,12 +93,37 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements } if(coolant.getFill() > 0) { + + countdown = 0; if(worldObj.rand.nextInt(3) == 0) coolant.setFill(coolant.getFill() - 1); - } else { - worldObj.newExplosion(null, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, 25, true, true); + } else if(worldObj.rand.nextInt(this.getSafety()) == 0) { + + countdown++; + + int chance = 7 - Math.min((int) Math.ceil(countdown / 200D), 6); + + if(worldObj.rand.nextInt(chance) == 0) + ExplosionLarge.spawnTracers(worldObj, xCoord + 0.5, yCoord + 3.25, zCoord + 0.5, 1); + + if(countdown > 1000) { + ExplosionThermo.setEntitiesOnFire(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, 25); + ExplosionThermo.scorchLight(worldObj, xCoord, yCoord, zCoord, 7); + + if(countdown % 4 == 0) + ExplosionLarge.spawnBurst(worldObj, xCoord + 0.5, yCoord + 3.25, zCoord + 0.5, 18, 1); + + } else if(countdown > 600) { + ExplosionThermo.setEntitiesOnFire(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, 10); + } + + if(countdown == 1140) + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, "hbm:block.shutdown", 10.0F, 1.0F); + + if(countdown > 1200) + explode(); } } else { @@ -101,8 +141,8 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements data.setBoolean("isOn", isOn); this.networkPack(data, 25); - this.coolant.updateTank(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId); - this.amat.updateTank(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId); + coolant.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); + amat.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); } } @@ -113,25 +153,46 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements } public void handleButtonPacket(int value, int meta) { + + this.isOn = !this.isOn; + } + + private void explode() { - System.out.println("Before: " + isOn); + ExplosionLarge.explodeFire(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, 25, true, false, true); - if(this.isOn) - this.isOn = false; - else - this.isOn = true; - - System.out.println("After: " + isOn); + int rand = worldObj.rand.nextInt(10); + + if(rand < 2) { + worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(worldObj, (int)(BombConfig.fatmanRadius * 1.5), xCoord + 0.5, yCoord + 1.5, zCoord + 0.5)); + ExplosionParticle.spawnMush(worldObj, xCoord + 0.5, yCoord - 3, zCoord + 0.5); + } else if(rand < 4) { + EntityBalefire bf = new EntityBalefire(worldObj); + bf.posX = xCoord + 0.5; + bf.posY = yCoord + 1.5; + bf.posZ = zCoord + 0.5; + bf.destructionRange = (int)(BombConfig.fatmanRadius * 1.5); + worldObj.spawnEntityInWorld(bf); + ExplosionParticleB.spawnMush(worldObj, xCoord + 0.5, yCoord - 3, zCoord + 0.5); + } else if(rand < 5) { + EntityBlackHole bl = new EntityBlackHole(worldObj, 1.5F + worldObj.rand.nextFloat()); + bl.posX = xCoord + 0.5F; + bl.posY = yCoord + 1.5F; + bl.posZ = zCoord + 0.5F; + worldObj.spawnEntityInWorld(bl); + } } public boolean canProcess() { - if(power < consumption) - return false; - for(int i = 0; i < 3; i++) { - ItemStack out = CyclotronRecipes.getOutput(slots[i + 3], slots[i]); + Object[] res = CyclotronRecipes.getOutput(slots[i + 3], slots[i]); + + if(res == null) + continue; + + ItemStack out = (ItemStack)res[0]; if(out == null) continue; @@ -148,57 +209,101 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements public void process() { - int amat = 0; - for(int i = 0; i < 3; i++) { - ItemStack out = CyclotronRecipes.getOutput(slots[i + 3], slots[i]); + Object[] res = CyclotronRecipes.getOutput(slots[i + 3], slots[i]); + + if(res == null) + continue; + + ItemStack out = (ItemStack)res[0]; if(out == null) continue; if(slots[i + 6] == null) { - amat += this.getAmat(slots[i]); this.decrStackSize(i, 1); this.decrStackSize(i + 3, 1); slots[i + 6] = out; + + this.amat.setFill(this.amat.getFill() + (Integer)res[1]); + continue; } if(slots[i + 6].getItem() == out.getItem() && slots[i + 6].getItemDamage() == out.getItemDamage() && slots[i + 6].stackSize < out.getMaxStackSize()) { - amat += this.getAmat(slots[i]); this.decrStackSize(i, 1); this.decrStackSize(i + 3, 1); slots[i + 6].stackSize++; + + this.amat.setFill(this.amat.getFill() + (Integer)res[1]); } } - this.amat.setFill(this.amat.getFill() + amat); if(this.amat.getFill() > this.amat.getMaxFill()) this.amat.setFill(this.amat.getMaxFill()); } - public int getAmat(ItemStack stack) { + public int getSpeed() { - //TODO: move to cyclotron recipe handler and register it on a per-recipe basis + int speed = 1; - if(stack == null) - return 0; + for(int i = 14; i < 16; i++) { + + if(slots[i] != null) { + + if(slots[i].getItem() == ModItems.upgrade_speed_1) + speed += 1; + else if(slots[i].getItem() == ModItems.upgrade_speed_2) + speed += 2; + else if(slots[i].getItem() == ModItems.upgrade_speed_3) + speed += 3; + } + } - if(stack.getItem() == ModItems.part_lithium) - return 50; - if(stack.getItem() == ModItems.part_beryllium) - return 25; - if(stack.getItem() == ModItems.part_carbon) - return 10; - if(stack.getItem() == ModItems.part_copper) - return 15; - if(stack.getItem() == ModItems.part_plutonium) - return 100; + return Math.min(speed, 4); + } + + public int getConsumption() { - return 0; + int speed = 0; + + for(int i = 14; i < 16; i++) { + + if(slots[i] != null) { + + if(slots[i].getItem() == ModItems.upgrade_power_1) + speed += 1; + else if(slots[i].getItem() == ModItems.upgrade_power_2) + speed += 2; + else if(slots[i].getItem() == ModItems.upgrade_power_3) + speed += 3; + } + } + + return Math.min(speed, 3); + } + + public int getSafety() { + + int speed = 1; + + for(int i = 14; i < 16; i++) { + + if(slots[i] != null) { + + if(slots[i].getItem() == ModItems.upgrade_effect_1) + speed += 1; + else if(slots[i].getItem() == ModItems.upgrade_effect_2) + speed += 2; + else if(slots[i].getItem() == ModItems.upgrade_effect_3) + speed += 3; + } + } + + return Math.min(speed, 4); } public long getPowerScaled(long i) { @@ -211,6 +316,7 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements @Override public void setFillstate(int fill, int index) { + if(index == 0) coolant.setFill(fill); else if(index == 1) @@ -230,7 +336,7 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements if(index == 0) coolant.setTankType(type); else if(index == 1) - coolant.setTankType(type); + amat.setTankType(type); } @Override @@ -290,4 +396,49 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements return 0; } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord, zCoord - 2, xCoord + 3, yCoord + 4, zCoord + 3); + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() { + return 65536.0D; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + + coolant.readFromNBT(nbt, "coolant"); + amat.readFromNBT(nbt, "amat"); + + this.isOn = nbt.getBoolean("isOn"); + this.countdown = nbt.getInteger("countdown"); + this.progress = nbt.getInteger("progress"); + this.power = nbt.getLong("power"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + + coolant.writeToNBT(nbt, "coolant"); + amat.writeToNBT(nbt, "amat"); + + nbt.setBoolean("isOn", isOn); + nbt.setInteger("countdown", countdown); + nbt.setInteger("progress", progress); + nbt.setLong("power", power); + } + + @Override + public void setInventorySlotContents(int i, ItemStack stack) { + super.setInventorySlotContents(i, stack); + + if(stack != null && i >= 14 && i <= 15 && stack.getItem() instanceof ItemMachineUpgrade) + worldObj.playSoundEffect(xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, "hbm:item.upgradePlug", 1.5F, 1.0F); + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java index eda12fc4d..6c2cb64df 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java @@ -211,356 +211,7 @@ public class TileEntityMachineIGenerator extends TileEntity implements ISidedInv } @Override - public void updateEntity() { - - if (!worldObj.isRemote) { - - age++; - if(age >= 20) - { - age = 0; - } - - if(age == 9 || age == 19) - ffgeuaInit(); - - rotation += (this.torque / 100F); - - if(burn > 0) { - burn--; - - if(heat + 10 <= maxHeat) - heat += 10; - } - - if(water > 0) { - - if(heat >= 8) { - - heat -= 8; - torque += 10; - water--; - } - } else { - - if(heat >= 4) { - - heat -= 4; - torque += 5; - } - } - - heat += (5 * this.canLocateRTG()); - - heat += (3 * this.canLocateWeakRTG()); - - for(int i = 0; i < this.canLocateThermalElement(); i++) { - if(heat >= 10) { - heat -= 10; - - if(power + 10 <= maxPower) { - power += 10; - } - } - } - - this.power += this.torque; - - if(power > maxPower) - power = maxPower; - - if(torque > 0) { - if(lubricant > 0 ) { - torque--; - lubricant--; - } else { - torque -= 5; - } - } - - if(torque < 0) - torque = 0; - - if(torque > maxTorque && this.hasLimiter()) - torque = maxTorque; - - if(torque > maxTorque) { - worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, Blocks.air); - } - - if(this.getHeatScaled(100) < 90) { - - if(fuel > 0) { - fuel --; - if(heat + 10 <= maxHeat) - heat += 10; - } - - doSolidFuelTask(); - } - doFuelTask(); - doLubeTask(); - doWaterTask(); - doBatteryTask(); - } - - if(!worldObj.isRemote) { - PacketDispatcher.wrapper.sendToAllAround(new TEIGeneratorPacket(xCoord, yCoord, zCoord, rotation, torque), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150)); - PacketDispatcher.wrapper.sendToAllAround(new LoopedSoundPacket(xCoord, yCoord, zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - } - } - - public void doFuelTask() { - - if (slots[13] != null && slots[13].getItem() == ModItems.canister_fuel && fuel + 625 <= maxFuel) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - fuel += 625; - } - } - if (slots[13] != null && slots[13].getItem() == ModItems.canister_smear && fuel + 200 <= maxFuel) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - fuel += 200; - } - } - if (slots[13] != null && slots[13].getItem() == ModItems.canister_reoil && fuel + 350 <= maxFuel) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - fuel += 350; - } - } - if (slots[13] != null && slots[13].getItem() == ModItems.canister_petroil && fuel + 500 <= maxFuel) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - fuel += 500; - } - } - if (slots[13] != null && slots[13].getItem() == Item.getItemFromBlock(ModBlocks.red_barrel) && fuel + 5000 <= maxFuel) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == ModItems.tank_steel - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(ModItems.tank_steel); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - fuel += 5000; - } - } - - if (slots[13] != null && slots[13].getItem() == ModItems.fluid_barrel_infinite) { - this.fuel = TileEntityMachineIGenerator.maxFuel; - this.lubricant = TileEntityMachineIGenerator.maxLubricant; - this.water = TileEntityMachineIGenerator.maxWater; - } - } - - public void doLubeTask() { - - if (slots[13] != null && slots[13].getItem() == ModItems.canister_canola && lubricant + 625 <= maxLubricant) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - lubricant += 625; - } - } - } - - public void doWaterTask() { - - if (slots[13] != null && slots[13].getItem() == Items.water_bucket && water + 625 <= maxWater) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - water += 625; - } - } - if (slots[13] != null && slots[13].getItem() == ModItems.rod_water && water + 625 <= maxWater) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - water += 625; - } - } - if (slots[13] != null && slots[13].getItem() == ModItems.rod_dual_water && water + 1250 <= maxWater) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - water += 1250; - } - } - if (slots[13] != null && slots[13].getItem() == ModItems.rod_quad_water && water + 2500 <= maxWater) { - if (slots[14] == null || slots[14] != null && slots[14].getItem() == slots[13].getItem().getContainerItem() - && slots[14].stackSize < slots[14].getMaxStackSize()) { - if (slots[14] == null) - slots[14] = new ItemStack(slots[13].getItem().getContainerItem()); - else - slots[14].stackSize++; - - slots[13].stackSize--; - if (slots[13].stackSize <= 0) - slots[13] = null; - - water += 2500; - } - } - - if (slots[13] != null && slots[13].getItem() == ModItems.inf_water) - this.water = TileEntityMachineIGenerator.maxWater; - } - - public void doSolidFuelTask() { - if(slots[12] != null && slots[12].getItem() == Items.coal && burn <= 0) - { - slots[12].stackSize -= 1; - burn = 200; - if(slots[12].stackSize == 0) - { - slots[12] = null; - } - } - if(slots[12] != null && slots[12].getItem() == ModItems.powder_coal && burn <= 0) - { - slots[12].stackSize -= 1; - burn = 200; - if(slots[12].stackSize == 0) - { - slots[12] = null; - } - } - if(slots[12] != null && slots[12].getItem() == Item.getItemFromBlock(Blocks.coal_block) && burn <= 0) - { - slots[12].stackSize -= 1; - burn = 2000; - if(slots[12].stackSize == 0) - { - slots[12] = null; - } - } - } - - public void doBatteryTask() { - power = Library.chargeItemsFromTE(slots, 15, power, maxPower); - } - - public int canLocateThermalElement() { - - int thermo = 0; - - for(int i = 0; i < slots.length; i++) { - if(slots[i] != null && slots[i].getItem() == ModItems.thermo_element) - thermo ++; - } - - return thermo; - } - - public int canLocateRTG() { - - int rtg = 0; - - for(int i = 0; i < slots.length; i++) { - if(slots[i] != null && slots[i].getItem() == ModItems.pellet_rtg) - rtg ++; - } - - return rtg; - } - - public int canLocateWeakRTG() { - - int rtg = 0; - - for(int i = 0; i < slots.length; i++) { - if(slots[i] != null && slots[i].getItem() == ModItems.pellet_rtg_weak) - rtg ++; - } - - return rtg; - } - - public boolean hasLimiter() { - - for(int i = 0; i < slots.length; i++) { - if(slots[i] != null && slots[i].getItem() == ModItems.limiter) - return true; - } - - return false; - } + public void updateEntity() { } public int getFuelScaled(int i) { return (fuel * i) / maxFuel; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java index 5fc8c1d7b..ca9b33e84 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactorSmall.java @@ -22,6 +22,7 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -33,8 +34,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; -public class TileEntityMachineReactorSmall extends TileEntity - implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource { +public class TileEntityMachineReactorSmall extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource { private ItemStack slots[]; @@ -75,7 +75,7 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public ItemStack getStackInSlotOnClosing(int i) { - if (slots[i] != null) { + if(slots[i] != null) { ItemStack itemStack = slots[i]; slots[i] = null; return itemStack; @@ -87,7 +87,7 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public void setInventorySlotContents(int i, ItemStack itemStack) { slots[i] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { + if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { itemStack.stackSize = getInventoryStackLimit(); } } @@ -113,7 +113,7 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public boolean isUseableByPlayer(EntityPlayer player) { - if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) { + if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) { return false; } else { return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64; @@ -131,31 +131,28 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public boolean isItemValidForSlot(int i, ItemStack itemStack) { - if (i == 0 || i == 1 || i == 2 || i == 3 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 9 || i == 10 - || i == 11) - if (itemStack.getItem() instanceof ItemFuelRod) + if(i == 0 || i == 1 || i == 2 || i == 3 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 9 || i == 10 || i == 11) + if(itemStack.getItem() instanceof ItemFuelRod) return true; - if (i == 12) - if (itemStack.getItem() == ModItems.rod_water || itemStack.getItem() == ModItems.rod_dual_water - || itemStack.getItem() == ModItems.rod_quad_water || itemStack.getItem() == Items.water_bucket) + if(i == 12) + if(itemStack.getItem() == ModItems.rod_water || itemStack.getItem() == ModItems.rod_dual_water || itemStack.getItem() == ModItems.rod_quad_water || itemStack.getItem() == Items.water_bucket) return true; - if (i == 14) - if (itemStack.getItem() == ModItems.rod_coolant || itemStack.getItem() == ModItems.rod_dual_coolant - || itemStack.getItem() == ModItems.rod_quad_coolant) + if(i == 14) + if(itemStack.getItem() == ModItems.rod_coolant || itemStack.getItem() == ModItems.rod_dual_coolant || itemStack.getItem() == ModItems.rod_quad_coolant) return true; return false; } @Override public ItemStack decrStackSize(int i, int j) { - if (slots[i] != null) { - if (slots[i].stackSize <= j) { + if(slots[i] != null) { + if(slots[i].stackSize <= j) { ItemStack itemStack = slots[i]; slots[i] = null; return itemStack; } ItemStack itemStack1 = slots[i].splitStack(j); - if (slots[i].stackSize == 0) { + if(slots[i].stackSize == 0) { slots[i] = null; } @@ -179,10 +176,10 @@ public class TileEntityMachineReactorSmall extends TileEntity tanks[1].readFromNBT(nbt, "coolant"); tanks[2].readFromNBT(nbt, "steam"); - for (int i = 0; i < list.tagCount(); i++) { + for(int i = 0; i < list.tagCount(); i++) { NBTTagCompound nbt1 = list.getCompoundTagAt(i); byte b0 = nbt1.getByte("slot"); - if (b0 >= 0 && b0 < slots.length) { + if(b0 >= 0 && b0 < slots.length) { slots[b0] = ItemStack.loadItemStackFromNBT(nbt1); } } @@ -200,8 +197,8 @@ public class TileEntityMachineReactorSmall extends TileEntity tanks[1].writeToNBT(nbt, "coolant"); tanks[2].writeToNBT(nbt, "steam"); - for (int i = 0; i < slots.length; i++) { - if (slots[i] != null) { + for(int i = 0; i < slots.length; i++) { + if(slots[i] != null) { NBTTagCompound nbt1 = new NBTTagCompound(); nbt1.setByte("slot", (byte) i); slots[i].writeToNBT(nbt1); @@ -223,30 +220,15 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public boolean canExtractItem(int i, ItemStack itemStack, int j) { - if (i == 0 || i == 1 || i == 2 || i == 3 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 9 || i == 10 - || i == 11) - if (itemStack.getItem() == ModItems.rod_uranium_fuel_depleted - || itemStack.getItem() == ModItems.rod_dual_uranium_fuel_depleted - || itemStack.getItem() == ModItems.rod_quad_uranium_fuel_depleted - || itemStack.getItem() == ModItems.rod_plutonium_fuel_depleted - || itemStack.getItem() == ModItems.rod_dual_plutonium_fuel_depleted - || itemStack.getItem() == ModItems.rod_quad_plutonium_fuel_depleted - || itemStack.getItem() == ModItems.rod_mox_fuel_depleted - || itemStack.getItem() == ModItems.rod_dual_mox_fuel_depleted - || itemStack.getItem() == ModItems.rod_quad_mox_fuel_depleted - || itemStack.getItem() == ModItems.rod_schrabidium_fuel_depleted - || itemStack.getItem() == ModItems.rod_dual_schrabidium_fuel_depleted - || itemStack.getItem() == ModItems.rod_quad_schrabidium_fuel_depleted) + if(i == 0 || i == 1 || i == 2 || i == 3 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 9 || i == 10 || i == 11) + if(itemStack.getItem() == ModItems.rod_uranium_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_uranium_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_uranium_fuel_depleted || itemStack.getItem() == ModItems.rod_plutonium_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_plutonium_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_plutonium_fuel_depleted || itemStack.getItem() == ModItems.rod_mox_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_mox_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_mox_fuel_depleted || itemStack.getItem() == ModItems.rod_schrabidium_fuel_depleted || itemStack.getItem() == ModItems.rod_dual_schrabidium_fuel_depleted || itemStack.getItem() == ModItems.rod_quad_schrabidium_fuel_depleted) return true; - if (i == 13 || i == 15) - if (itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty - || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty - || itemStack.getItem() == ModItems.fluid_tank_empty - || itemStack.getItem() == ModItems.fluid_barrel_empty) + if(i == 13 || i == 15) + if(itemStack.getItem() == Items.bucket || itemStack.getItem() == ModItems.rod_empty || itemStack.getItem() == ModItems.rod_dual_empty || itemStack.getItem() == ModItems.rod_quad_empty || itemStack.getItem() == ModItems.fluid_tank_empty || itemStack.getItem() == ModItems.fluid_barrel_empty) return true; return false; - + } public int getCoreHeatScaled(int i) { @@ -271,7 +253,7 @@ public class TileEntityMachineReactorSmall extends TileEntity private int[] getNeighbouringSlots(int id) { - switch (id) { + switch(id) { case 0: return new int[] { 1, 5 }; case 1: @@ -300,73 +282,69 @@ public class TileEntityMachineReactorSmall extends TileEntity return null; } - + public int getFuelPercent() { - + if(getRodCount() == 0) return 0; - + int rodMax = 0; int rod = 0; - + for(int i = 0; i < 12; i++) { - + if(slots[i] != null && slots[i].getItem() instanceof ItemFuelRod) { - rodMax += ((ItemFuelRod)slots[i].getItem()).lifeTime; - rod += ((ItemFuelRod)slots[i].getItem()).lifeTime - ItemFuelRod.getLifeTime(slots[i]); + rodMax += ((ItemFuelRod) slots[i].getItem()).lifeTime; + rod += ((ItemFuelRod) slots[i].getItem()).lifeTime - ItemFuelRod.getLifeTime(slots[i]); } } - + if(rodMax == 0) return 0; - + return rod * 100 / rodMax; } @Override public void updateEntity() { - if (!worldObj.isRemote) { + if(!worldObj.isRemote) { age++; - if (age >= 20) { + if(age >= 20) { age = 0; } - if (age == 9 || age == 19) + if(age == 9 || age == 19) fillFluidInit(tanks[2].getTankType()); tanks[0].loadTank(12, 13, slots); tanks[1].loadTank(14, 15, slots); - if (retracting && rods > 0) { + if(retracting && rods > 0) { - if (rods == rodsMax) - this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStart", 1.0F, - 0.75F); + if(rods == rodsMax) + this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStart", 1.0F, 0.75F); rods--; - if (rods == 0) - this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStop", 1.0F, - 1.0F); + if(rods == 0) + this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStop", 1.0F, 1.0F); } - if (!retracting && rods < rodsMax) { + if(!retracting && rods < rodsMax) { - if (rods == 0) - this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStart", 1.0F, - 0.75F); + if(rods == 0) + this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStart", 1.0F, 0.75F); rods++; - if (rods == rodsMax) - this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStop", 1.0F, - 1.0F); + if(rods == rodsMax) + this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStop", 1.0F, 1.0F); } - if (rods >= rodsMax) - for (int i = 0; i < 12; i++) { - if (slots[i] != null && slots[i].getItem() instanceof ItemFuelRod) + if(rods >= rodsMax) + for(int i = 0; i < 12; i++) { + if(slots[i] != null && slots[i].getItem() instanceof ItemFuelRod) decay(i); } @@ -374,53 +352,52 @@ public class TileEntityMachineReactorSmall extends TileEntity hullHeatMod = 1.0; conversionMod = 1.0; decayMod = 1.0; - + getInteractions(); - if (this.coreHeat > 0 && this.tanks[1].getFill() > 0 && this.hullHeat < this.maxHullHeat) { + if(this.coreHeat > 0 && this.tanks[1].getFill() > 0 && this.hullHeat < this.maxHullHeat) { this.hullHeat += this.coreHeat * 0.175 * hullHeatMod; this.coreHeat -= this.coreHeat * 0.1; this.tanks[1].setFill(this.tanks[1].getFill() - 10); - if (this.tanks[1].getFill() < 0) + if(this.tanks[1].getFill() < 0) this.tanks[1].setFill(0); } - if (this.hullHeat > maxHullHeat) { + if(this.hullHeat > maxHullHeat) { this.hullHeat = maxHullHeat; } - if (this.hullHeat > 0 && this.tanks[0].getFill() > 0) { + if(this.hullHeat > 0 && this.tanks[0].getFill() > 0) { generateSteam(); this.hullHeat -= this.hullHeat * 0.085; } - if (this.coreHeat > maxCoreHeat) { + if(this.coreHeat > maxCoreHeat) { this.explode(); } - if (rods > 0 && coreHeat > 0 - && !(blocksRad(xCoord + 1, yCoord + 1, zCoord) - && blocksRad(xCoord - 1, yCoord + 1, zCoord) - && blocksRad(xCoord, yCoord + 1, zCoord + 1) - && blocksRad(xCoord, yCoord + 1, zCoord - 1))) { + if(rods > 0 && coreHeat > 0 && !(blocksRad(xCoord + 1, yCoord + 1, zCoord) && blocksRad(xCoord - 1, yCoord + 1, zCoord) && blocksRad(xCoord, yCoord + 1, zCoord + 1) && blocksRad(xCoord, yCoord + 1, zCoord - 1))) { - /*List list = (List) worldObj.getEntitiesWithinAABBExcludingEntity(null, - AxisAlignedBB.getBoundingBox(xCoord + 0.5 - 5, yCoord + 1.5 - 5, zCoord + 0.5 - 5, - xCoord + 0.5 + 5, yCoord + 1.5 + 5, zCoord + 0.5 + 5)); + /* + * List list = (List) + * worldObj.getEntitiesWithinAABBExcludingEntity(null, + * AxisAlignedBB.getBoundingBox(xCoord + 0.5 - 5, yCoord + 1.5 - + * 5, zCoord + 0.5 - 5, xCoord + 0.5 + 5, yCoord + 1.5 + 5, + * zCoord + 0.5 + 5)); + * + * for (Entity e : list) { if (e instanceof EntityLivingBase) + * Library.applyRadiation((EntityLivingBase)e, 80, 24, 60, 19); + * } + */ - for (Entity e : list) { - if (e instanceof EntityLivingBase) - Library.applyRadiation((EntityLivingBase)e, 80, 24, 60, 19); - }*/ - - float rad = (float)coreHeat / (float)maxCoreHeat * 50F; + float rad = (float) coreHeat / (float) maxCoreHeat * 50F; RadiationSavedData data = RadiationSavedData.getData(worldObj); data.incrementRad(worldObj, xCoord, zCoord, rad, rad * 4); } - for (int i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, rods, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150)); @@ -429,16 +406,16 @@ public class TileEntityMachineReactorSmall extends TileEntity PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, hullHeat, 3), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); } } - + @SuppressWarnings("incomplete-switch") private void generateSteam() { - //function of SHS produced per tick - //maxes out at heat% * tank capacity / 20 - double steam = (((double)hullHeat / (double)maxHullHeat) * ((double)tanks[2].getMaxFill() / 50D)) * conversionMod; - + // function of SHS produced per tick + // maxes out at heat% * tank capacity / 20 + double steam = (((double) hullHeat / (double) maxHullHeat) * ((double) tanks[2].getMaxFill() / 50D)) * conversionMod; + double water = steam; - + switch(tanks[2].getTankType()) { case STEAM: water /= 100D; @@ -449,25 +426,25 @@ public class TileEntityMachineReactorSmall extends TileEntity case SUPERHOTSTEAM: break; } - - tanks[0].setFill(tanks[0].getFill() - (int)Math.ceil(water)); - tanks[2].setFill(tanks[2].getFill() + (int)Math.floor(steam)); - + + tanks[0].setFill(tanks[0].getFill() - (int) Math.ceil(water)); + tanks[2].setFill(tanks[2].getFill() + (int) Math.floor(steam)); + if(tanks[0].getFill() < 0) tanks[0].setFill(0); - + if(tanks[2].getFill() > tanks[2].getMaxFill()) tanks[2].setFill(tanks[2].getMaxFill()); - + } - + private void getInteractions() { getInteractionForBlock(xCoord + 1, yCoord + 1, zCoord); getInteractionForBlock(xCoord - 1, yCoord + 1, zCoord); getInteractionForBlock(xCoord, yCoord + 1, zCoord + 1); getInteractionForBlock(xCoord, yCoord + 1, zCoord - 1); - + TileEntity te1 = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord); TileEntity te2 = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord); TileEntity te3 = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2); @@ -477,16 +454,16 @@ public class TileEntityMachineReactorSmall extends TileEntity boolean b2 = blocksRad(xCoord - 1, yCoord + 1, zCoord); boolean b3 = blocksRad(xCoord, yCoord + 1, zCoord + 1); boolean b4 = blocksRad(xCoord, yCoord + 1, zCoord - 1); - + TileEntityMachineReactorSmall[] reactors = new TileEntityMachineReactorSmall[4]; - reactors[0] = ((te1 instanceof TileEntityMachineReactorSmall && !b1) ? (TileEntityMachineReactorSmall)te1 : null); - reactors[1] = ((te2 instanceof TileEntityMachineReactorSmall && !b2) ? (TileEntityMachineReactorSmall)te2 : null); - reactors[2] = ((te3 instanceof TileEntityMachineReactorSmall && !b3) ? (TileEntityMachineReactorSmall)te3 : null); - reactors[3] = ((te4 instanceof TileEntityMachineReactorSmall && !b4) ? (TileEntityMachineReactorSmall)te4 : null); - + reactors[0] = ((te1 instanceof TileEntityMachineReactorSmall && !b1) ? (TileEntityMachineReactorSmall) te1 : null); + reactors[1] = ((te2 instanceof TileEntityMachineReactorSmall && !b2) ? (TileEntityMachineReactorSmall) te2 : null); + reactors[2] = ((te3 instanceof TileEntityMachineReactorSmall && !b3) ? (TileEntityMachineReactorSmall) te3 : null); + reactors[3] = ((te4 instanceof TileEntityMachineReactorSmall && !b4) ? (TileEntityMachineReactorSmall) te4 : null); + for(int i = 0; i < 4; i++) { - + if(reactors[i] != null && reactors[i].rods >= rodsMax && reactors[i].getRodCount() > 0) { decayMod += reactors[i].getRodCount() / 2D; } @@ -497,110 +474,110 @@ public class TileEntityMachineReactorSmall extends TileEntity private double coreHeatMod = 1.0D; private double hullHeatMod = 1.0D; private double conversionMod = 1.0D; - + private void getInteractionForBlock(int x, int y, int z) { - + Block b = worldObj.getBlock(x, y, z); TileEntity te = worldObj.getTileEntity(x, y, z); - + if(b == Blocks.lava || b == Blocks.flowing_lava) { hullHeatMod *= 3; conversionMod *= 0.5; - + } else if(b == Blocks.redstone_block) { conversionMod *= 1.15; - + } else if(b == ModBlocks.block_lead) { decayMod += 1; - + } else if(b == Blocks.water || b == Blocks.flowing_water) { tanks[0].setFill(tanks[0].getFill() + 25); - + if(tanks[0].getFill() > tanks[0].getMaxFill()) tanks[0].setFill(tanks[0].getMaxFill()); - + } else if(b == ModBlocks.block_niter) { if(tanks[0].getFill() >= 50 && tanks[1].getFill() + 5 <= tanks[1].getMaxFill()) { tanks[0].setFill(tanks[0].getFill() - 50); tanks[1].setFill(tanks[1].getFill() + 5); } - + } else if(b == ModBlocks.machine_reactor) { - int[] pos = ((MachineReactor)ModBlocks.machine_reactor).findCore(worldObj, x, y, z); - + int[] pos = ((MachineReactor) ModBlocks.machine_reactor).findCore(worldObj, x, y, z); + if(pos != null) { - + TileEntity tile = worldObj.getTileEntity(pos[0], pos[1], pos[2]); - + if(tile instanceof TileEntityMachineReactor) { - - TileEntityMachineReactor reactor = (TileEntityMachineReactor)tile; - + + TileEntityMachineReactor reactor = (TileEntityMachineReactor) tile; + if(reactor.charge <= 1 && this.hullHeat > 0) { reactor.charge = 1; - reactor.heat = (int)Math.floor(hullHeat * 4 / maxHullHeat) + 1; + reactor.heat = (int) Math.floor(hullHeat * 4 / maxHullHeat) + 1; } } } - + } else if(te instanceof TileEntityNukeFurnace) { - TileEntityNukeFurnace reactor = (TileEntityNukeFurnace)te; + TileEntityNukeFurnace reactor = (TileEntityNukeFurnace) te; if(reactor.dualPower < 1 && this.coreHeat > 0) reactor.dualPower = 1; - + } else if(b == ModBlocks.block_uranium) { coreHeatMod *= 1.05; - + } else if(b == Blocks.coal_block) { hullHeatMod *= 1.1; - + } else if(b == ModBlocks.block_beryllium) { hullHeatMod *= 0.95; conversionMod *= 1.05; - + } else if(b == ModBlocks.block_schrabidium) { decayMod += 1; conversionMod *= 1.25; hullHeatMod *= 1.1; - + } else if(b == ModBlocks.block_waste) { decayMod += 3; - + } } - + private boolean blocksRad(int x, int y, int z) { - + Block b = worldObj.getBlock(x, y, z); - + if(b == ModBlocks.block_lead || b == ModBlocks.block_desh || b == ModBlocks.brick_concrete) return true; - + if(b.getExplosionResistance(null) >= 100) return true; - + return false; } - + public int getRodCount() { - + int count = 0; - + for(int i = 0; i < 12; i++) { - + if(slots[i] != null && slots[i].getItem() instanceof ItemFuelRod) count++; } - + return count; } private boolean hasFuelRod(int id) { - if (id > 11) + if(id > 11) return false; - if (slots[id] != null) + if(slots[id] != null) return slots[id].getItem() instanceof ItemFuelRod; return false; @@ -610,13 +587,13 @@ public class TileEntityMachineReactorSmall extends TileEntity int[] neighbours = this.getNeighbouringSlots(id); - if (neighbours == null) + if(neighbours == null) return 0; int count = 0; - for (int i = 0; i < neighbours.length; i++) - if (hasFuelRod(neighbours[i])) + for(int i = 0; i < neighbours.length; i++) + if(hasFuelRod(neighbours[i])) count++; return count; @@ -625,14 +602,14 @@ public class TileEntityMachineReactorSmall extends TileEntity // itemstack in slots[id] has to contain ItemFuelRod item private void decay(int id) { - if (id > 11) + if(id > 11) return; int decay = getNeightbourCount(id) + 1; - + decay *= decayMod; - for (int i = 0; i < decay; i++) { + for(int i = 0; i < decay; i++) { ItemFuelRod rod = ((ItemFuelRod) slots[id].getItem()); this.coreHeat += rod.heat * coreHeatMod; ItemFuelRod.setLifeTime(slots[id], ItemFuelRod.getLifeTime(slots[id]) + 1); @@ -647,59 +624,59 @@ public class TileEntityMachineReactorSmall extends TileEntity // itemstack in slots[id] has to contain ItemFuelRod item private void onRunOut(int id) { - //System.out.println("aaa"); + // System.out.println("aaa"); Item item = slots[id].getItem(); - if (item == ModItems.rod_uranium_fuel) { + if(item == ModItems.rod_uranium_fuel) { slots[id] = new ItemStack(ModItems.rod_uranium_fuel_depleted); - } else if (item == ModItems.rod_thorium_fuel) { + } else if(item == ModItems.rod_thorium_fuel) { slots[id] = new ItemStack(ModItems.rod_thorium_fuel_depleted); - } else if (item == ModItems.rod_plutonium_fuel) { + } else if(item == ModItems.rod_plutonium_fuel) { slots[id] = new ItemStack(ModItems.rod_plutonium_fuel_depleted); - } else if (item == ModItems.rod_mox_fuel) { + } else if(item == ModItems.rod_mox_fuel) { slots[id] = new ItemStack(ModItems.rod_mox_fuel_depleted); - } else if (item == ModItems.rod_schrabidium_fuel) { + } else if(item == ModItems.rod_schrabidium_fuel) { slots[id] = new ItemStack(ModItems.rod_schrabidium_fuel_depleted); - } else if (item == ModItems.rod_dual_uranium_fuel) { + } else if(item == ModItems.rod_dual_uranium_fuel) { slots[id] = new ItemStack(ModItems.rod_dual_uranium_fuel_depleted); - } else if (item == ModItems.rod_dual_thorium_fuel) { + } else if(item == ModItems.rod_dual_thorium_fuel) { slots[id] = new ItemStack(ModItems.rod_dual_thorium_fuel_depleted); - } else if (item == ModItems.rod_dual_plutonium_fuel) { + } else if(item == ModItems.rod_dual_plutonium_fuel) { slots[id] = new ItemStack(ModItems.rod_dual_plutonium_fuel_depleted); - } else if (item == ModItems.rod_dual_mox_fuel) { + } else if(item == ModItems.rod_dual_mox_fuel) { slots[id] = new ItemStack(ModItems.rod_dual_mox_fuel_depleted); - } else if (item == ModItems.rod_dual_schrabidium_fuel) { + } else if(item == ModItems.rod_dual_schrabidium_fuel) { slots[id] = new ItemStack(ModItems.rod_dual_schrabidium_fuel_depleted); - } else if (item == ModItems.rod_quad_uranium_fuel) { + } else if(item == ModItems.rod_quad_uranium_fuel) { slots[id] = new ItemStack(ModItems.rod_quad_uranium_fuel_depleted); - } else if (item == ModItems.rod_quad_thorium_fuel) { + } else if(item == ModItems.rod_quad_thorium_fuel) { slots[id] = new ItemStack(ModItems.rod_quad_thorium_fuel_depleted); - } else if (item == ModItems.rod_quad_plutonium_fuel) { + } else if(item == ModItems.rod_quad_plutonium_fuel) { slots[id] = new ItemStack(ModItems.rod_quad_plutonium_fuel_depleted); - } else if (item == ModItems.rod_quad_mox_fuel) { + } else if(item == ModItems.rod_quad_mox_fuel) { slots[id] = new ItemStack(ModItems.rod_quad_mox_fuel_depleted); - } else if (item == ModItems.rod_quad_schrabidium_fuel) { + } else if(item == ModItems.rod_quad_schrabidium_fuel) { slots[id] = new ItemStack(ModItems.rod_quad_schrabidium_fuel_depleted); } } private void explode() { - for (int i = 0; i < slots.length; i++) { + for(int i = 0; i < slots.length; i++) { this.slots[i] = null; } @@ -731,7 +708,7 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public boolean getTact() { - if (age >= 0 && age < 10) { + if(age >= 0 && age < 10) { return true; } @@ -740,9 +717,9 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public int getMaxFluidFill(FluidType type) { - if (type.name().equals(tanks[0].getTankType().name())) + if(type.name().equals(tanks[0].getTankType().name())) return tanks[0].getMaxFill(); - else if (type.name().equals(tanks[1].getTankType().name())) + else if(type.name().equals(tanks[1].getTankType().name())) return tanks[1].getMaxFill(); else return 0; @@ -750,21 +727,21 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public void setFluidFill(int i, FluidType type) { - if (type.name().equals(tanks[0].getTankType().name())) + if(type.name().equals(tanks[0].getTankType().name())) tanks[0].setFill(i); - else if (type.name().equals(tanks[1].getTankType().name())) + else if(type.name().equals(tanks[1].getTankType().name())) tanks[1].setFill(i); - else if (type.name().equals(tanks[2].getTankType().name())) + else if(type.name().equals(tanks[2].getTankType().name())) tanks[2].setFill(i); } @Override public int getFluidFill(FluidType type) { - if (type.name().equals(tanks[0].getTankType().name())) + if(type.name().equals(tanks[0].getTankType().name())) return tanks[0].getFill(); - else if (type.name().equals(tanks[1].getTankType().name())) + else if(type.name().equals(tanks[1].getTankType().name())) return tanks[1].getFill(); - else if (type.name().equals(tanks[2].getTankType().name())) + else if(type.name().equals(tanks[2].getTankType().name())) return tanks[2].getFill(); else return 0; @@ -772,13 +749,13 @@ public class TileEntityMachineReactorSmall extends TileEntity @Override public void setFillstate(int fill, int index) { - if (index < 3 && tanks[index] != null) + if(index < 3 && tanks[index] != null) tanks[index].setFill(fill); } @Override public void setType(FluidType type, int index) { - if (index < 3 && tanks[index] != null) + if(index < 3 && tanks[index] != null) tanks[index].setTankType(type); } @@ -788,7 +765,7 @@ public class TileEntityMachineReactorSmall extends TileEntity list.add(tanks[0]); list.add(tanks[1]); list.add(tanks[2]); - + return list; } @@ -812,4 +789,12 @@ public class TileEntityMachineReactorSmall extends TileEntity public double getMaxRenderDistanceSquared() { return 65536.0D; } + + public boolean isSubmerged() { + + return worldObj.getBlock(xCoord + 1, yCoord + 1, zCoord).getMaterial() == Material.water && + worldObj.getBlock(xCoord, yCoord + 1, zCoord + 1).getMaterial() == Material.water && + worldObj.getBlock(xCoord - 1, yCoord + 1, zCoord).getMaterial() == Material.water && + worldObj.getBlock(xCoord, yCoord + 1, zCoord - 1).getMaterial() == Material.water; + } } \ No newline at end of file