From 39d6f989b2f6be6b8f4d39e0770aab81544a5786 Mon Sep 17 00:00:00 2001 From: HbmMods Date: Fri, 26 Feb 2016 18:44:43 +0100 Subject: [PATCH] Big Reactors --- assets/hbm/lang/de_DE.lang | 9 + assets/hbm/lang/en_US.lang | 9 + .../hbm/textures/blocks/reactor_computer.png | Bin 0 -> 538 bytes .../blocks/reactor_conductor_side.png | Bin 0 -> 482 bytes .../textures/blocks/reactor_conductor_top.png | Bin 0 -> 496 bytes .../textures/blocks/reactor_control_side.png | Bin 0 -> 440 bytes .../textures/blocks/reactor_control_top.png | Bin 0 -> 405 bytes .../textures/blocks/reactor_element_side.png | Bin 0 -> 435 bytes .../textures/blocks/reactor_element_top.png | Bin 0 -> 421 bytes assets/hbm/textures/blocks/reactor_hatch.png | Bin 0 -> 513 bytes .../textures/gui/gui_reactor_multiblock.png | Bin 0 -> 10346 bytes assets/hbm/textures/items/fuse.png | Bin 0 -> 275 bytes com/hbm/blocks/BlockReactor.java | 47 ++ com/hbm/blocks/MachineGenerator.java | 5 +- com/hbm/blocks/ModBlocks.java | 22 +- com/hbm/blocks/ReactorCore.java | 97 +++ com/hbm/blocks/ReactorHatch.java | 178 ++++ .../blocks/TileEntityMachineGenerator.java | 15 +- .../blocks/TileEntityReactorMultiblock.java | 757 ++++++++++++++++++ com/hbm/gui/ContainerGenerator.java | 1 - com/hbm/gui/ContainerReactorMultiblock.java | 153 ++++ com/hbm/gui/GUIReactorMultiblock.java | 56 ++ com/hbm/interfaces/IReactor.java | 21 + com/hbm/items/ItemCustomLore.java | 10 + com/hbm/items/ModItems.java | 3 + com/hbm/main/CraftingManager.java | 2 +- com/hbm/main/GUIHandler.java | 19 + com/hbm/main/MainRegistry.java | 2 + 28 files changed, 1395 insertions(+), 11 deletions(-) create mode 100644 assets/hbm/textures/blocks/reactor_computer.png create mode 100644 assets/hbm/textures/blocks/reactor_conductor_side.png create mode 100644 assets/hbm/textures/blocks/reactor_conductor_top.png create mode 100644 assets/hbm/textures/blocks/reactor_control_side.png create mode 100644 assets/hbm/textures/blocks/reactor_control_top.png create mode 100644 assets/hbm/textures/blocks/reactor_element_side.png create mode 100644 assets/hbm/textures/blocks/reactor_element_top.png create mode 100644 assets/hbm/textures/blocks/reactor_hatch.png create mode 100644 assets/hbm/textures/gui/gui_reactor_multiblock.png create mode 100644 assets/hbm/textures/items/fuse.png create mode 100644 com/hbm/blocks/BlockReactor.java create mode 100644 com/hbm/blocks/ReactorCore.java create mode 100644 com/hbm/blocks/ReactorHatch.java create mode 100644 com/hbm/blocks/TileEntityReactorMultiblock.java create mode 100644 com/hbm/gui/ContainerReactorMultiblock.java create mode 100644 com/hbm/gui/GUIReactorMultiblock.java create mode 100644 com/hbm/interfaces/IReactor.java diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index f32cc13e8..fa4f1f37b 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -113,6 +113,15 @@ tile.factory_advanced_core.name=Fortgeschrittene Fabrikkernkomponente item.factory_core_advanced.name=Fortgeschrittener Fabrikenergiecluster container.factoryAdvanced=Fortgeschrittene Fabrik +tile.reactor_element.name=Reaktorkammer +tile.reactor_control.name=Steuerstäbe +tile.reactor_hatch.name=Kraftwerkszugriffsluke +tile.reactor_conductor.name=Stromanschluss +tile.reactor_computer.name=Reaktorsteuerung +container.reactorMultiblock=Großer Atomreaktor + +item.fuse.name=Sicherung + tile.test_nuke.name=Test Atombombe item.ingot_uranium.name=Uranbarren diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 43ab92745..5ea2ba758 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -113,6 +113,15 @@ tile.factory_advanced_core.name=Advanced Factory Core Component item.factory_core_advanced.name=Advanced Factory Energy Cluster container.factoryAdvanced=Advanced Factory +tile.reactor_element.name=Reaktor Chamber +tile.reactor_control.name=Control Rods +tile.reactor_hatch.name=Reactor Access Hatch +tile.reactor_conductor.name=Reactor Electricity Port +tile.reactor_computer.name=Reaktor Control +container.reactorMultiblock=Big Nuclear Reactor + +item.fuse.name=Fuse + tile.test_nuke.name=Test Nuke item.ingot_uranium.name=Uranium Ingot diff --git a/assets/hbm/textures/blocks/reactor_computer.png b/assets/hbm/textures/blocks/reactor_computer.png new file mode 100644 index 0000000000000000000000000000000000000000..7cb3c39e2cf821236229b7e3d40adb5f809ba341 GIT binary patch literal 538 zcmV+#0_FXQP)N2bZe?^J zG%heMIczh2P5=M_m`OxIR5(wKl1*v?K@f%e0@>#j*$NICe;FKI=w1-SWe9?UdV~Q* z2x}q&F1rYzu*6Q zfV?e;#bUKuZM9nc+;KP@Zr;oBc--&z1e~Wg!#N(0%jI$;5(yca%_jZ0=5G6H^g;ni z0u{i3VJoTE>+NvY2^+j z$z)QJ)Sl#UI7E3U35IsNjcJT>{dA07>N(fzHST2^PE#lph+vQ;%~4e1R8k)Yb0`Te zJUrz}gTPY-e72nu3`k-f=mE3{0GEJ$5!f0SFlMLpPw;7m@lglv`x}CNMkoFlA}3(~ c1;=rI0Z%DVL|t@_)Bpeg07*qoM6N<$f`3`v2mk;8 literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/reactor_conductor_side.png b/assets/hbm/textures/blocks/reactor_conductor_side.png new file mode 100644 index 0000000000000000000000000000000000000000..ca6bda23ec77f2fc29f52ee72f7a006604f2fb4f GIT binary patch literal 482 zcmV<80UiE{P)N2bZe?^J zG%heMIczh2P5=M_U`a$lR5(wKl5IJ$-nWSUx?r8Vm-yLseCf z@L{o7{65_MEN|s}hF2U0b6r;_Wt@4US0mCRL9`@?lG-h+!0n(wB<}Bsf80iCDz{Ut}1@ YA8*M8>Dn!p#sB~S07*qoM6N<$f_`kn*Z=?k literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/reactor_conductor_top.png b/assets/hbm/textures/blocks/reactor_conductor_top.png new file mode 100644 index 0000000000000000000000000000000000000000..89ad6807e7778d21ee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{ znd8&hI4k!ZP*dqrTCL+9d{=?TS(S5dhWG0#pUX#tCK<>axa7kryP$E~3igN2bZe?^J zG%heMIczh2P5=M_F-b&0R5(wKlEF@dFc3ibE0S$M78U|55V#vilyEY#5d{2uUpqz7 ztcmY1X$$SVnbx^nE~nE;DHQ}k9LHIf<#|pN82i5eu){x2UDvOM+wC?@(>%{ac)3Ru zMGj}!*+0-5JkRU<{>ea684L%)Fl^iQ(crqS⁡CCQZ|zS5?*f4o6Z|k|adQK*8Ti zQe~Q^U!P?~Iw321gJ{qS=?2lN7?`4TKA(wQ*IA`?UCXk>hltoXjzl>XA3@UUqOaGh z$@YVz*pc5|vL3_mY+!%}NQ?MEE0JN_whsdXfea|U8SLQ(DshUUu(KUxWP_A(gzB}D z_y|n(qcKR|xHY*r+a)sKz}<0E;zPUW5;sU5d-9Hce0RI_7bJ8rW*-;}4JL?DA5A0z d?_W?#eFDZS4akgVFh~FZ002ovPDHLkV1h@dtc(Bv literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/reactor_element_top.png b/assets/hbm/textures/blocks/reactor_element_top.png new file mode 100644 index 0000000000000000000000000000000000000000..480a4eb7040380ee3ce120f65d7d67afbc9b245d GIT binary patch literal 421 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|Ea{HEjtmSN`?>!lvI6;>1s;*b z3=DjSK$uZf!>a)(C{f}XQ4*Y=R#Ki=l*&+$n3-3imzP?iV4`QBXPIMM=f}XnsO;(D z7-Hc+b<%0SRtEu>pV~qkCw|K^RSOBJY%&a2;;7k|o)OTbw?%C7yjd^T&0^B!U^;Bz zbGbxDo#(KL?`EB3(SY0A{+2XZM}>y=%RaX7yKHjaSi9mc@4olhXBKolo{`76Rp!4+ zXme_0?S1E~rLogg*V&w}zNx6vGr{-ri(TtPrll6fiXRUYQT063(J$-7q!{?%V7qFY zXERT5o1ak4#8r*k%VXPJpA|9(bT5^@x$SLYW^6d;^S4ZbI~{GU&VNq+&R(;;WswK- ztLL)jLeEbLaoyhL7@J&sUvUZ7*BX=6VIr(k=bSV&eDjN4lhcvg#y$oVDOdnX>EWdd);1XTP)!f*N2bZe?^J zG%heMIczh2P5=M_e@R3^R5(v%lFf?3KoErUvU`xdY>eU$8jU6@C~7o%F*)P`mX(A+ zF3S?|2j6PHnI5wX)?w1jRCTpoT5m6Sf8s-<-EN=H=eo9d;A7i1Cs)(yltSvkU@#hu zJkKl3QfS?7R|&Wh9wf(c`u)Dt6tmf^)9DmNAp&Sh(ChVl-#;7<%jI&lT7_YFJRUcj z&GrdyM1ZG7Cyd79ahj$-8dX(YE|>3rh@uD@g5hwe1o$=@jnnBQ&tfHw<)#)ep2Y`; zAPCm$HM8b({)N^b$4ED9P>BZ*y-BeXG?XM3Vyo@`~fwyuW~r z5u$OB$q*10oq*12yWj6wu7EU&Y(AfpuMsd3d!Tk*mwyU3)U=dWPUay5d{hoV{$Ui8 z$pkTlP~l09nD)wn)j}l)79z`LEqdeXo|7jj6pG>(Xymcgvk>OJ00000NkvXXu0mjf DGxpgj literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/gui/gui_reactor_multiblock.png b/assets/hbm/textures/gui/gui_reactor_multiblock.png new file mode 100644 index 0000000000000000000000000000000000000000..16ab6af981f6c1a962312b006f7789a0b769f631 GIT binary patch literal 10346 zcmd^leLR$D+y8mZHD=CL*m(mc3VPV!V`;PT!q zTWadF6}{XUOI(Rm3dvpMZ9-lu42r>+dCpO)&HnCtf6qV9=kq+DkJoFi^Ei*=dwh@Y zah!9_5husB%8Htb008B6_G_F0K;WMUkSD=kZhJ0lgTIKrtJkjv;A*mx*i#PvuMlLv zX)gfO64^ImCg-9DFVcc-HwL=|ZVL|c+_Mz~dHMwe8wG3)W-K)_F#jsrMRz?d84<@szYb{~X^y11o42+PoN#GzdwG$UrLn@_ z%qlDNd3kA4TMy6UOlx~rxMkV+Pwi_|6udTJQM+oF6V=DYny)FwyTm z@k+^?-|u>NH^JU>7bZyUI8pHWO5xYX3vUVs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T=P3_0!NuQU_01JIfrz3-33{f{+*Q%@@%kvnVL ut+#TPnv&h$Gq9f_|M{0!l4_|GUG#RL(Y9tkC-}KQu+G+T%@u3T{{I4GXXcy$ literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/items/fuse.png b/assets/hbm/textures/items/fuse.png new file mode 100644 index 0000000000000000000000000000000000000000..8305d446221f1b766f29dcc6592f00577f220be6 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt33 zJHf#UcGYSDqj8^=v2w9}LGJ|o$ z(yeTpUd;=QmQ#ZN&vc!_&LYV#G2U))ufUhm^@eROu^eusT$7)~)CVtIA*;w)BA QpnDiRUHx3vIVCg!0JSD$d;kCd literal 0 HcmV?d00001 diff --git a/com/hbm/blocks/BlockReactor.java b/com/hbm/blocks/BlockReactor.java new file mode 100644 index 000000000..186c5a552 --- /dev/null +++ b/com/hbm/blocks/BlockReactor.java @@ -0,0 +1,47 @@ +package com.hbm.blocks; + +import com.hbm.lib.RefStrings; + +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.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +public class BlockReactor extends Block { + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + protected BlockReactor(Material p_i45394_1_) { + super(p_i45394_1_); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + if(this == ModBlocks.reactor_conductor) + { + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":reactor_conductor_top"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reactor_conductor_side"); + } + if(this == ModBlocks.reactor_control) + { + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":reactor_control_top"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reactor_control_side"); + } + if(this == ModBlocks.reactor_element) + { + this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":reactor_element_top"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reactor_element_side"); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); + } + +} diff --git a/com/hbm/blocks/MachineGenerator.java b/com/hbm/blocks/MachineGenerator.java index ba65dd6b7..37b04d5b8 100644 --- a/com/hbm/blocks/MachineGenerator.java +++ b/com/hbm/blocks/MachineGenerator.java @@ -29,9 +29,6 @@ public class MachineGenerator extends BlockContainer { private final Random field_149933_a = new Random(); private Random rand; private static boolean keepInventory; - public int heat = 0; - - public boolean isLoaded = false; @SideOnly(Side.CLIENT) private IIcon iconSide; @@ -141,7 +138,7 @@ public class MachineGenerator extends BlockContainer { if (!p_149723_1_.isRemote) { TileEntityMachineGenerator entity = (TileEntityMachineGenerator) p_149723_1_.getTileEntity(p_149723_2_, p_149723_3_, p_149723_4_); - if(this.isLoaded) + if(entity != null && entity.isLoaded) { p_149723_1_.createExplosion(null, p_149723_2_, p_149723_3_, p_149723_4_, 18.0F, true); ExplosionNukeGeneric.waste(p_149723_1_, p_149723_2_, p_149723_3_, p_149723_4_, 35); diff --git a/com/hbm/blocks/ModBlocks.java b/com/hbm/blocks/ModBlocks.java index aaa7e5825..d5d6a8740 100644 --- a/com/hbm/blocks/ModBlocks.java +++ b/com/hbm/blocks/ModBlocks.java @@ -183,6 +183,13 @@ public class ModBlocks { public static Block factory_advanced_core; public static final int guiID_factory_advanced = 25; + public static Block reactor_element; + public static Block reactor_control; + public static Block reactor_hatch; + public static Block reactor_conductor; + public static Block reactor_computer; + public static final int guiID_reactor_multiblock = 26; + public static Block launch_pad; public static Block launch_pad_generic; public static Block launch_pad_incendiary; @@ -348,6 +355,12 @@ public class ModBlocks { factory_advanced_hull = new BlockGeneric(Material.iron).setBlockName("factory_advanced_hull").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_advanced_hull"); factory_advanced_furnace = new FactoryHatch(Material.iron).setBlockName("factory_advanced_furnace").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_advanced_furnace"); factory_advanced_core = new FactoryCoreAdvanced(Material.iron).setBlockName("factory_advanced_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":factory_advanced_core"); + + reactor_element = new BlockReactor(Material.iron).setBlockName("reactor_element").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":reactor_element_side"); + reactor_control = new BlockReactor(Material.iron).setBlockName("reactor_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":reactor_control_side"); + reactor_hatch = new ReactorHatch(Material.iron).setBlockName("reactor_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":brick_concrete"); + reactor_conductor = new BlockReactor(Material.iron).setBlockName("reactor_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":reactor_conductor_side"); + reactor_computer = new ReactorCore(Material.iron).setBlockName("reactor_computer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabBlock).setBlockTextureName(RefStrings.MODID + ":reactor_computer"); launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.tabNuke).setBlockTextureName(RefStrings.MODID + ":launch_pad"); launch_pad_generic = new LaunchPad(Material.iron).setBlockName("launch_pad_generic").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":launch_pad"); @@ -496,7 +509,7 @@ public class ModBlocks { GameRegistry.registerBlock(machine_coal_off, machine_coal_off.getUnlocalizedName()); GameRegistry.registerBlock(machine_coal_on, machine_coal_on.getUnlocalizedName()); GameRegistry.registerBlock(machine_generator, machine_generator.getUnlocalizedName()); - GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName()); + //GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName()); GameRegistry.registerBlock(machine_battery, machine_battery.getUnlocalizedName()); GameRegistry.registerBlock(machine_electric_furnace_off, machine_electric_furnace_off.getUnlocalizedName()); GameRegistry.registerBlock(machine_electric_furnace_on, machine_electric_furnace_on.getUnlocalizedName()); @@ -510,6 +523,13 @@ public class ModBlocks { GameRegistry.registerBlock(factory_advanced_furnace, factory_advanced_furnace.getUnlocalizedName()); GameRegistry.registerBlock(factory_advanced_core, factory_advanced_core.getUnlocalizedName()); + //Multiblock Generators + GameRegistry.registerBlock(reactor_element, reactor_element.getUnlocalizedName()); + GameRegistry.registerBlock(reactor_control, reactor_control.getUnlocalizedName()); + GameRegistry.registerBlock(reactor_hatch, reactor_hatch.getUnlocalizedName()); + GameRegistry.registerBlock(reactor_conductor, reactor_conductor.getUnlocalizedName()); + GameRegistry.registerBlock(reactor_computer, reactor_computer.getUnlocalizedName()); + //Launch Pads GameRegistry.registerBlock(launch_pad, launch_pad.getUnlocalizedName()); GameRegistry.registerBlock(launch_pad_generic, launch_pad_generic.getUnlocalizedName()); diff --git a/com/hbm/blocks/ReactorCore.java b/com/hbm/blocks/ReactorCore.java new file mode 100644 index 000000000..a9d96c565 --- /dev/null +++ b/com/hbm/blocks/ReactorCore.java @@ -0,0 +1,97 @@ +package com.hbm.blocks; + +import java.util.Random; + +import com.hbm.explosion.ExplosionNukeGeneric; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; + +public class ReactorCore extends BlockContainer { + + public boolean keepInventory = false; + public Random field_149933_a = new Random(); + + protected ReactorCore(Material p_i45386_1_) { + super(p_i45386_1_); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityReactorMultiblock(); + } + + @Override + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { + if (!keepInventory) + { + TileEntityReactorMultiblock tileentityfurnace = (TileEntityReactorMultiblock)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + + if (tileentityfurnace != null) + { + for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(i1); + + if (itemstack != null) + { + float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j1 = this.field_149933_a.nextInt(21) + 10; + + if (j1 > itemstack.stackSize) + { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3; + entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3; + p_149749_1_.spawnEntityInWorld(entityitem); + } + } + } + + p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_); + } + } + + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + } + + @Override + public void onBlockDestroyedByExplosion(World p_149723_1_, int p_149723_2_, int p_149723_3_, int p_149723_4_, Explosion p_149723_5_) + { + if (!p_149723_1_.isRemote) + { + TileEntityReactorMultiblock entity = (TileEntityReactorMultiblock) p_149723_1_.getTileEntity(p_149723_2_, p_149723_3_, p_149723_4_); + if(entity != null && entity.isLoaded) + { + entity.explode(); + } + } + } + +} diff --git a/com/hbm/blocks/ReactorHatch.java b/com/hbm/blocks/ReactorHatch.java new file mode 100644 index 000000000..afb80d657 --- /dev/null +++ b/com/hbm/blocks/ReactorHatch.java @@ -0,0 +1,178 @@ +package com.hbm.blocks; + +import java.util.Random; + +import com.hbm.lib.RefStrings; +import com.hbm.main.MainRegistry; + +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +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.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ReactorHatch extends Block { + + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + protected ReactorHatch(Material p_i45394_1_) { + super(p_i45394_1_); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister iconRegister) { + this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":reactor_hatch"); + this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_concrete"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int metadata) { + return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return Item.getItemFromBlock(this); + } + + @Override + public void onBlockAdded(World world, int x, int y, int z) { + super.onBlockAdded(world, x, y, z); + //this.setDefaultDirection(world, x, y, z); + } + + private void setDefaultDirection(World world, int x, int y, int z) { + if(!world.isRemote) + { + Block block1 = world.getBlock(x, y, z - 1); + Block block2 = world.getBlock(x, y, z + 1); + Block block3 = world.getBlock(x - 1, y, z); + Block block4 = world.getBlock(x + 1, y, z); + + byte b0 = 3; + + if(block1.func_149730_j() && !block2.func_149730_j()) + { + b0 = 3; + } + if(block2.func_149730_j() && !block1.func_149730_j()) + { + b0 = 2; + } + if(block3.func_149730_j() && !block4.func_149730_j()) + { + b0 = 5; + } + if(block4.func_149730_j() && !block3.func_149730_j()) + { + b0 = 4; + } + + world.setBlockMetadataWithNotify(x, y, z, b0, 2); + } + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { + int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + if(i == 0) + { + world.setBlockMetadataWithNotify(x, y, z, 2, 2); + } + if(i == 1) + { + world.setBlockMetadataWithNotify(x, y, z, 5, 2); + } + if(i == 2) + { + world.setBlockMetadataWithNotify(x, y, z, 3, 2); + } + if(i == 3) + { + world.setBlockMetadataWithNotify(x, y, z, 4, 2); + } + } + + @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) + { + return true; + } else if(!player.isSneaking()) + { + if(world.getBlockMetadata(x, y, z) == 2) + { + if(world.getTileEntity(x, y, z + 2) instanceof TileEntityReactorMultiblock) + { + if(((TileEntityReactorMultiblock)world.getTileEntity(x, y, z + 2)).isStructureValid(world)) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_multiblock, world, x, y, z + 2); + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); + } + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); + } + } + if(world.getBlockMetadata(x, y, z) == 3) + { + if(world.getTileEntity(x, y, z - 2) instanceof TileEntityReactorMultiblock) + { + if(((TileEntityReactorMultiblock)world.getTileEntity(x, y, z - 2)).isStructureValid(world)) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_multiblock, world, x, y, z - 2); + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); + } + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); + } + } + if(world.getBlockMetadata(x, y, z) == 4) + { + if(world.getTileEntity(x + 2, y, z) instanceof TileEntityReactorMultiblock) + { + if(((TileEntityReactorMultiblock)world.getTileEntity(x + 2, y, z)).isStructureValid(world)) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_multiblock, world, x + 2, y, z); + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); + } + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); + } + } + if(world.getBlockMetadata(x, y, z) == 5) + { + if(world.getTileEntity(x - 2, y, z) instanceof TileEntityReactorMultiblock) + { + if(((TileEntityReactorMultiblock)world.getTileEntity(x - 2, y, z)).isStructureValid(world)) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_multiblock, world, x - 2, y, z); + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); + } + } else { + player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); + } + } + return true; + } else { + return false; + } + } +} diff --git a/com/hbm/blocks/TileEntityMachineGenerator.java b/com/hbm/blocks/TileEntityMachineGenerator.java index 96fe6c51d..6ff0896f5 100644 --- a/com/hbm/blocks/TileEntityMachineGenerator.java +++ b/com/hbm/blocks/TileEntityMachineGenerator.java @@ -1,5 +1,7 @@ package com.hbm.blocks; +import java.util.Random; + import com.hbm.explosion.ExplosionNukeGeneric; import com.hbm.items.ItemFuelRod; import com.hbm.items.ModItems; @@ -25,6 +27,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve public final int heatMax = 100000; public int power; public final int powerMax = 100000; + public boolean isLoaded = false; private static final int[] slots_top = new int[] {}; private static final int[] slots_bottom = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; @@ -482,12 +485,12 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve } if(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord) instanceof MachineGenerator) - ((MachineGenerator)this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord)).isLoaded = false; + this.isLoaded = false; } else { if(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord) instanceof MachineGenerator) - ((MachineGenerator)this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord)).isLoaded = true; + this.isLoaded = true; } } /*//Electric Furnace @@ -800,9 +803,13 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve } public void attemptHeat(int i) { - if(this.cool - i >= 0) + Random rand = new Random(); + + int j = rand.nextInt(i); + + if(this.cool - j >= 0) { - this.cool -= i; + this.cool -= j; } else { this.heat += i; } diff --git a/com/hbm/blocks/TileEntityReactorMultiblock.java b/com/hbm/blocks/TileEntityReactorMultiblock.java new file mode 100644 index 000000000..431667134 --- /dev/null +++ b/com/hbm/blocks/TileEntityReactorMultiblock.java @@ -0,0 +1,757 @@ +package com.hbm.blocks; + +import java.util.HashSet; +import java.util.List; +import java.util.Random; + +import com.hbm.entity.EntityNuclearCreeper; +import com.hbm.entity.EntityNukeCloudSmall; +import com.hbm.entity.EntityNukeExplosionAdvanced; +import com.hbm.explosion.ExplosionNukeGeneric; +import com.hbm.explosion.ExplosionParticle; +import com.hbm.interfaces.IReactor; +import com.hbm.items.ItemFuelRod; +import com.hbm.items.ModItems; +import com.hbm.lib.Library; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.passive.EntityMooshroom; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class TileEntityReactorMultiblock extends TileEntity implements ISidedInventory, IReactor { + + public int water; + public final static int waterMax = 10000000; + public int cool; + public final static int coolMax = 10000000; + public int heat; + public final static int heatMax = 1000000; + public int power; + public final static int maxPower = 1000000; + private ItemStack slots[]; + + public boolean isLoaded = false; + + private String customName; + + public TileEntityReactorMultiblock() { + slots = new ItemStack[34]; + } + @Override + public int getSizeInventory() { + return slots.length; + } + + @Override + public ItemStack getStackInSlot(int i) { + return slots[i]; + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + if(slots[i] != null) + { + ItemStack itemStack = slots[i]; + slots[i] = null; + return itemStack; + } else { + return null; + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemStack) { + slots[i] = itemStack; + if(itemStack != null && itemStack.stackSize > getInventoryStackLimit()) + { + itemStack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public String getInventoryName() { + return this.hasCustomInventoryName() ? this.customName : "container.reactorMultiblock"; + } + + @Override + public boolean hasCustomInventoryName() { + return this.customName != null && this.customName.length() > 0; + } + + public void setCustomName(String name) { + this.customName = name; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) + { + return false; + }else{ + return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64; + } + } + + @Override + public void openInventory() {} + + @Override + public void closeInventory() {} + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemStack) { + return true; + } + + @Override + public ItemStack decrStackSize(int i, int 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) + { + slots[i] = null; + } + + return itemStack1; + } else { + return null; + } + } + + @Override + public int[] getAccessibleSlotsFromSide(int p_94128_1_) { + return null; + } + + @Override + public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) { + return false; + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) { + return false; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList list = nbt.getTagList("items", 10); + + slots = new ItemStack[getSizeInventory()]; + + for(int i = 0; i < list.tagCount(); i++) + { + NBTTagCompound nbt1 = list.getCompoundTagAt(i); + byte b0 = nbt1.getByte("slot"); + if(b0 >= 0 && b0 < slots.length) + { + slots[b0] = ItemStack.loadItemStackFromNBT(nbt1); + } + } + + water = nbt.getShort("water"); + cool = nbt.getShort("cool"); + power = nbt.getShort("power"); + heat = nbt.getShort("heat"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + nbt.setShort("water", (short) water); + nbt.setShort("cool", (short) cool); + nbt.setShort("power", (short) power); + nbt.setShort("heat", (short) heat); + NBTTagList list = new NBTTagList(); + + 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); + list.appendTag(nbt1); + } + } + nbt.setTag("items", list); + } + + @Override + public void updateEntity() { + if(isStructureValid(worldObj)) + { + + if(!worldObj.isRemote) + { + if(slots[30] != null && slots[30].getItem() == Items.water_bucket && this.water + 250000 <= waterMax) + { + this.slots[30].stackSize--; + this.water += 250000; + if(this.slots[30].stackSize == 0) + { + this.slots[30] = this.slots[30].getItem().getContainerItem(this.slots[30]); + } + } + if(slots[30] != null && slots[30].getItem() == ModItems.rod_water && this.water + 250000 <= waterMax) + { + this.slots[30].stackSize--; + this.water += 250000; + if(this.slots[30].stackSize == 0) + { + this.slots[30] = this.slots[30].getItem().getContainerItem(this.slots[30]); + } + } + if(slots[30] != null && slots[30].getItem() == ModItems.rod_dual_water && this.water + 500000 <= waterMax) + { + this.slots[30].stackSize--; + this.water += 500000; + if(this.slots[30].stackSize == 0) + { + this.slots[30] = this.slots[30].getItem().getContainerItem(this.slots[30]); + } + } + if(slots[30] != null && slots[30].getItem() == ModItems.rod_quad_water && this.water + 1000000 <= waterMax) + { + this.slots[30].stackSize--; + this.water += 1000000; + if(this.slots[30].stackSize == 0) + { + this.slots[30] = this.slots[30].getItem().getContainerItem(this.slots[30]); + } + } + + if(slots[31] != null && slots[31].getItem() == ModItems.rod_coolant && this.cool + 250000 <= coolMax) + { + this.slots[31].stackSize--; + this.cool += 250000; + if(this.slots[31].stackSize == 0) + { + this.slots[31] = this.slots[31].getItem().getContainerItem(this.slots[31]); + } + } + + if(slots[31] != null && slots[31].getItem() == ModItems.rod_dual_coolant && this.cool + 500000 <= coolMax) + { + this.slots[31].stackSize--; + this.cool += 500000; + if(this.slots[31].stackSize == 0) + { + this.slots[31] = this.slots[31].getItem().getContainerItem(this.slots[31]); + } + } + + if(slots[31] != null && slots[31].getItem() == ModItems.rod_quad_coolant && this.cool + 1000000 <= coolMax) + { + this.slots[31].stackSize--; + this.cool += 1000000; + if(this.slots[31].stackSize == 0) + { + this.slots[31] = this.slots[31].getItem().getContainerItem(this.slots[31]); + } + } + + + if(slots[33] != null && slots[33].getItem() == ModItems.fuse) + { + for(int i = 0; i < 30; i++) + { + if(slots[i] != null && slots[i].getItem() == ModItems.rod_uranium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(1); + attemptPower(10); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_uranium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_dual_uranium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(1); + attemptPower(10); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_dual_uranium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_quad_uranium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(1); + attemptPower(10); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_quad_uranium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_plutonium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(2); + attemptPower(15); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_plutonium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_dual_plutonium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(2); + attemptPower(15); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_dual_plutonium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_quad_plutonium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(2); + attemptPower(15); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_quad_plutonium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_mox_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(1); + attemptPower(5); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_mox_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_dual_mox_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(1); + attemptPower(5); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_dual_mox_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_quad_mox_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(1); + attemptPower(5); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_quad_mox_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_schrabidium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(10); + attemptPower(25); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_schrabidium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_dual_schrabidium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(10); + attemptPower(25); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_dual_schrabidium_fuel_depleted); + } + } + if(slots[i] != null && slots[i].getItem() == ModItems.rod_quad_schrabidium_fuel) + { + int j = slots[i].getItemDamage(); + this.slots[i].setItemDamage(j += 1); + attemptHeat(10); + attemptPower(25); + + if(this.slots[i].getItemDamage() == this.slots[i].getMaxDamage()) + { + this.slots[i] = new ItemStack(ModItems.rod_quad_schrabidium_fuel_depleted); + } + } + } + } + + if(this.power > maxPower) + { + this.power = maxPower; + } + + if(this.heat > heatMax) + { + this.explode(); + } + + if(((slots[0] != null && slots[0].getItem() instanceof ItemFuelRod) || slots[0] == null) && + ((slots[1] != null && !(slots[1].getItem() instanceof ItemFuelRod)) || slots[1] == null) && + ((slots[2] != null && !(slots[2].getItem() instanceof ItemFuelRod)) || slots[2] == null) && + ((slots[3] != null && !(slots[3].getItem() instanceof ItemFuelRod)) || slots[3] == null) && + ((slots[4] != null && !(slots[4].getItem() instanceof ItemFuelRod)) || slots[4] == null) && + ((slots[5] != null && !(slots[5].getItem() instanceof ItemFuelRod)) || slots[5] == null) && + ((slots[6] != null && !(slots[6].getItem() instanceof ItemFuelRod)) || slots[6] == null) && + ((slots[7] != null && !(slots[7].getItem() instanceof ItemFuelRod)) || slots[7] == null) && + ((slots[8] != null && !(slots[8].getItem() instanceof ItemFuelRod)) || slots[8] == null) && + ((slots[9] != null && !(slots[9].getItem() instanceof ItemFuelRod)) || slots[9] == null) && + ((slots[10] != null && !(slots[10].getItem() instanceof ItemFuelRod)) || slots[10] == null) && + ((slots[11] != null && !(slots[11].getItem() instanceof ItemFuelRod)) || slots[11] == null) && + ((slots[12] != null && !(slots[12].getItem() instanceof ItemFuelRod)) || slots[12] == null) && + ((slots[13] != null && !(slots[13].getItem() instanceof ItemFuelRod)) || slots[13] == null) && + ((slots[14] != null && !(slots[14].getItem() instanceof ItemFuelRod)) || slots[14] == null) && + ((slots[15] != null && !(slots[15].getItem() instanceof ItemFuelRod)) || slots[15] == null) && + ((slots[16] != null && !(slots[16].getItem() instanceof ItemFuelRod)) || slots[16] == null) && + ((slots[17] != null && !(slots[17].getItem() instanceof ItemFuelRod)) || slots[17] == null) && + ((slots[18] != null && !(slots[18].getItem() instanceof ItemFuelRod)) || slots[18] == null) && + ((slots[19] != null && !(slots[19].getItem() instanceof ItemFuelRod)) || slots[19] == null) && + ((slots[20] != null && !(slots[20].getItem() instanceof ItemFuelRod)) || slots[20] == null) && + ((slots[21] != null && !(slots[21].getItem() instanceof ItemFuelRod)) || slots[21] == null) && + ((slots[22] != null && !(slots[22].getItem() instanceof ItemFuelRod)) || slots[22] == null) && + ((slots[23] != null && !(slots[23].getItem() instanceof ItemFuelRod)) || slots[23] == null) && + ((slots[24] != null && !(slots[24].getItem() instanceof ItemFuelRod)) || slots[24] == null) && + ((slots[25] != null && !(slots[25].getItem() instanceof ItemFuelRod)) || slots[25] == null) && + ((slots[26] != null && !(slots[26].getItem() instanceof ItemFuelRod)) || slots[26] == null) && + ((slots[27] != null && !(slots[27].getItem() instanceof ItemFuelRod)) || slots[27] == null) && + ((slots[28] != null && !(slots[28].getItem() instanceof ItemFuelRod)) || slots[28] == null) && + ((slots[29] != null && !(slots[29].getItem() instanceof ItemFuelRod)) || slots[29] == null)) + { + if(this.heat - 10 >= 0 && this.cool - 10 >= 0) + { + this.heat -= 10; + this.cool -= 10; + } + + if(this.heat < 10 && this.cool != 0) + { + this.heat--; + this.cool--; + } + + if(this.heat != 0 && this.cool == 0) + { + this.heat--; + } + + if(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord) instanceof MachineGenerator) + isLoaded = false; + + } else { + + if(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord) instanceof MachineGenerator) + isLoaded = true; + + if(!this.isCoatingValid(worldObj)) + { + int strength = 20; + float f = strength; + HashSet hashset = new HashSet(); + int i; + int j; + int k; + double d5; + double d6; + double d7; + double wat = 20; + boolean isOccupied = false; + + i = MathHelper.floor_double(this.xCoord - wat - 1.0D); + j = MathHelper.floor_double(this.xCoord + wat + 1.0D); + k = MathHelper.floor_double(this.yCoord - wat - 1.0D); + int i2 = MathHelper.floor_double(this.yCoord + wat + 1.0D); + int l = MathHelper.floor_double(this.zCoord - wat - 1.0D); + int j2 = MathHelper.floor_double(this.zCoord + wat + 1.0D); + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2)); + Vec3 vec3 = Vec3.createVectorHelper(this.xCoord, this.yCoord, this.zCoord); + + for (int i1 = 0; i1 < list.size(); ++i1) + { + Entity entity = (Entity)list.get(i1); + double d4 = entity.getDistance(this.xCoord, this.yCoord, this.zCoord) / 4; + + if (d4 <= 20) + { + d5 = entity.posX - this.xCoord; + d6 = entity.posY + entity.getEyeHeight() - this.yCoord; + d7 = entity.posZ - this.zCoord; + double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); + if (d9 < wat) + { + if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity)) + { + /*Library.damageSuit(((EntityPlayer)entity), 0); + Library.damageSuit(((EntityPlayer)entity), 1); + Library.damageSuit(((EntityPlayer)entity), 2); + Library.damageSuit(((EntityPlayer)entity), 3);*/ + + } else if(entity instanceof EntityCreeper) { + EntityNuclearCreeper creep = new EntityNuclearCreeper(this.worldObj); + creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); + //creep.setRotationYawHead(((EntityCreeper)entity).rotationYawHead); + if(!entity.isDead) + if(!worldObj.isRemote) + worldObj.spawnEntityInWorld(creep); + entity.setDead(); + } else if(entity instanceof EntityLivingBase && !(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom)) + { + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 2 * 60 * 20, 2)); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.getId(), 20, 4)); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 1 * 60 * 20, 1)); + } + } + } + } + } + } + + //Batteries + if(power - 100 >= 0 && slots[32] != null && slots[32].getItem() == ModItems.battery_generic && slots[32].getItemDamage() > 0) + { + power -= 100; + slots[32].setItemDamage(slots[32].getItemDamage() - 1); + } + if(power - 100 >= 0 && slots[32] != null && slots[32].getItem() == ModItems.battery_advanced && slots[32].getItemDamage() > 0) + { + power -= 100; + slots[32].setItemDamage(slots[32].getItemDamage() - 1); + } + if(power - 100 >= 0 && slots[32] != null && slots[32].getItem() == ModItems.battery_schrabidium && slots[32].getItemDamage() > 0) + { + power -= 100; + slots[32].setItemDamage(slots[32].getItemDamage() - 1); + } + if(power - 100 >= 0 && slots[32] != null && slots[32].getItem() == ModItems.factory_core_titanium && slots[32].getItemDamage() > 0) + { + power -= 100; + slots[32].setItemDamage(slots[32].getItemDamage() - 1); + } + if(power - 100 >= 0 && slots[32] != null && slots[32].getItem() == ModItems.factory_core_advanced && slots[32].getItemDamage() > 0) + { + power -= 100; + slots[32].setItemDamage(slots[32].getItemDamage() - 1); + } + } + } + + } + + @Override + public boolean isStructureValid(World world) { + if(world.getBlock(this.xCoord, this.yCoord, this.zCoord) == ModBlocks.reactor_computer && + world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) == ModBlocks.reactor_conductor && + world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord) == ModBlocks.reactor_conductor && + world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord) == ModBlocks.reactor_control && + world.getBlock(this.xCoord + 1, this.yCoord + 0, this.zCoord) == ModBlocks.reactor_control && + world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord) == ModBlocks.reactor_control && + world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord) == ModBlocks.reactor_control && + world.getBlock(this.xCoord - 1, this.yCoord + 0, this.zCoord) == ModBlocks.reactor_control && + world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord) == ModBlocks.reactor_control && + world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord + 1) == ModBlocks.reactor_control && + world.getBlock(this.xCoord, this.yCoord + 0, this.zCoord + 1) == ModBlocks.reactor_control && + world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord + 1) == ModBlocks.reactor_control && + world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord - 1) == ModBlocks.reactor_control && + world.getBlock(this.xCoord, this.yCoord + 0, this.zCoord - 1) == ModBlocks.reactor_control && + world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord - 1) == ModBlocks.reactor_control && + world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord + 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord + 1, this.yCoord + 0, this.zCoord + 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord + 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord - 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord + 1, this.yCoord + 0, this.zCoord - 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord - 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord - 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord - 1, this.yCoord + 0, this.zCoord - 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord - 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord + 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord - 1, this.yCoord + 0, this.zCoord + 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord + 1) == ModBlocks.reactor_element && + world.getBlock(this.xCoord + 2, this.yCoord, this.zCoord) == ModBlocks.reactor_hatch && + world.getBlock(this.xCoord - 2, this.yCoord, this.zCoord) == ModBlocks.reactor_hatch && + world.getBlock(this.xCoord, this.yCoord, this.zCoord + 2) == ModBlocks.reactor_hatch && + world.getBlock(this.xCoord, this.yCoord, this.zCoord - 2) == ModBlocks.reactor_hatch) + { + return true; + } + return false; + } + + @Override + public boolean isCoatingValid(World world) { + if(world.getBlock(this.xCoord - 1, this.yCoord + 2, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord + 2, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord + 2, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord + 2, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord + 2, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord + 2, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord + 2, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord + 2, this.zCoord + 1)== ModBlocks.brick_concrete && + + world.getBlock(this.xCoord + 1, this.yCoord - 2, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord - 2, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord - 2, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord - 2, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord - 2, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord - 2, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord - 2, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord - 2, this.zCoord - 1)== ModBlocks.brick_concrete && + + world.getBlock(this.xCoord + 2, this.yCoord - 1, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 2, this.yCoord - 1, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 2, this.yCoord - 1, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 2, this.yCoord, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 2, this.yCoord, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 2, this.yCoord + 1, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 2, this.yCoord + 1, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 2, this.yCoord + 1, this.zCoord - 1)== ModBlocks.brick_concrete && + + world.getBlock(this.xCoord - 2, this.yCoord - 1, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 2, this.yCoord - 1, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 2, this.yCoord - 1, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 2, this.yCoord, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 2, this.yCoord, this.zCoord - 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 2, this.yCoord + 1, this.zCoord + 1)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 2, this.yCoord + 1, this.zCoord)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 2, this.yCoord + 1, this.zCoord - 1)== ModBlocks.brick_concrete && + + world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord + 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord + 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord + 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord + 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord + 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord + 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord + 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord + 2)== ModBlocks.brick_concrete && + + world.getBlock(this.xCoord + 1, this.yCoord - 1, this.zCoord - 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord - 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord - 1, this.zCoord - 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord - 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord - 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord + 1, this.yCoord + 1, this.zCoord - 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord - 2)== ModBlocks.brick_concrete && + world.getBlock(this.xCoord - 1, this.yCoord + 1, this.zCoord - 2)== ModBlocks.brick_concrete) + { + return true; + } + return false; + } + + @Override + public int getWaterScaled(int i) { + return (water * i) / waterMax; + } + + @Override + public int getCoolantScaled(int i) { + return (cool * i) / coolMax; + } + + @Override + public int getPowerScaled(int i) { + return (power * i) / maxPower; + } + + @Override + public int getHeatScaled(int i) { + return (heat * i) / heatMax; + } + + @Override + public boolean hasFuse() { + return false; + } + + public void attemptPower(int i) { + if(this.water - i >= 0) + { + this.power += i; + this.water -= i; + } + } + + public void attemptHeat(int i) { + Random rand = new Random(); + + int j = rand.nextInt(i); + + if(this.cool - j >= 0) + { + this.cool -= j; + } else { + this.heat += i; + } + } + + public void explode() { + for(int i = 0; i < slots.length; i++) + { + this.slots[i] = null; + } + + EntityNukeExplosionAdvanced explosion = new EntityNukeExplosionAdvanced(this.worldObj); + explosion.speed = 25; + explosion.coefficient = 5.0F; + explosion.destructionRange = 35; + explosion.posX = this.xCoord; + explosion.posY = this.yCoord; + explosion.posZ = this.zCoord; + this.worldObj.spawnEntityInWorld(explosion); + ExplosionParticle.spawnMush(this.worldObj, (int)this.xCoord, (int)this.yCoord - 3, (int)this.zCoord); + } +} diff --git a/com/hbm/gui/ContainerGenerator.java b/com/hbm/gui/ContainerGenerator.java index cd0ded636..121dfa201 100644 --- a/com/hbm/gui/ContainerGenerator.java +++ b/com/hbm/gui/ContainerGenerator.java @@ -123,5 +123,4 @@ public class ContainerGenerator extends Container { diFurnace.heat = j; } } - } diff --git a/com/hbm/gui/ContainerReactorMultiblock.java b/com/hbm/gui/ContainerReactorMultiblock.java new file mode 100644 index 000000000..4722cd537 --- /dev/null +++ b/com/hbm/gui/ContainerReactorMultiblock.java @@ -0,0 +1,153 @@ +package com.hbm.gui; + +import com.hbm.blocks.TileEntityMachineGenerator; +import com.hbm.blocks.TileEntityReactorMultiblock; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerReactorMultiblock extends Container { + + private TileEntityReactorMultiblock diFurnace; + + private int water; + private int cool; + private int power; + private int heat; + + public ContainerReactorMultiblock(InventoryPlayer invPlayer, TileEntityReactorMultiblock tedf) { + + diFurnace = tedf; + + this.addSlotToContainer(new Slot(tedf, 0, 62, 18)); + this.addSlotToContainer(new Slot(tedf, 1, 80, 18)); + this.addSlotToContainer(new Slot(tedf, 2, 98, 18)); + this.addSlotToContainer(new Slot(tedf, 3, 116, 18)); + this.addSlotToContainer(new Slot(tedf, 4, 134, 18)); + this.addSlotToContainer(new Slot(tedf, 5, 152, 18)); + this.addSlotToContainer(new Slot(tedf, 6, 62, 36)); + this.addSlotToContainer(new Slot(tedf, 7, 80, 36)); + this.addSlotToContainer(new Slot(tedf, 8, 98, 36)); + this.addSlotToContainer(new Slot(tedf, 9, 116, 36)); + this.addSlotToContainer(new Slot(tedf, 10, 134, 36)); + this.addSlotToContainer(new Slot(tedf, 11, 152, 36)); + this.addSlotToContainer(new Slot(tedf, 12, 62, 54)); + this.addSlotToContainer(new Slot(tedf, 13, 80, 54)); + this.addSlotToContainer(new Slot(tedf, 14, 98, 54)); + this.addSlotToContainer(new Slot(tedf, 15, 116, 54)); + this.addSlotToContainer(new Slot(tedf, 16, 134, 54)); + this.addSlotToContainer(new Slot(tedf, 17, 152, 54)); + this.addSlotToContainer(new Slot(tedf, 18, 62, 72)); + this.addSlotToContainer(new Slot(tedf, 19, 80, 72)); + this.addSlotToContainer(new Slot(tedf, 20, 98, 72)); + this.addSlotToContainer(new Slot(tedf, 21, 116, 72)); + this.addSlotToContainer(new Slot(tedf, 22, 134, 72)); + this.addSlotToContainer(new Slot(tedf, 23, 152, 72)); + this.addSlotToContainer(new Slot(tedf, 24, 62, 90)); + this.addSlotToContainer(new Slot(tedf, 25, 80, 90)); + this.addSlotToContainer(new Slot(tedf, 26, 98, 90)); + this.addSlotToContainer(new Slot(tedf, 27, 116, 90)); + this.addSlotToContainer(new Slot(tedf, 28, 134, 90)); + this.addSlotToContainer(new Slot(tedf, 29, 152, 90)); + //Water + this.addSlotToContainer(new Slot(tedf, 30, 8, 90)); + //Coolant + this.addSlotToContainer(new Slot(tedf, 31, 26, 90)); + //Batteries + this.addSlotToContainer(new Slot(tedf, 32, 44, 90)); + //Fuse + this.addSlotToContainer(new Slot(tedf, 33, 8, 108)); + + for(int i = 0; i < 3; i++) + { + for(int j = 0; j < 9; j++) + { + this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18 + 56)); + } + } + + for(int i = 0; i < 9; i++) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting crafting) { + super.addCraftingToCrafters(crafting); + crafting.sendProgressBarUpdate(this, 0, this.diFurnace.water); + crafting.sendProgressBarUpdate(this, 1, this.diFurnace.cool); + crafting.sendProgressBarUpdate(this, 2, this.diFurnace.power); + crafting.sendProgressBarUpdate(this, 3, this.diFurnace.heat); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + return null; + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return diFurnace.isUseableByPlayer(player); + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for(int i = 0; i < this.crafters.size(); i++) + { + ICrafting par1 = (ICrafting)this.crafters.get(i); + + if(this.water != this.diFurnace.water) + { + par1.sendProgressBarUpdate(this, 0, this.diFurnace.water); + } + + if(this.cool != this.diFurnace.cool) + { + par1.sendProgressBarUpdate(this, 1, this.diFurnace.cool); + } + + if(this.power != this.diFurnace.power) + { + par1.sendProgressBarUpdate(this, 2, this.diFurnace.power); + } + + if(this.heat != this.diFurnace.heat) + { + par1.sendProgressBarUpdate(this, 3, this.diFurnace.heat); + } + } + + this.water = this.diFurnace.water; + this.cool = this.diFurnace.cool; + this.power = this.diFurnace.power; + this.heat = this.diFurnace.heat; + } + + @Override + public void updateProgressBar(int i, int j) { + if(i == 0) + { + diFurnace.water = j; + } + if(i == 1) + { + diFurnace.cool = j; + } + if(i == 2) + { + diFurnace.power = j; + } + if(i == 3) + { + diFurnace.heat = j; + } + } +} diff --git a/com/hbm/gui/GUIReactorMultiblock.java b/com/hbm/gui/GUIReactorMultiblock.java new file mode 100644 index 000000000..07a064ff8 --- /dev/null +++ b/com/hbm/gui/GUIReactorMultiblock.java @@ -0,0 +1,56 @@ +package com.hbm.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.blocks.TileEntityMachineGenerator; +import com.hbm.blocks.TileEntityReactorMultiblock; +import com.hbm.blocks.TileEntityRtgFurnace; +import com.hbm.lib.RefStrings; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.util.ResourceLocation; + +public class GUIReactorMultiblock extends GuiContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_reactor_multiblock.png"); + private TileEntityReactorMultiblock diFurnace; + + public GUIReactorMultiblock(InventoryPlayer invPlayer, TileEntityReactorMultiblock tedf) { + super(new ContainerReactorMultiblock(invPlayer, tedf)); + diFurnace = tedf; + + this.xSize = 176; + this.ySize = 222; + } + + @Override + protected void drawGuiContainerForegroundLayer(int i, int j) { + String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName()); + + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + int i = diFurnace.getWaterScaled(70); + drawTexturedModalRect(guiLeft + 8, guiTop + 88 - i, 176, 70 - i, 16, i); + + int j = diFurnace.getCoolantScaled(70); + drawTexturedModalRect(guiLeft + 26, guiTop + 88 - j, 192, 70 - j, 16, j); + + int k = diFurnace.getPowerScaled(70); + drawTexturedModalRect(guiLeft + 44, guiTop + 88 - k, 208, 70 - k, 16, k); + + int l = diFurnace.getHeatScaled(124); + drawTexturedModalRect(guiLeft + 26, guiTop + 108, 0, 222, l, 16); + } +} diff --git a/com/hbm/interfaces/IReactor.java b/com/hbm/interfaces/IReactor.java new file mode 100644 index 000000000..86aa589ac --- /dev/null +++ b/com/hbm/interfaces/IReactor.java @@ -0,0 +1,21 @@ +package com.hbm.interfaces; + +import net.minecraft.world.World; + +public interface IReactor { + + boolean isStructureValid(World world); + + boolean isCoatingValid(World world); + + boolean hasFuse(); + + int getWaterScaled(int i); + + int getCoolantScaled(int i); + + int getPowerScaled(int i); + + int getHeatScaled(int i); + +} diff --git a/com/hbm/items/ItemCustomLore.java b/com/hbm/items/ItemCustomLore.java index ea57812af..7224564bb 100644 --- a/com/hbm/items/ItemCustomLore.java +++ b/com/hbm/items/ItemCustomLore.java @@ -289,6 +289,16 @@ public class ItemCustomLore extends Item { list.add("and some shards are missing."); list.add("It stopped ticking at 2:34."); } + + if(this == ModItems.fuse) + { + list.add("This item is needed for every large"); + list.add("nuclear reactor, as it allows the"); + list.add("reactor to generate electricity and"); + list.add("use up it's fuel. Removing the fuse"); + list.add("from a reactor will instantly shut"); + list.add("it down."); + } } @Override diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 821f6806a..c7a9918fd 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -356,6 +356,7 @@ public class ModItems { public static Item battery_creative; public static Item fusion_core; + public static Item fuse; public static Item factory_core_titanium; public static Item factory_core_advanced; @@ -765,6 +766,7 @@ public class ModItems { battery_creative = new Item().setUnlocalizedName("battery_creative").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":battery_creative"); fusion_core = new ItemBattery(5000).setUnlocalizedName("fusion_core").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fusion_core"); + fuse = new ItemCustomLore().setUnlocalizedName("fuse").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fuse"); factory_core_titanium = new ItemBattery(70400).setUnlocalizedName("factory_core_titanium").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_titanium"); factory_core_advanced = new ItemBattery(41600).setUnlocalizedName("factory_core_advanced").setMaxStackSize(1).setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":factory_core_advanced"); @@ -1024,6 +1026,7 @@ public class ModItems { GameRegistry.registerItem(fusion_core, fusion_core.getUnlocalizedName()); GameRegistry.registerItem(factory_core_titanium, factory_core_titanium.getUnlocalizedName()); GameRegistry.registerItem(factory_core_advanced, factory_core_advanced.getUnlocalizedName()); + GameRegistry.registerItem(fuse, fuse.getUnlocalizedName()); //Fuelrods GameRegistry.registerItem(rod_empty, rod_empty.getUnlocalizedName()); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index dd41ab560..e1fff6b2e 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -333,7 +333,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_rtg_furnace_off), 1), new Object[] { "NNN", "NFN", "UUU", 'N', ModItems.neutron_reflector, 'U', ModItems.rtg_unit, 'F', Item.getItemFromBlock(Blocks.furnace) }); GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 1), new Object[] { "BBB", "WFW", "RRR", 'B', ModItems.ingot_beryllium, 'R', ModItems.coil_tungsten, 'W', ModItems.wire_red_copper, 'F', Item.getItemFromBlock(Blocks.furnace) }); GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_generator), 1), new Object[] { "SLS", "LCL", "SLS", 'C', ModItems.circuit_red_copper, 'L', ModItems.rod_quad_lead, 'S', ModItems.ingot_steel }); - GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_wire_coated), 16), new Object[] { "WRW", "RIR", "WRW", 'W', ModItems.ingot_tungsten, 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper }); + //GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.red_wire_coated), 16), new Object[] { "WRW", "RIR", "WRW", 'W', ModItems.ingot_tungsten, 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper }); GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_deuterium), 1), new Object[] { "TIT", "RFR", "CCC", 'T', ModItems.tank_steel, 'I', ModItems.ingot_titanium, 'R', ModItems.wire_red_copper, 'F', Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 'C', ModItems.coil_tungsten }); GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TST", "RIR", "TLT", 'T', ModItems.ingot_tungsten, 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper, 'S', Item.getItemFromBlock(ModBlocks.block_sulfur), 'L', Item.getItemFromBlock(ModBlocks.block_lead) }); GameRegistry.addRecipe(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 1), new Object[] { "TLT", "RIR", "TST", 'T', ModItems.ingot_tungsten, 'I', ModItems.ingot_red_copper, 'R', ModItems.wire_red_copper, 'S', Item.getItemFromBlock(ModBlocks.block_sulfur), 'L', Item.getItemFromBlock(ModBlocks.block_lead) }); diff --git a/com/hbm/main/GUIHandler.java b/com/hbm/main/GUIHandler.java index cddf79538..185f4241e 100644 --- a/com/hbm/main/GUIHandler.java +++ b/com/hbm/main/GUIHandler.java @@ -23,6 +23,7 @@ import com.hbm.blocks.TileEntityNukeMan; import com.hbm.blocks.TileEntityNukeMike; import com.hbm.blocks.TileEntityNukePrototype; import com.hbm.blocks.TileEntityNukeTsar; +import com.hbm.blocks.TileEntityReactorMultiblock; import com.hbm.blocks.TileEntityRtgFurnace; import com.hbm.blocks.TileEntityTestNuke; import com.hbm.gui.ContainerBombMulti; @@ -46,6 +47,7 @@ import com.hbm.gui.ContainerNukePrototype; import com.hbm.gui.ContainerNukeTsar; import com.hbm.gui.ContainerPuF6Tank; import com.hbm.gui.ContainerReactor; +import com.hbm.gui.ContainerReactorMultiblock; import com.hbm.gui.ContainerRtgFurnace; import com.hbm.gui.ContainerTestNuke; import com.hbm.gui.ContainerUF6Tank; @@ -70,6 +72,7 @@ import com.hbm.gui.GUINukeMan; import com.hbm.gui.GUINukeMike; import com.hbm.gui.GUINukePrototype; import com.hbm.gui.GUINukeTsar; +import com.hbm.gui.GUIReactorMultiblock; import com.hbm.gui.GUIRtgFurnace; import com.hbm.gui.GUITestDiFurnace; import com.hbm.gui.GUITestNuke; @@ -279,6 +282,14 @@ public class GUIHandler implements IGuiHandler { return new ContainerCoreAdvanced(player.inventory, (TileEntityCoreAdvanced) entity); } } + + case ModBlocks.guiID_reactor_multiblock: + { + if(entity instanceof TileEntityReactorMultiblock) + { + return new ContainerReactorMultiblock(player.inventory, (TileEntityReactorMultiblock) entity); + } + } } return null; } @@ -483,6 +494,14 @@ public class GUIHandler implements IGuiHandler { return new GUICoreAdvanced(player.inventory, (TileEntityCoreAdvanced) entity); } } + + case ModBlocks.guiID_reactor_multiblock: + { + if(entity instanceof TileEntityReactorMultiblock) + { + return new GUIReactorMultiblock(player.inventory, (TileEntityReactorMultiblock) entity); + } + } } } return null; diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index 352466660..aeef6ad84 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -46,6 +46,7 @@ import com.hbm.blocks.TileEntityNukeMike; import com.hbm.blocks.TileEntityNukePrototype; import com.hbm.blocks.TileEntityNukeTsar; import com.hbm.blocks.TileEntityObjTester; +import com.hbm.blocks.TileEntityReactorMultiblock; import com.hbm.blocks.TileEntityRedBarrel; import com.hbm.blocks.TileEntityRotationTester; import com.hbm.blocks.TileEntityRtgFurnace; @@ -204,6 +205,7 @@ public class MainRegistry GameRegistry.registerTileEntity(TileEntityDecoBlock.class, "tileentity_deco"); GameRegistry.registerTileEntity(TileEntityCoreTitanium.class, "tileentity_core_titanium"); GameRegistry.registerTileEntity(TileEntityCoreAdvanced.class, "tileentity_core_advanced"); + GameRegistry.registerTileEntity(TileEntityReactorMultiblock.class, "tileentity_reactor_multiblock"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);