From 35c344f534cf1dfd30db9e9b2bb53944104d7dbd Mon Sep 17 00:00:00 2001 From: HbmMods Date: Wed, 19 Dec 2018 21:50:21 +0100 Subject: [PATCH] turbine bugg, reactor remote control, bullet stamp recipes --- assets/hbm/lang/de_DE.lang | 3 + assets/hbm/lang/en_US.lang | 7 +- .../textures/blocks/machine_controller.png | Bin 0 -> 394 bytes .../blocks/machine_controller_back.png | Bin 0 -> 393 bytes .../blocks/machine_controller_side.png | Bin 0 -> 355 bytes .../blocks/machine_controller_top.png | Bin 0 -> 346 bytes .../hbm/textures/gui/gui_reactor_control.png | Bin 3596 -> 3553 bytes assets/hbm/textures/items/reactor_sensor.png | Bin 0 -> 235 bytes com/hbm/blocks/ModBlocks.java | 2 +- .../blocks/machine/MachineReactorControl.java | 185 ++++++++++++++++++ com/hbm/blocks/machine/MachineRtgFurnace.java | 3 +- com/hbm/inventory/gui/GUIReactorControl.java | 58 +++++- com/hbm/items/ModItems.java | 3 + com/hbm/items/tool/ItemReactorSensor.java | 55 ++++++ com/hbm/main/CraftingManager.java | 11 ++ com/hbm/packet/AuxButtonPacket.java | 22 ++- .../machine/TileEntityMachineTurbine.java | 18 +- .../machine/TileEntityReactorControl.java | 36 +++- 18 files changed, 384 insertions(+), 19 deletions(-) create mode 100644 assets/hbm/textures/blocks/machine_controller.png create mode 100644 assets/hbm/textures/blocks/machine_controller_back.png create mode 100644 assets/hbm/textures/blocks/machine_controller_side.png create mode 100644 assets/hbm/textures/blocks/machine_controller_top.png create mode 100644 assets/hbm/textures/items/reactor_sensor.png create mode 100644 com/hbm/items/tool/ItemReactorSensor.java diff --git a/assets/hbm/lang/de_DE.lang b/assets/hbm/lang/de_DE.lang index 97cf58d78..0112c90bf 100644 --- a/assets/hbm/lang/de_DE.lang +++ b/assets/hbm/lang/de_DE.lang @@ -413,6 +413,8 @@ tile.machine_selenium.name=Hochleistungs-Sternmotor container.machineSelenium=Hochleistungs-Sternmotor tile.machine_reactor_small.name=Atomreaktor container.reactorSmall=Atomreaktor +tile.machine_controller.name=Reaktorfernsteuerung +container.reactorControl=Reaktorfernsteuerung tile.broadcaster_pc.name=Korrupter Sender @@ -1822,6 +1824,7 @@ item.crystal_energy.name=Energiekristall item.pellet_coolant.name=Kühlcluster item.linker.name=Telelinker +item.reactor_sensor.name=Reaktor-Fernsensor item.oil_detector.name=Ölvorkommen-Detektor item.geiger_counter.name=Mobiler Geigerzähler tile.geiger.name=Geigerzähler diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 0485935b0..0cdbde8dd 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -322,8 +322,8 @@ container.puf6_tank=PuF6 Tank tile.machine_reactor.name=Breeding Reactor tile.machine_reactor_on.name=Breeding Reactor container.reactor=Breeding Reactor -tile.machine_nuke_furnace_off.name=Nuclear Powered Furnace -tile.machine_nuke_furnace_on.name=Nuclear Powered Furnace +tile.machine_nuke_furnace_off.name=Nuclear Furnace +tile.machine_nuke_furnace_on.name=Nuclear Furnace container.nukeFurnace=Nuclear Powered Furnace tile.machine_rtg_furnace_off.name=RTG Furnace tile.machine_rtg_furnace_on.name=RTG Furnace @@ -413,6 +413,8 @@ tile.machine_selenium.name=Radial Performance Engine container.machineSelenium=Radial Performance Engine tile.machine_reactor_small.name=Nuclear Reactor container.reactorSmall=Nuclear Reactor +tile.machine_controller.name=Reactor Remote Control Block +container.reactorControl=Reactor Remote Control Block tile.broadcaster_pc.name=Corrupted Broadcaster @@ -1822,6 +1824,7 @@ item.crystal_energy.name=Energy Crystal item.pellet_coolant.name=Coolant Cluster item.linker.name=Telelinker +item.reactor_sensor.name=Reactor Remote Sensor item.oil_detector.name=Oil Reservoir Detector item.geiger_counter.name=Handheld Geiger Counter tile.geiger.name=Geiger Counter diff --git a/assets/hbm/textures/blocks/machine_controller.png b/assets/hbm/textures/blocks/machine_controller.png new file mode 100644 index 0000000000000000000000000000000000000000..9b642494b447bfbf83a0dbec6be542060bd749a9 GIT binary patch literal 394 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJtM=93Yk-Zihg;zIEGmG_fE3qYYGr((X{DRY~j99z-+CZoa>b7p5*TAq@mFv@HlZ# z*Y^*PdHMdS`6U?Je0zU3Z_4w^K#?2H3^E-rTsA}>>EHK$PCJv!!ljEgJcU&Eni z3@<;w=Cf<}SREMlQe*18#GNG;+gr?Unfex=-Lz`eyth@wPgqtr_Gkq%s%_-;UGUn< z*DZM_^A#b{uuQLg=F!tsMLA}tT$P>k^0V5#2F(M;_0e2YL-l_B+*GrLmdKI;Vst07AN&F8}}l literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/machine_controller_back.png b/assets/hbm/textures/blocks/machine_controller_back.png new file mode 100644 index 0000000000000000000000000000000000000000..6c37af1254b1c5362b53da07f19ac10cfcec9e5b GIT binary patch literal 393 zcmV;40e1e0P)DWyN z4Aw}0=KqoY$Nhf)%sEp^A*BRBj1hoZD=|iDt=QPM4Z--FGndPSWm!0%&j7U62qEY{ zKnOwe>$)n&mr_`kg;I)wy!QY&=k$}c_a2M!IcM!GApl#<=C9W)0FTE5FZ!hW7=tm! zpF*~X$N})8Q|MXB|3&Ye)*3NJ{Bd)Pfpbn-*!)ovfR8aMeS6RrdB;jH?g$ha7ASkY zcRi~!kRdwfcs`%IE-57i3&3`-wSG%zt&vh16qj{toLZJ7~JkR8u*|u$Orq}DG13Q|@ nGO(DPnZ&*}j#iE_?#%QBcDmT-r0*kq00000NkvXXu0mjfK3uVZ literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/machine_controller_side.png b/assets/hbm/textures/blocks/machine_controller_side.png new file mode 100644 index 0000000000000000000000000000000000000000..85afb71475b2dd544b5009979237c81e2fa95a5f GIT binary patch literal 355 zcmV-p0i6DcP)~lD!MH7uS;_p2 zW@K`@-|t`ZJkwg^bUFdx?f~@Oad&#}WUT9oddfV{+-^5|@6=iW*tYHM3{Y#0_%uxb zEXzV^t+6ai-1vzCsdX40Nw`Zv4@pw?guA)*3V+;V!=QBr`S=a$6Vl*>KDVP~% z_Ny^t-*>ic!`)v58Dk90EL7yU6lN56fAgrqO!Aj1_1LjdHgcnK`@TnQyn!B3O=FC( zA?SRR-+Ra0J=j#7A2Sml3E}52)LNrJ3XX+}i#&dNmLw$_lXsyLMe*=(O%|D1@QWgLJ002ovPDHLkV1l|` Bn{EIA literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/machine_controller_top.png b/assets/hbm/textures/blocks/machine_controller_top.png new file mode 100644 index 0000000000000000000000000000000000000000..9a395535bd5caa991f2b7ca779562a6c5210ed3e GIT binary patch literal 346 zcmV-g0j2(lP)r+ahwZ?HA0H`VeV+>T4F$U3k?^sSMrEs3-BjCPoa?b7pe_V@Q?GMOwb zTbh=;cu_<|qLUNnc8Sx6IkqdZzc!%&pjYfEy2Z5IJQ+pK64RVIeE#|8lcx_8wkxy0 ze}@(RraDmopcYex6ae%{>a^U+$+<3hJbMstmpFZxuwB{x)h%nlF9`(zy^=aDmy(F7 z(}y{>E4sh7pa1|pVUPUh=@Bpu2q;Dm0KJhpEqC{>h=@en+m*J9XAd%`4;}k!6AA!& z#W^iEPeu`0dR}I`_4Rdm{P?jP9v-@Zv(06%{mPTEL&7>23Saj|H7xl0~C^^~{m5~mNX?d}}!EPW2Yf2=#l z?|O+7;}igy;+{^N%=YiDWkutbv9-08`%`!3xw!A`;_1U6t^~4o_Tt{&x%JEX`){h9 zF4#&JfE(6jk>eH5dB*$C+Hcw@p=>eeMau)zIp^}d9luy`E7FGXc%0a7bD3+MJaLP*rwCuY%Rcl{U7EiX*cu@nl?-DRs8t^Qm)ek#1m>GQ zZ@fIqimDRB*Fa>^*NPep2J(Sej24d6#WSn!IswM031d2vo+_)|On|++12#_6=cn_nS=qn6K%(s^bPp7x0+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#E0=kGh0{O!!0H7EJ08oqq04SC^2*_Q5iPMER z_FaMD4|fG7PUqt=I9(r30h8be9h2S&8-L@jz{Kf%9Mp%q0%PTHS73iQ1ppMI004?n z0I*Wx?mzrk6OkYYg6X|`_xQ&Jl!&LKL0oWIklGAzduQM{=~67Y5Syju6?BK^UJpj{C7A!et$>g zS>mL{2{tGQWn_La2t0WFPNmKN_L;~J2E<8=gL0S!XwpVcvqW$`^2RY0O)g(?Ow%~t#_YNId%U0NafvnxMW8Nga#LpKsv>9SxMD1O zlH+xIJ^Oi;W%ld7+UWalNs4C}9e>Y{X7g1gB@u#@WHIB&MtYnyS#g4m{K>jlHzP@l zBtM!#51=8z#ysib1u4lgJ)S*WM`AmU-Sy5ZtvyweHJCr-`0T+5T{lqx8WJZ|Qu4aG z|7l5R#;G!Q>nZ|ePXoM3+JD<^>LCh13-)9=dE+B~+EG7A9Yr9HQ=|vrYJa!6tmxk+ zViYFpIs93Z-*W9wt-kuz(y!*Zb<#O_oG5t{aBu!|B(vlVq}cW`dyJw?j9Aro)Z*X8 z^%`Rd-p~VRn3+^&Pe3-3*U7`~QIzGYM}gHr0cc5lgv~oJ=!y}ui$K|Pcvn#>v|rdm1q5oWJPl&7uvc&6<4j zN!xAcx98n2*+*~@zeT_m$2HrK)*f>j@90kcwiS_d^dDJ2>FcUw| z*n*2aTA$ROHpT=-j_2@)0?;Be*<9BNTVEIp@PRRa7MTgLG(C7+tc&YRsvL2Wia^ruX>k_Gp746o>4nS4dOk9i*+1dO zntb$8+imE#pQpc^cDb()O~gqmKv{()Z~Rfl@2G|zK;0g{rf6SIb^tk>6v8^`SDOLqQK_s=Hm?+msz gv73c 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 boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if(world.isRemote) @@ -49,4 +215,23 @@ public class MachineReactorControl extends BlockContainer { } } + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + @Override + public int getComparatorInputOverride(World world, int x, int y, int z, int p_149736_5_) + { + TileEntityReactorControl entity = (TileEntityReactorControl) world.getTileEntity(x, y, z); + + if(entity != null) + { + return (int)Math.ceil((double)entity.coreHeat * 15D / 50000D); + } + + return 0; + } + } diff --git a/com/hbm/blocks/machine/MachineRtgFurnace.java b/com/hbm/blocks/machine/MachineRtgFurnace.java index 9cb4290fe..c73d57b9f 100644 --- a/com/hbm/blocks/machine/MachineRtgFurnace.java +++ b/com/hbm/blocks/machine/MachineRtgFurnace.java @@ -9,6 +9,7 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -177,7 +178,7 @@ public class MachineRtgFurnace extends BlockContainer { { if (!keepInventory) { - TileEntityRtgFurnace tileentityfurnace = (TileEntityRtgFurnace)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + ISidedInventory tileentityfurnace = (ISidedInventory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); if (tileentityfurnace != null) { diff --git a/com/hbm/inventory/gui/GUIReactorControl.java b/com/hbm/inventory/gui/GUIReactorControl.java index ed7cfbfd2..306e15539 100644 --- a/com/hbm/inventory/gui/GUIReactorControl.java +++ b/com/hbm/inventory/gui/GUIReactorControl.java @@ -30,8 +30,46 @@ public class GUIReactorControl extends GuiInfoContainer { @Override public void drawScreen(int mouseX, int mouseY, float f) { super.drawScreen(mouseX, mouseY, f); + + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 34, 88, 4, new String[] { "Fuel: " + control.fuel + "%" }); + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 40, 88, 4, new String[] { "Water: " + control.water + "/" + control.maxWater + "mB" }); + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 46, 88, 4, new String[] { "Coolant: " + control.cool + "/" + control.maxCool + "mB" }); - this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 114, 88, 4, new String[] { "Hull Temperature:", " " + Math.round((control.hullHeat) * 0.00001 * 980 + 20) + "°C" }); + + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 7, guiTop + 16, 18, 18, new String[] { "Reactor Status: " + (control.isOn ? "ON" : "OFF") }); + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 43, guiTop + 16, 18, 18, new String[] { "Automatic Shutdown: " + (control.auto ? "ENABLED" : "DISABLED") }); + + + if(!control.isLinked) { + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 79, guiTop + 16, 18, 18, new String[] { "Reactor link not found!" }); + } + + if(control.water < control.maxWater * 0.1) { + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 79 + 18, guiTop + 16, 18, 18, new String[] { "Water level low!" }); + } + + if(control.cool < control.maxCool * 0.1) { + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 79 + 18 * 2, guiTop + 16, 18, 18, new String[] { "Coolant level low!" }); + } + + if(control.steam > control.maxSteam * 0.95) { + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 79 + 18 * 3, guiTop + 16, 18, 18, new String[] { "Steam buffer full!" }); + } + + if(control.coreHeat > (50000 * 0.85)) { + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 79 + 18 * 4, guiTop + 16, 18, 18, new String[] { "CORE TEMPERATURE CRITICAL!!" }); + } + + String s = ""; + switch(control.compression) { + case 0: s = "Steam"; break; + case 1: s = "Dense Steam"; break; + case 2: s = "Super Dense Steam"; break; + } + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 52, 88, 4, new String[] { s + ": " + control.steam + "/" + control.maxSteam + "mB" }); + + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 58, 88, 4, new String[] { "Hull Heat: " + Math.round((control.hullHeat) * 0.00001 * 980 + 20) + "°C" }); + this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 64, 88, 4, new String[] { "Core Heat: " + Math.round((control.coreHeat) * 0.00002 * 980 + 20) + "°C" }); } protected void mouseClicked(int x, int y, int i) { @@ -42,6 +80,18 @@ public class GUIReactorControl extends GuiInfoContainer { mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(control.xCoord, control.yCoord, control.zCoord, control.isOn ? 0 : 1, 0)); } + + if(guiLeft + 43 <= x && guiLeft + 43 + 18 > x && guiTop + 16 < y && guiTop + 16 + 18 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(control.xCoord, control.yCoord, control.zCoord, control.auto ? 0 : 1, 1)); + } + + if(guiLeft + 63 <= x && guiLeft + 63 + 14 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) { + + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(control.xCoord, control.yCoord, control.zCoord, (control.compression + 1) % 3, 2)); + } } @Override @@ -128,15 +178,15 @@ public class GUIReactorControl extends GuiInfoContainer { drawTexturedModalRect(guiLeft + 79 + 18 * 2, guiTop + 16, 88 + 18 * 2, 166, 18, 18); } - if(control.steam > control.maxSteam * 0.9) { + if(control.steam > control.maxSteam * 0.95) { drawTexturedModalRect(guiLeft + 79 + 18 * 3, guiTop + 16, 88 + 18 * 3, 166, 18, 18); } - if(control.coreHeat > (50000 * 0.9)) { + if(control.coreHeat > (50000 * 0.85)) { drawTexturedModalRect(guiLeft + 79 + 18 * 4, guiTop + 16, 88 + 18 * 4, 166, 18, 18); } - if(control.rods == control.maxRods) { + if(control.rods == control.maxRods && control.rods != 0) { drawTexturedModalRect(guiLeft + 25, guiTop + 16, 176, 18, 18, 18); } else if(control.rods > 0) { drawTexturedModalRect(guiLeft + 25, guiTop + 16, 194, 18, 18, 18); diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index e81db3c72..db269c781 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -706,6 +706,7 @@ public class ModItems { public static Item designator_range; public static Item designator_manual; public static Item linker; + public static Item reactor_sensor; public static Item oil_detector; public static Item geiger_counter; public static Item survey_scanner; @@ -2459,6 +2460,7 @@ public class ModItems { remote = new ItemRamManipulator().setUnlocalizedName("remote").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":remote"); chopper = new ItemChopper().setUnlocalizedName("chopper").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":chopper"); linker = new ItemTeleLink().setUnlocalizedName("linker").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":linker"); + reactor_sensor = new ItemReactorSensor().setUnlocalizedName("reactor_sensor").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":reactor_sensor"); oil_detector = new ItemOilDetector().setUnlocalizedName("oil_detector").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":oil_detector"); turret_control = new ItemTurretControl().setUnlocalizedName("turret_control").setFull3D().setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":turret_control"); turret_chip = new ItemTurretChip().setUnlocalizedName("turret_chip").setMaxStackSize(1).setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":turret_chip"); @@ -3572,6 +3574,7 @@ public class ModItems { GameRegistry.registerItem(turret_chip, turret_chip.getUnlocalizedName()); GameRegistry.registerItem(turret_biometry, turret_biometry.getUnlocalizedName()); GameRegistry.registerItem(linker, linker.getUnlocalizedName()); + GameRegistry.registerItem(reactor_sensor, reactor_sensor.getUnlocalizedName()); GameRegistry.registerItem(oil_detector, oil_detector.getUnlocalizedName()); GameRegistry.registerItem(survey_scanner, survey_scanner.getUnlocalizedName()); GameRegistry.registerItem(geiger_counter, geiger_counter.getUnlocalizedName()); diff --git a/com/hbm/items/tool/ItemReactorSensor.java b/com/hbm/items/tool/ItemReactorSensor.java new file mode 100644 index 000000000..5c619c14c --- /dev/null +++ b/com/hbm/items/tool/ItemReactorSensor.java @@ -0,0 +1,55 @@ +package com.hbm.items.tool; + +import java.util.List; + +import com.hbm.blocks.ModBlocks; +import com.hbm.tileentity.machine.TileEntityMachineTeleporter; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +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.world.World; + +public class ItemReactorSensor extends Item { + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, + float p_77648_8_, float p_77648_9_, float p_77648_10_) { + + Block b = world.getBlock(x, y, z); + + if (b == ModBlocks.machine_reactor_small || b == ModBlocks.dummy_block_reactor_small + || b == ModBlocks.dummy_port_reactor_small) { + + if (stack.stackTagCompound == null) + stack.stackTagCompound = new NBTTagCompound(); + + stack.stackTagCompound.setInteger("x", x); + stack.stackTagCompound.setInteger("y", y); + stack.stackTagCompound.setInteger("z", z); + + world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F); + + player.swingItem(); + return true; + + } + + return false; + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { + if (itemstack.stackTagCompound != null) { + list.add("x: " + itemstack.stackTagCompound.getInteger("x")); + list.add("y: " + itemstack.stackTagCompound.getInteger("y")); + list.add("z: " + itemstack.stackTagCompound.getInteger("z")); + } else { + list.add("No reactor selected!"); + } + } +} diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 3fbc339ae..119530e25 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -798,6 +798,10 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_iron, 16), new Object[] { " I", "GC", " P", 'I', "ingotIron", 'G', Items.gunpowder, 'C', ModItems.casing_357, 'P', ModItems.primer_357 })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_steel, 16), new Object[] { " I", "GC", " P", 'I', "ingotLead", 'G', Items.gunpowder, 'C', ModItems.casing_357, 'P', ModItems.primer_357 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_lead, 16), new Object[] { " I", "GC", " P", 'I', ModItems.ingot_u235, 'G', Items.gunpowder, 'C', "paneGlassColorless", 'P', ModItems.primer_357 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_lead, 16), new Object[] { " I", "GC", " P", 'I', ModItems.ingot_pu239, 'G', Items.gunpowder, 'C', "paneGlassColorless", 'P', ModItems.primer_357 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_lead, 16), new Object[] { " I", "GC", " P", 'I', ModItems.trinitite, 'G', Items.gunpowder, 'C', "paneGlassColorless", 'P', ModItems.primer_357 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_lead, 16), new Object[] { " I", "GC", " P", 'I', ModItems.nuclear_waste, 'G', Items.gunpowder, 'C', "paneGlassColorless", 'P', ModItems.primer_357 })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_gold, 16), new Object[] { " I", "GC", " P", 'I', "ingotGold", 'G', Items.gunpowder, 'C', ModItems.casing_357, 'P', ModItems.primer_357 })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_schrabidium, 16), new Object[] { " I ", "GCN", " P ", 'I', "ingotSchrabidium", 'G', Items.gunpowder, 'C', ModItems.casing_357, 'P', ModItems.primer_357, 'N', Items.nether_star })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_nightmare, 16), new Object[] { " I", "GC", " P", 'I', "ingotTungsten", 'G', Items.gunpowder, 'C', ModItems.casing_357, 'P', ModItems.primer_357 })); @@ -811,6 +815,11 @@ public class CraftingManager { GameRegistry.addRecipe(new ItemStack(ModItems.gun_revolver_nightmare2_ammo, 8), new Object[] { "I", "C", "P", 'I', ModItems.powder_power, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.assembly_calamity, 8), new Object[] { " I ", "GCG", " P ", 'I', "ingotLead", 'G', Items.gunpowder, 'C', ModItems.casing_50, 'P', ModItems.primer_50 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_357, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_357 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_44, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_44 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_9, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_9 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.stamp_50, 1), new Object[] { "RSR", "III", " C ", 'R', "dustRedstone", 'S', ModItems.stamp_iron_flat, 'I', ModItems.plate_polymer, 'C', ModItems.casing_50 })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.casing_357, 1), new Object[] { " P ", " ", "P P", 'P', "plateCopper" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.casing_44, 1), new Object[] { "P", " ", "P", 'P', "plateCopper" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.casing_9, 1), new Object[] { "P", "P", 'P', "plateCopper" })); @@ -1376,6 +1385,8 @@ public class CraftingManager { //GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_calamity_ammo, 8), new Object[] { "S", "C", "G", 'S', "plateSteel", 'C', "plateCopper", 'G', Items.gunpowder })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.analyzer, 1), new Object[] { " S ", "SGS", " S ", 'S', "plateSteel", 'G', "paneGlassColorless" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.custom_fall, 1), new Object[] { "IIP", "CHW", "IIP", 'I', ModItems.plate_polymer, 'P', "plateSaturnite", 'C', ModItems.circuit_red_copper, 'H', ModItems.hull_small_steel, 'W', ModItems.coil_copper })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.reactor_sensor, 1), new Object[] { "WPW", "CMC", "PPP", 'W', ModItems.wire_tungsten, 'P', "plateLead", 'C', ModItems.circuit_targeting_tier3, 'M', ModItems.magnetron })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_controller, 1), new Object[] { "PGP", "ICI", "PRP", 'P', "plateDesh", 'G', "paneGlass", 'I', "ingotPolymer", 'R', "blockRedstone", 'C', ModItems.circuit_targeting_tier4 })); GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.assembly_template, 1, OreDictionary.WILDCARD_VALUE) }); GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.chemistry_template, 1, OreDictionary.WILDCARD_VALUE) }); diff --git a/com/hbm/packet/AuxButtonPacket.java b/com/hbm/packet/AuxButtonPacket.java index ae66cc8ee..d7cc27ecb 100644 --- a/com/hbm/packet/AuxButtonPacket.java +++ b/com/hbm/packet/AuxButtonPacket.java @@ -124,13 +124,33 @@ public class AuxButtonPacket implements IMessage { if (te instanceof TileEntityReactorControl) { TileEntityReactorControl control = (TileEntityReactorControl)te; + if(m.id == 1) + control.auto = m.value == 1; + TileEntity reac = p.worldObj.getTileEntity(control.linkX, control.linkY, control.linkZ); if (reac instanceof TileEntityMachineReactorSmall) { TileEntityMachineReactorSmall reactor = (TileEntityMachineReactorSmall)reac; - + if(m.id == 0) reactor.retracting = m.value == 0; + + if(m.id == 2) { + FluidType type = FluidType.STEAM; + int fill = reactor.tanks[2].getFill(); + + switch(m.value) { + case 0: type = FluidType.STEAM; fill = (int)Math.floor(fill * 100); break; + case 1: type = FluidType.HOTSTEAM; fill = (int)Math.floor(fill / 10D); break; + case 2: type = FluidType.SUPERHOTSTEAM; fill = (int)Math.floor(fill / 10D); break; + } + + if(fill > reactor.tanks[2].getMaxFill()) + fill = reactor.tanks[2].getMaxFill(); + + reactor.tanks[2].setTankType(type); + reactor.tanks[2].setFill(fill); + } } } diff --git a/com/hbm/tileentity/machine/TileEntityMachineTurbine.java b/com/hbm/tileentity/machine/TileEntityMachineTurbine.java index 60180c582..7a801474e 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineTurbine.java +++ b/com/hbm/tileentity/machine/TileEntityMachineTurbine.java @@ -45,8 +45,8 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent public TileEntityMachineTurbine() { slots = new ItemStack[7]; tanks = new FluidTank[2]; - tanks[0] = new FluidTank(FluidType.STEAM, 16000, 0); - tanks[1] = new FluidTank(FluidType.WATER, 32000, 1); + tanks[0] = new FluidTank(FluidType.STEAM, 64000, 0); + tanks[1] = new FluidTank(FluidType.WATER, 128000, 1); } @Override @@ -219,15 +219,13 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent if(!worldObj.isRemote) { age++; - if(age >= 10) + if(age >= 2) { age = 0; } - if(age == 4 || age == 9) { - fillFluidInit(tanks[1].getTankType()); - ffgeuaInit(); - } + fillFluidInit(tanks[1].getTankType()); + ffgeuaInit(); tanks[0].setType(0, 1, slots); tanks[0].loadTank(2, 3, slots); @@ -239,7 +237,7 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent } else { tanks[1].setTankType((FluidType) outs[0]); - for(int i = 0; i < tanks[0].getFill() / 1000 + 1; i++) { + for(int i = 0; i < 1200; i++) { if(tanks[0].getFill() >= (Integer)outs[2] && tanks[1].getFill() + (Integer)outs[1] <= tanks[1].getMaxFill()) { tanks[0].setFill(tanks[0].getFill() - (Integer)outs[2]); tanks[1].setFill(tanks[1].getFill() + (Integer)outs[1]); @@ -248,6 +246,8 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent if(power > maxPower) power = maxPower; + } else { + break; } } } @@ -295,7 +295,7 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent @Override public boolean getTact() { - if(age >= 0 && age < 5) + if(age == 0) { return true; } diff --git a/com/hbm/tileentity/machine/TileEntityReactorControl.java b/com/hbm/tileentity/machine/TileEntityReactorControl.java index a46fd86d8..23c5f77d4 100644 --- a/com/hbm/tileentity/machine/TileEntityReactorControl.java +++ b/com/hbm/tileentity/machine/TileEntityReactorControl.java @@ -7,6 +7,7 @@ import com.hbm.packet.PacketDispatcher; import com.hbm.packet.TEControlPacket; import net.minecraft.block.Block; +import net.minecraft.block.BlockRedstoneComparator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.ISidedInventory; @@ -126,6 +127,8 @@ public class TileEntityReactorControl extends TileEntity implements ISidedInvent super.readFromNBT(nbt); NBTTagList list = nbt.getTagList("items", 10); + redstoned = nbt.getBoolean("red"); + slots = new ItemStack[getSizeInventory()]; for(int i = 0; i < list.tagCount(); i++) @@ -144,6 +147,8 @@ public class TileEntityReactorControl extends TileEntity implements ISidedInvent super.writeToNBT(nbt); NBTTagList list = new NBTTagList(); + nbt.setBoolean("red", redstoned); + for(int i = 0; i < slots.length; i++) { if(slots[i] != null) @@ -192,13 +197,14 @@ public class TileEntityReactorControl extends TileEntity implements ISidedInvent public boolean isOn; public boolean auto; public boolean isLinked; + public boolean redstoned; @Override public void updateEntity() { if(!worldObj.isRemote) { - if(slots[0] != null && slots[0].getItem() == ModItems.detonator && + if(slots[0] != null && slots[0].getItem() == ModItems.reactor_sensor && slots[0].stackTagCompound != null) { int xCoord = slots[0].stackTagCompound.getInteger("x"); @@ -248,6 +254,21 @@ public class TileEntityReactorControl extends TileEntity implements ISidedInvent compression = 0; break; } + if(!redstoned) { + if(worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { + redstoned = true; + reactor.retracting = !reactor.retracting; + } + } else { + if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { + redstoned = false; + } + } + + if(auto && (water < 100 || cool < 100 || coreHeat > (50000 * 0.95)) && fuel > 0) { + reactor.retracting = true; + } + } else { hullHeat = 0; coreHeat = 0; @@ -264,6 +285,19 @@ public class TileEntityReactorControl extends TileEntity implements ISidedInvent compression = 0; isLinked = false; } + + if(worldObj.getBlock(xCoord, yCoord, zCoord + 1) instanceof BlockRedstoneComparator) { + worldObj.scheduleBlockUpdate(xCoord, yCoord, zCoord + 1, worldObj.getBlock(xCoord, yCoord, zCoord + 1), 1); + } + if(worldObj.getBlock(xCoord, yCoord, zCoord - 1) instanceof BlockRedstoneComparator) { + worldObj.scheduleBlockUpdate(xCoord, yCoord, zCoord - 1, worldObj.getBlock(xCoord, yCoord, zCoord - 1), 1); + } + if(worldObj.getBlock(xCoord + 1, yCoord, zCoord) instanceof BlockRedstoneComparator) { + worldObj.scheduleBlockUpdate(xCoord + 1, yCoord, zCoord, worldObj.getBlock(xCoord + 1, yCoord, zCoord), 1); + } + if(worldObj.getBlock(xCoord - 1, yCoord, zCoord) instanceof BlockRedstoneComparator) { + worldObj.scheduleBlockUpdate(xCoord - 1, yCoord, zCoord, worldObj.getBlock(xCoord - 1, yCoord, zCoord), 1); + } PacketDispatcher.wrapper.sendToAll(new TEControlPacket(xCoord, yCoord, zCoord, hullHeat, coreHeat, fuel, water, cool, steam, maxWater, maxCool, maxSteam, compression, rods, maxRods, isOn, auto, isLinked)); }