From 93638177da58dde877dba1468d7eb8f817e4eaaf Mon Sep 17 00:00:00 2001 From: HbmMods Date: Tue, 10 Oct 2017 19:36:15 +0200 Subject: [PATCH] Added & removed inserter, nerfs and changes --- assets/hbm/lang/en_US.lang | 2 +- assets/hbm/textures/gui/gui_inserter.png | Bin 2245 -> 2245 bytes assets/hbm/textures/items/plate_euphemium.png | Bin 0 -> 277 bytes .../hbm/textures/items/turbine_titanium.png | Bin 335 -> 357 bytes com/hbm/blocks/ModBlocks.java | 2 +- com/hbm/blocks/machine/MachineInserter.java | 94 ++++- com/hbm/handler/GUIHandler.java | 17 + com/hbm/inventory/MachineRecipes.java | 318 +++++++++------ .../container/ContainerMachineInserter.java | 84 ++++ com/hbm/inventory/gui/GUIMachineInserter.java | 59 +++ com/hbm/items/ModItems.java | 3 + com/hbm/items/food/ItemAppleSchrabidium.java | 32 +- com/hbm/items/gear/ArmorEuphemium.java | 2 + com/hbm/items/gear/ArmorSchrabidium.java | 8 +- com/hbm/items/gear/ModArmor.java | 5 + com/hbm/items/special/ItemCustomLore.java | 2 +- com/hbm/items/tool/ItemAssemblyTemplate.java | 21 +- com/hbm/items/weapon/GunZOMG.java | 8 +- com/hbm/main/CraftingManager.java | 15 +- com/hbm/main/MainRegistry.java | 4 + .../machine/TileEntityConverterHeRf.java | 6 + .../machine/TileEntityConverterRfHe.java | 6 + .../machine/TileEntityMachineIGenerator.java | 2 +- .../machine/TileEntityMachineInserter.java | 372 ++++++++++++++++++ 24 files changed, 882 insertions(+), 180 deletions(-) create mode 100644 assets/hbm/textures/items/plate_euphemium.png create mode 100644 com/hbm/inventory/container/ContainerMachineInserter.java create mode 100644 com/hbm/inventory/gui/GUIMachineInserter.java create mode 100644 com/hbm/tileentity/machine/TileEntityMachineInserter.java diff --git a/assets/hbm/lang/en_US.lang b/assets/hbm/lang/en_US.lang index 716f2f5a4..1f8b70721 100644 --- a/assets/hbm/lang/en_US.lang +++ b/assets/hbm/lang/en_US.lang @@ -1283,7 +1283,7 @@ item.limiter.name=Generator Limiter item.multitool_dig.name=Power Fist (Digging Claw) item.multitool_silk.name=Power Fist (Silk Touch Claw) -item.multitool_ext.name=Power Fist (Ore Extracter) +item.multitool_ext.name=Power Fist (Ore Extractor) item.multitool_miner.name=Power Fist (Extracting Mining Laser) item.multitool_hit.name=Power Fist (Fist) item.multitool_beam.name=Power Fist (Zapper) diff --git a/assets/hbm/textures/gui/gui_inserter.png b/assets/hbm/textures/gui/gui_inserter.png index 0f93eadef5c73d0001c04e408220c61991d8fce8..a38ebf127ee093cd1741e9d8a9b936eae297ec68 100644 GIT binary patch delta 1938 zcmXw3dpy(o8~@H_OK#znTOm1>9dbFMFqd*rE-OPWKckXc7|})@?K`KFPDe&fO<0^x z%*-~oQd6cnE-!M44Y^G@a%=}f3)^s}-|Ia8e4f|ydYz~gCSUb@h! z*skvJgSoXes_!6GG03T;AkVTBHJ@U$eh&L>wxGfjLvo2T4Xiu|DD|uF`cv9c9dt1; zX(_CS(+sJt^KmoM8PDNKL$+K#i^n)2^lpA*L>XSTmHAGV@e8fyEIryuGuyDk`u=Rz zo+agpTK>JGZbv__uRB&~fObO@7&5LI9nKn_=2Yzw(FlHqRq$f2YS+`JxefYDOX4(A-*VkrT+E0SSf zr@b1BpzB_ZNtrs{5eoRqy>k;lm;#|~xt-$&)E?s{f&el?Rb&Bay}+eF)pn1BPRtzKs}ImGbOsdJ36=dRLj(cGWTz@4KR;uJy9#`WO8KT}NZkcVl4gWltl? zTG5u*y>+n@XVGeQ>uTjp9c);M1{jPEB-%f&qTitjKJ_HA6p!Tvy`Usv%x<$sdl<}$ zZnj4GpR`AU*R(pBR4iou;j4(XFNsF0k#_^vbvWD?A5HOK);|b#m9U4wZA%UFC5&sJ zR>x7)Dr8O#oEMzJ#M(xj1xoSj(RtbjhVFZKX<^mV8EpN9>JC8Q1a^f|iz_26=oV$s zz+jQ=tve5yIhoy#=tF!hMxkRIp*DG8rO+DOlY4>OL?)ca+xF{ng`Rm+6jG{=wjh@? zH}6OW*`sRZ3E_?pXw1VQAqK9hHhHfhsVxrwjF~d)qJ4+&dZNXBl;Vf2N5U1)HGFuI z?5oh^GDM}=f;@&C6NACpJ{kg^H#b|<8+g!gIaPa3asO`(D^)IfgBmUr?C+QYj`6KU zpIVZ28q-g0Lk>2k-^U?~$(S%{+MIvE=q z8@d?{&Aurxoo{rZ(oK`;iILd(RcRs0M}AK5SK{+f!K(u!cn-*#2z|U5e7<6IPB37c zF1U2GiESR;|A@frwQ1BTyhP2l`sp2wJ~1xX&!4(MkZ!oTAP`T;@1#xSOVm?*c}4Oy zv0A=JQ65=b^>jK;!wJ+3Jh}G%&e-j#yci^S92UQ#2kC5_+ADjIHbXG zs4df~7X%_VGkc^eW90p-`D2)-8&0u<^11t4$3Mc_5?>x@ZE6z22FO29FLaEg;QLQL zW+Gz)^=_zZ5>h%E$L3K!aHGxj^#0Dlp==+1YyFBmHZL|zFDys7H7w3&j$u}#Nv4)X zPX>IxhcwG&yB1wXUlf`Ed}6|@$YER#7QA)0V&SSsO6YsfS$Q#+dY)PR_O}TTb#`th zzi{B|%xvLuYNy*;P{60i6}VXc6!(72GTZ#Z^4N_K%4s`amRX^bg}@w_F`=iBl8Wss#?e)jj3?n4JaukuLw zg4Fv(>V1$Xx8@VC;C<%CpUvJph$T~q_7h1itQscLEztoR;I|4?mHHy*=F|FC0{zfd zM`%QC$5qDSAD1r%Y;Qoot5|>+CBrmXq}hi)HM@^skH`4an0O{yZ|2KR!k~4_oF0B| z>0mU{qWR8u0ycwf9@mdL-m1+JtssxIB~)7dmtJ#M&OYC5;Jb_KRrEN zr!*gb$opy3B%g1xxVV@PugF;`xx$mS0IA6fs%Lt6ZmK{;J}DP!OcFt%`)W(rF3)in zw*NlzgofB^0d_{<@P71tZ$B=}2a9+>BEZZ^BG}Hu3@IeZp`>vF(*XX8YkZ4%I%zyk zbRT`_;mkA29yflu*I6MU?(6)BRy=|TAz8t`C%M32#vim!Iya=;S{nKGb`agC>&yyp zv3#OYcKftGDIaPm&tfO30H$GYl-+12#p$0G65VaQaZ2BJXafp5z^)>I&>F6(FuFU` zIX#}rwy>EQk*f_U9k1t>LKXfa^8WD6C@0!oR1zIBm1YUqX9EGURRBy^g5uY>KE~h+^KQd38`}to@{@UCC delta 1930 zcmV;52X*+x5ycUZJ%3GZ+eR1$;8BrfZ_`DD_yRqEyvzmal>y}x7NC`TfiA6cIL@NC z>7HH0ie;IiNY0R=_&pC$G=c50zj*Y{52@iIy{QshhsFL6)n9r2cJcRHTM>PF{eM+e zUjJN&#bQyV)Z&Hv_}ZuMLchiv{g%A=xiZhs&ncaou|8I5vwzv7&1RF9|9&3j=ekCV zbQA#Jzkk2nPXjG%x7(CbN>5Kusrswt6JB5ZhjzPNdimqWhfj^Z1o-XnFJAmyy~ipo zm&@7@nF)OK>HMd_6}elamp@WU>z7}%fK#JCM>7B*7Bc{5>C`fS_XGg5WXj);0APL| zPh25%Kfnh9fPeXTec>Np0^D1>G3WyUz&zAk`(LluX}Mgc)oPVedJBf#zn?7;UI_qZ zW4GI-l+wEw{Ql2}ALoq#U^ezI_ERtPb03dL05Cg;qdv{t2n2yO&H(Q3@3X(bYPBjd z<@$EP91N$)PGs8*J-!gWlziY?fm(p`8W6b z!^6A3|M%_N`*vPl&i*{=npR!jq&A%1djN;&UZTSsx0zCXM?LN^=XCvib@gjArOVVs zo{Me*Hg%xVJGH+?mi4-5yLHr+Z_K(P%MO4pYrQrj#!$MBEb6+hy69*089-epYO^-& z>v&B$)PIPgt}@1|i=QTYAHaU3%I#!R8%fmFY-)AQUDka7B`)$EA>MSocV&^7T(T^sJ>_lJkpql>zJx|X`=FKY>q+d=BSw$vr6y*_J7b=8|{UG$d~ z0Q+D5P@_bNb!DGXL|y${sxJDw=pH~_M;Yo;(|?$2Wp(AV2QZG&-wbrz2@gBakk^@q zUQ?>8EPDXsn8ank2!d z8SCD1b(P`00ORN#0EcVCt{vhMC$_X5S=3ekwPQ0A7)N6OtX8YEZb;y!k9BEhNOfyU zb$>ORT3rmMF#v9EZi*bnP^z6i>P8ZEHJe&p3}+Ho0md-bHKn@9(K`SR&kHQP()_oMR?1j_mgWr1W!bnKNZ9)lQwh_sp00dDPXNJ%Dk|ehDzwkwjgTF#7=5 zo9miVUE~N80COE#)J2Zj2f$p{lS3YF1*2R)3&;%Ro8aAO(~`H^z@WcO5Gj{%sZWr1lw-6wSNao zbiFIAR6A{*J7Z2=&8AitW%N1|@VGPd?F6OTX`{^$EA>#c#vfl5EXvdfxMUG=6~7yXU8 z2{_~vWzHFLWKmanW&-2r902>N9u40^Ygy&b8FDLPSp2-6>YR#Q-7+f-c;+N zjLreDcueW@Kg-%*e(na;p%TxUPpSP#qOLq+*F_n-vdW#-*%YyAOGC2$#gtQ~Dn z@h;WjSOSwl2Nsh&2OBLlo(Hg6tOo?Hr#7o% z?gtz-Cjx0_^6fC3#uI^Hikt{kjwJvDCIBEX0RVwDZUQuHG` z%WvKLd;jiNzJKRb4tcc9l-@5@edb;Gjd#2b-rNT!9#1km;51Lay1(nrmko*r3^x`u z?g;EEna;Fe>#{XouZvGj;&_~%H)YfFIGdbw$t!k>a+?J{v|2EH`CBhk9xKj}qc4=W zse6vd>!``a#sALwEnNCEMrMujO%=yy4<(oz_G@hFnzQrxYYPEuhWmel{7pAs|GoVi Z+k@2Pt{3dRC1E?U*IRI3Z)9J+Vcw|`?Znqnk%LRbz^~yMoZLe7v z$8nhFxs$ytOJh=1RF&OsM+l)Q?&Q=UflUjqnRNiwMh)w5IJC31b`@Y}K}5=P(p7e~ z17NM~L7>oV-$UiPQ_$IY}yOo3uH`JAq~JFexRl zO^y)D1>5{ei9P}k9{jDu-I<*k1^%PF_t#VJ)eg49-uo-1^ho|{FSOQh&RrR-wXVpV zb64(v5TukKA|Rpy77^UZi0D~?wYFns#25=%j1d4Z3}!W^a`!rSN{g z0RYRgAm?xg7lPKWh+v*)Ow)uA0*>Rrx~>3#ecxe>DY#<67}IUrR>=+_luaT65kcSg zxQAHD0Z^Jx7TU}zf_w7JjBy;xnTS3DtSor%uY1y2cD4fmL{!PI2vSO5=CVa8g%~5w q^Q@lt>&m~b%^jz`d#tYqf2}{3+{!t=l+&jG0000 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) + { + return true; + } else if(!player.isSneaking()) + { + TileEntityMachineInserter entity = (TileEntityMachineInserter) world.getTileEntity(x, y, z); + if(entity != null) + { + FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_inserter, world, x, y, z); + } + return true; + } else { + return false; + } + } + } diff --git a/com/hbm/handler/GUIHandler.java b/com/hbm/handler/GUIHandler.java index 22e58ae34..e82eb2211 100644 --- a/com/hbm/handler/GUIHandler.java +++ b/com/hbm/handler/GUIHandler.java @@ -39,6 +39,7 @@ import com.hbm.tileentity.machine.TileEntityMachineFluidTank; import com.hbm.tileentity.machine.TileEntityMachineGasFlare; import com.hbm.tileentity.machine.TileEntityMachineGenerator; import com.hbm.tileentity.machine.TileEntityMachineIGenerator; +import com.hbm.tileentity.machine.TileEntityMachineInserter; import com.hbm.tileentity.machine.TileEntityMachineMiningDrill; import com.hbm.tileentity.machine.TileEntityMachineOilWell; import com.hbm.tileentity.machine.TileEntityMachinePuF6Tank; @@ -478,6 +479,14 @@ public class GUIHandler implements IGuiHandler { return new ContainerCrateSteel(player.inventory, (TileEntityCrateSteel) entity); } } + + case ModBlocks.guiID_machine_inserter: + { + if(entity instanceof TileEntityMachineInserter) + { + return new ContainerMachineInserter(player.inventory, (TileEntityMachineInserter) entity); + } + } } return null; } @@ -898,6 +907,14 @@ public class GUIHandler implements IGuiHandler { return new GUICrateSteel(player.inventory, (TileEntityCrateSteel) entity); } } + + case ModBlocks.guiID_machine_inserter: + { + if(entity instanceof TileEntityMachineInserter) + { + return new GUIMachineInserter(player.inventory, (TileEntityMachineInserter) entity); + } + } } } else { //CLIENTONLY GUIS diff --git a/com/hbm/inventory/MachineRecipes.java b/com/hbm/inventory/MachineRecipes.java index 6769135c8..45470f2c5 100644 --- a/com/hbm/inventory/MachineRecipes.java +++ b/com/hbm/inventory/MachineRecipes.java @@ -88,31 +88,6 @@ public class MachineRecipes { return new ItemStack(ModItems.plate_paa, 2); } - if (item == ModItems.rod_quad_euphemium && item2 == ModItems.powder_caesium - || item == ModItems.powder_caesium && item2 == ModItems.rod_quad_euphemium) { - return new ItemStack(ModItems.nugget_euphemium, 2, 34); - } - - if (item == ModItems.rod_quad_euphemium && item2 == ModItems.powder_astatine - || item == ModItems.powder_astatine && item2 == ModItems.rod_quad_euphemium) { - return new ItemStack(ModItems.nugget_euphemium, 2, 34); - } - - if (item == ModItems.rod_quad_euphemium && item2 == ModItems.powder_tennessine - || item == ModItems.powder_tennessine && item2 == ModItems.rod_quad_euphemium) { - return new ItemStack(ModItems.nugget_euphemium, 2, 34); - } - - if (item == ModItems.rod_quad_euphemium && item2 == ModItems.powder_cerium - || item == ModItems.powder_cerium && item2 == ModItems.rod_quad_euphemium) { - return new ItemStack(ModItems.nugget_euphemium, 2, 34); - } - - if (mODE(item, new String[] {"gemCoal", "dustCoal"}) && mODE(item2, "dustSalpeter") - || mODE(item, "dustSalpeter") && mODE(item2, new String[] {"gemCoal", "dustCoal"})) { - return new ItemStack(ModItems.ingot_polymer, 2); - } - if (mODE(item, new String[] {"ingotSteel", "dustSteel"}) && mODE(item2, new String[] {"ingotTungsten", "dustTungsten"}) || mODE(item, new String[] {"ingotTungsten", "dustTungsten"}) && mODE(item2, new String[] {"ingotSteel", "dustSteel"})) { return new ItemStack(ModItems.ingot_dura_steel, 2); @@ -623,8 +598,6 @@ public class MachineRecipes { getFurnaceOutput(ModItems.ingot_steel, ModItems.ingot_tungsten).copy()); recipes.put(new ItemStack[] { new ItemStack(ModItems.ingot_steel), new ItemStack(ModItems.powder_cobalt) }, getFurnaceOutput(ModItems.ingot_steel, ModItems.powder_cobalt).copy()); - recipes.put(new ItemStack[] { new ItemStack(Items.coal), new ItemStack(ModItems.niter) }, - getFurnaceOutput(Items.coal, ModItems.niter).copy()); } catch (Exception x) { System.out.println("Unable to register alloy recipes for NEI!"); } @@ -677,10 +650,8 @@ public class MachineRecipes { getCentrifugeOutput(ModItems.rod_schrabidium_fuel_depleted)); recipes.put(new ItemStack(ModItems.rod_dual_schrabidium_fuel_depleted), getCentrifugeOutput(ModItems.rod_dual_schrabidium_fuel_depleted)); - // [REDACTED] - // recipes.put(new - // ItemStack(ModItems.rod_quad_schrabidium_fuel_depleted), - // getCentrifugeOutput(ModItems.rod_quad_schrabidium_fuel_depleted)); + recipes.put(new ItemStack(ModItems.rod_quad_schrabidium_fuel_depleted), + getCentrifugeOutput(ModItems.rod_quad_schrabidium_fuel_depleted)); return recipes; } @@ -1529,6 +1500,7 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.plate_steel, 4)); list.add(new ItemStack(ModItems.wire_red_copper, 6)); list.add(new ItemStack(ModItems.powder_lapis, 2)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); break; case DEE_MAGNET: list.add(new ItemStack(ModBlocks.fusion_conductor, 6)); @@ -1576,6 +1548,7 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.plate_titanium, 6)); break; case TELEPAD: + list.add(new ItemStack(ModItems.ingot_polymer, 12)); list.add(new ItemStack(ModItems.plate_schrabidium, 2)); list.add(new ItemStack(ModItems.plate_combine_steel, 4)); list.add(new ItemStack(ModItems.plate_steel, 2)); @@ -1851,6 +1824,7 @@ public class MachineRecipes { list.add(new ItemStack(Items.redstone, 4)); list.add(new ItemStack(ModItems.circuit_red_copper, 4)); list.add(new ItemStack(ModItems.wire_red_copper, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); break; case UPGRADE_RED_III: list.add(new ItemStack(ModItems.upgrade_speed_2, 1)); @@ -1870,6 +1844,7 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.powder_steel, 4)); list.add(new ItemStack(ModItems.circuit_red_copper, 4)); list.add(new ItemStack(ModItems.wire_red_copper, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); break; case UPGRADE_GREEN_III: list.add(new ItemStack(ModItems.upgrade_effect_2, 1)); @@ -1889,6 +1864,7 @@ public class MachineRecipes { list.add(new ItemStack(Items.glowstone_dust, 4)); list.add(new ItemStack(ModItems.circuit_red_copper, 4)); list.add(new ItemStack(ModItems.wire_red_copper, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); break; case UPGRADE_BLUE_III: list.add(new ItemStack(ModItems.upgrade_power_2, 1)); @@ -1908,6 +1884,7 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.powder_iron, 4)); list.add(new ItemStack(ModItems.circuit_red_copper, 4)); list.add(new ItemStack(ModItems.wire_red_copper, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); break; case UPGRADE_PURPLE_III: list.add(new ItemStack(ModItems.upgrade_fortune_2, 1)); @@ -1915,6 +1892,26 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.powder_iron, 6)); list.add(new ItemStack(ModItems.ingot_desh, 4)); break; + case UPGRADE_PINK_I: + list.add(new ItemStack(ModItems.upgrade_template, 1)); + list.add(new ItemStack(ModItems.powder_polymer, 4)); + list.add(new ItemStack(ModItems.powder_tungsten, 6)); + list.add(new ItemStack(ModItems.wire_red_copper, 4)); + break; + case UPGRADE_PINK_II: + list.add(new ItemStack(ModItems.upgrade_afterburn_1, 1)); + list.add(new ItemStack(ModItems.powder_polymer, 2)); + list.add(new ItemStack(ModItems.powder_tungsten, 4)); + list.add(new ItemStack(ModItems.circuit_red_copper, 4)); + list.add(new ItemStack(ModItems.wire_red_copper, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); + break; + case UPGRADE_PINK_III: + list.add(new ItemStack(ModItems.upgrade_afterburn_2, 1)); + list.add(new ItemStack(ModItems.powder_polymer, 2)); + list.add(new ItemStack(ModItems.powder_tungsten, 6)); + list.add(new ItemStack(ModItems.ingot_desh, 4)); + break; case FUSE: list.add(new ItemStack(ModItems.plate_steel, 2)); list.add(new ItemStack(Blocks.glass_pane, 1)); @@ -1989,6 +1986,7 @@ public class MachineRecipes { break; case HATCH_CONTROLLER: list.add(new ItemStack(ModItems.ingot_steel, 3)); + list.add(new ItemStack(ModItems.ingot_polymer, 4)); list.add(new ItemStack(ModItems.ingot_red_copper, 1)); list.add(new ItemStack(Items.redstone, 4)); list.add(new ItemStack(ModBlocks.steel_roof, 5)); @@ -1996,6 +1994,7 @@ public class MachineRecipes { case CENTRIFUGE: list.add(new ItemStack(ModItems.centrifuge_tower, 1)); list.add(new ItemStack(ModItems.ingot_steel, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); list.add(new ItemStack(ModItems.plate_steel, 6)); list.add(new ItemStack(ModItems.plate_copper, 2)); list.add(new ItemStack(ModItems.wire_red_copper, 8)); @@ -2023,6 +2022,7 @@ public class MachineRecipes { break; case NUCLEAR_GENERATOR: list.add(new ItemStack(ModItems.ingot_steel, 6)); + list.add(new ItemStack(ModItems.ingot_polymer, 4)); list.add(new ItemStack(ModItems.plate_lead, 8)); list.add(new ItemStack(ModItems.plate_copper, 4)); list.add(new ItemStack(ModItems.ingot_lead, 12)); @@ -2045,6 +2045,7 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.cyclotron_tower, 1)); list.add(new ItemStack(ModItems.board_copper, 4)); list.add(new ItemStack(ModItems.ingot_steel, 16)); + list.add(new ItemStack(ModItems.ingot_polymer, 24)); list.add(new ItemStack(ModItems.plate_steel, 6)); list.add(new ItemStack(ModBlocks.machine_battery, 4)); list.add(new ItemStack(ModItems.wire_red_copper, 20)); @@ -2055,6 +2056,7 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.rtg_unit, 5)); list.add(new ItemStack(ModItems.plate_steel, 8)); list.add(new ItemStack(ModItems.wire_red_copper, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 6)); break; case BATTERY: list.add(new ItemStack(ModItems.ingot_steel, 4)); @@ -2155,6 +2157,7 @@ public class MachineRecipes { break; case CMB_FURNACE: list.add(new ItemStack(ModItems.ingot_steel, 8)); + list.add(new ItemStack(ModItems.ingot_polymer, 6)); list.add(new ItemStack(ModItems.plate_titanium, 4)); list.add(new ItemStack(ModItems.plate_copper, 6)); list.add(new ItemStack(ModItems.circuit_gold, 6)); @@ -2382,6 +2385,7 @@ public class MachineRecipes { break; case LAUNCH_PAD: list.add(new ItemStack(ModItems.ingot_steel, 4)); + list.add(new ItemStack(ModItems.ingot_polymer, 2)); list.add(new ItemStack(ModItems.plate_steel, 12)); list.add(new ItemStack(ModBlocks.machine_battery, 1)); list.add(new ItemStack(ModItems.circuit_gold, 2)); @@ -2512,19 +2516,11 @@ public class MachineRecipes { break; case DEFAB: list.add(new ItemStack(ModItems.ingot_steel, 2)); + list.add(new ItemStack(ModItems.ingot_polymer, 8)); list.add(new ItemStack(ModItems.plate_iron, 5)); list.add(new ItemStack(Items.diamond, 1)); list.add(new ItemStack(ModItems.plate_dalekanium, 3)); break; - case LASER_BUCKSHOT: - list.add(new ItemStack(ModItems.powder_power, 1)); - list.add(new ItemStack(ModItems.powder_lead, 1)); - break; - case ROCKET: - list.add(new ItemStack(ModItems.plate_steel, 1)); - list.add(new ItemStack(ModItems.plate_iron, 5)); - list.add(new ItemStack(Blocks.tnt, 1)); - break; case MINI_NUKE: list.add(new ItemStack(ModItems.plate_steel, 3)); list.add(new ItemStack(ModItems.plate_iron, 1)); @@ -2533,7 +2529,7 @@ public class MachineRecipes { case MINI_MIRV: list.add(new ItemStack(ModItems.plate_steel, 20)); list.add(new ItemStack(ModItems.plate_iron, 10)); - list.add(new ItemStack(ModItems.nugget_pu239, 3)); + list.add(new ItemStack(ModItems.nugget_pu239, 24)); break; case DARK_PLUG: list.add(new ItemStack(ModItems.plate_steel, 2)); @@ -2552,100 +2548,163 @@ public class MachineRecipes { list.add(new ItemStack(Blocks.tnt, 1)); break; case GRENADE_FLAME: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.grenade_frag, 1)); + list.add(new ItemStack(ModItems.powder_fire, 1)); + list.add(new ItemStack(ModItems.plate_copper, 2)); break; case GRENADE_SHRAPNEL: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.grenade_frag, 1)); + list.add(new ItemStack(ModItems.pellet_buckshot, 1)); + list.add(new ItemStack(ModItems.plate_steel, 2)); break; case GRENAGE_CLUSTER: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.grenade_frag, 1)); + list.add(new ItemStack(ModItems.pellet_cluster, 1)); + list.add(new ItemStack(ModItems.plate_steel, 2)); break; case GREANADE_FLARE: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.grenade_generic, 1)); + list.add(new ItemStack(Items.glowstone_dust, 1)); + list.add(new ItemStack(ModItems.plate_aluminium, 2)); break; case GRENADE_LIGHTNING: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.grenade_generic, 1)); + list.add(new ItemStack(ModItems.circuit_red_copper, 1)); + list.add(new ItemStack(ModItems.plate_gold, 2)); break; case GRENADE_IMPULSE: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_steel, 1)); + list.add(new ItemStack(ModItems.plate_iron, 3)); + list.add(new ItemStack(ModItems.wire_red_copper, 6)); + list.add(new ItemStack(Items.diamond, 1)); break; case GRENADE_PLASMA: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_steel, 3)); + list.add(new ItemStack(ModItems.plate_advanced_alloy, 1)); + list.add(new ItemStack(ModItems.coil_advanced_torus, 1)); + list.add(new ItemStack(ModItems.cell_deuterium, 1)); + list.add(new ItemStack(ModItems.cell_tritium, 1)); break; case GRENADE_TAU: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_lead, 3)); + list.add(new ItemStack(ModItems.plate_advanced_alloy, 1)); + list.add(new ItemStack(ModItems.coil_advanced_torus, 1)); + list.add(new ItemStack(ModItems.gun_xvl1456_ammo, 1)); break; case GRENADE_SCHRABIDIUM: - list.add(new ItemStack(ModItems.plate_iron, 1)); - break; - case GRENADE_MK2: - list.add(new ItemStack(ModItems.plate_iron, 1)); - break; - case GRENADE_ASCHRAB: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.grenade_flare, 1)); + list.add(new ItemStack(ModItems.powder_schrabidium, 1)); + list.add(new ItemStack(ModItems.neutron_reflector, 2)); break; case GRENADE_NUKE: list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_steel, 1)); + list.add(new ItemStack(ModItems.nugget_pu239, 2)); + list.add(new ItemStack(ModItems.wire_red_copper, 2)); break; case GRENADE_ZOMG: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_paa, 3)); + list.add(new ItemStack(ModItems.neutron_reflector, 1)); + list.add(new ItemStack(ModItems.coil_magnetized_tungsten, 3)); + list.add(new ItemStack(ModItems.powder_power, 3)); break; case GRENADE_BLACK_HOLE: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.ingot_polymer, 6)); + list.add(new ItemStack(ModItems.neutron_reflector, 3)); + list.add(new ItemStack(ModItems.coil_magnetized_tungsten, 2)); + list.add(new ItemStack(ModItems.black_hole, 1)); break; case POWER_FIST: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.rod_reiium, 1)); + list.add(new ItemStack(ModItems.rod_weidanium, 1)); + list.add(new ItemStack(ModItems.rod_australium, 1)); + list.add(new ItemStack(ModItems.rod_verticium, 1)); + list.add(new ItemStack(ModItems.rod_unobtainium, 1)); + list.add(new ItemStack(ModItems.rod_daffergon, 1)); + list.add(new ItemStack(ModItems.ingot_polymer, 4)); + list.add(new ItemStack(ModItems.circuit_gold, 1)); + list.add(new ItemStack(ModItems.ducttape, 1)); break; case GADGET_PROPELLANT: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(Blocks.tnt, 3)); + list.add(new ItemStack(ModItems.plate_steel, 2)); + list.add(new ItemStack(ModItems.plate_aluminium, 4)); + list.add(new ItemStack(ModItems.wire_gold, 3)); break; case GADGET_WIRING: list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.wire_gold, 12)); break; case GADGET_CORE: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.nugget_pu239, 7)); + list.add(new ItemStack(ModItems.nugget_u238, 3)); break; case BOY_SHIELDING: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.neutron_reflector, 12)); + list.add(new ItemStack(ModItems.plate_steel, 4)); break; case BOY_TARGET: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.nugget_u235, 7)); break; case BOY_BULLET: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.nugget_u235, 3)); break; case BOY_PRPELLANT: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(Blocks.tnt, 3)); + list.add(new ItemStack(ModItems.plate_iron, 8)); + list.add(new ItemStack(ModItems.plate_aluminium, 4)); + list.add(new ItemStack(ModItems.wire_red_copper, 4)); break; case BOY_IGNITER: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_aluminium, 6)); + list.add(new ItemStack(ModItems.plate_steel, 1)); + list.add(new ItemStack(ModItems.circuit_red_copper, 1)); + list.add(new ItemStack(ModItems.wire_red_copper, 3)); break; case MAN_PROPELLANT: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(Blocks.tnt, 3)); + list.add(new ItemStack(ModItems.plate_steel, 2)); + list.add(new ItemStack(ModItems.plate_titanium, 4)); + list.add(new ItemStack(ModItems.wire_red_copper, 3)); break; case MAN_IGNITER: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_steel, 6)); + list.add(new ItemStack(ModItems.circuit_red_copper, 1)); + list.add(new ItemStack(ModItems.wire_red_copper, 9)); break; case MAN_CORE: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.nugget_pu239, 8)); + list.add(new ItemStack(ModItems.nugget_beryllium, 2)); break; case MIKE_TANK: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.nugget_u238, 24)); + list.add(new ItemStack(ModItems.ingot_lead, 6)); break; case MIKE_DEUT: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_iron, 12)); + list.add(new ItemStack(ModItems.plate_steel, 16)); + list.add(new ItemStack(ModItems.cell_deuterium, 10)); break; case MIKE_COOLER: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_iron, 8)); + list.add(new ItemStack(ModItems.coil_copper, 5)); + list.add(new ItemStack(ModItems.coil_tungsten, 5)); + list.add(new ItemStack(ModItems.motor, 2)); break; case FLEIIJA_IGNITER: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.plate_titanium, 6)); + list.add(new ItemStack(ModItems.wire_schrabidium, 2)); + list.add(new ItemStack(ModItems.circuit_schrabidium, 1)); break; case FLEIJA_CORE: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(ModItems.nugget_u235, 8)); + list.add(new ItemStack(ModItems.nugget_neptunium, 2)); + list.add(new ItemStack(ModItems.nugget_beryllium, 4)); + list.add(new ItemStack(ModItems.coil_copper, 2)); break; case FLEIJA_PROPELLANT: - list.add(new ItemStack(ModItems.plate_iron, 1)); + list.add(new ItemStack(Blocks.tnt, 3)); + list.add(new ItemStack(ModItems.plate_schrabidium, 8)); break; default: list.add(new ItemStack(Items.stick)); @@ -2900,6 +2959,15 @@ public class MachineRecipes { case UPGRADE_PURPLE_III: output = new ItemStack(ModItems.upgrade_fortune_3, 1); break; + case UPGRADE_PINK_I: + output = new ItemStack(ModItems.upgrade_afterburn_1, 1); + break; + case UPGRADE_PINK_II: + output = new ItemStack(ModItems.upgrade_afterburn_2, 1); + break; + case UPGRADE_PINK_III: + output = new ItemStack(ModItems.upgrade_afterburn_3, 1); + break; case FUSE: output = new ItemStack(ModItems.fuse, 1); break; @@ -3144,148 +3212,136 @@ public class MachineRecipes { output = new ItemStack(ModItems.missile_buster_strong, 1); break; case MISSILE_HE_3: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_burst, 1); break; case MISSILE_FIRE_3: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_inferno, 1); break; case MISSILE_CLUSTER_3: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_rain, 1); break; case MISSILE_BUSTER_3: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_drill, 1); break; case MISSILE_NUCLEAR: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_nuclear, 1); break; case MISSILE_MIRV: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_nuclear_cluster, 1); break; case MISSILE_ENDO: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_endo, 1); break; case MISSILE_EXO: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.missile_exo, 1); break; case DEFAB: - output = new ItemStack(Items.stick, 1); - break; - case LASER_BUCKSHOT: - output = new ItemStack(Items.stick, 1); - break; - case ROCKET: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gun_defabricator, 1); break; case MINI_NUKE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gun_fatman_ammo, 1); break; case MINI_MIRV: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gun_mirv_ammo, 1); break; case DARK_PLUG: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gun_osipr_ammo, 24); break; case COMBINE_BALL: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gun_osipr_ammo2, 1); break; case GREANADE_ENHANCED: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_strong, 1); break; case GRENADE_FLAME: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_fire, 1); break; case GRENADE_SHRAPNEL: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_shrapnel, 1); break; case GRENAGE_CLUSTER: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_cluster, 1); break; case GREANADE_FLARE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_flare, 1); break; case GRENADE_LIGHTNING: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_electric, 1); break; case GRENADE_IMPULSE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_pulse, 4); break; case GRENADE_PLASMA: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_plasma, 2); break; case GRENADE_TAU: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_tau, 2); break; case GRENADE_SCHRABIDIUM: - output = new ItemStack(Items.stick, 1); - break; - case GRENADE_MK2: - output = new ItemStack(Items.stick, 1); - break; - case GRENADE_ASCHRAB: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_schrabidium, 1); break; case GRENADE_NUKE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_nuke, 1); break; case GRENADE_ZOMG: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_zomg, 1); break; case GRENADE_BLACK_HOLE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.grenade_black_hole, 1); break; case POWER_FIST: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.multitool_dig, 1); break; case GADGET_PROPELLANT: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gadget_explosive, 1); break; case GADGET_WIRING: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gadget_wireing, 1); break; case GADGET_CORE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.gadget_core, 1); break; case BOY_SHIELDING: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.boy_shielding, 1); break; case BOY_TARGET: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.boy_target, 1); break; case BOY_BULLET: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.boy_bullet, 1); break; case BOY_PRPELLANT: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.boy_propellant, 1); break; case BOY_IGNITER: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.boy_igniter, 1); break; case MAN_PROPELLANT: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.man_explosive, 1); break; case MAN_IGNITER: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.man_igniter, 1); break; case MAN_CORE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.man_core, 1); break; case MIKE_TANK: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.mike_core, 1); break; case MIKE_DEUT: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.mike_deut, 1); break; case MIKE_COOLER: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.mike_cooling_unit, 1); break; case FLEIIJA_IGNITER: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.fleija_igniter, 1); break; case FLEIJA_CORE: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.fleija_core, 1); break; case FLEIJA_PROPELLANT: - output = new ItemStack(Items.stick, 1); + output = new ItemStack(ModItems.fleija_propellant, 1); break; default: output = new ItemStack(Items.stick, 1); diff --git a/com/hbm/inventory/container/ContainerMachineInserter.java b/com/hbm/inventory/container/ContainerMachineInserter.java new file mode 100644 index 000000000..29623bb8a --- /dev/null +++ b/com/hbm/inventory/container/ContainerMachineInserter.java @@ -0,0 +1,84 @@ +package com.hbm.inventory.container; + +import com.hbm.inventory.SlotMachineOutput; +import com.hbm.tileentity.machine.TileEntityMachineInserter; +import com.hbm.tileentity.machine.TileEntityMachineTurbofan; + +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 ContainerMachineInserter extends Container { + + private TileEntityMachineInserter diFurnace; + + public ContainerMachineInserter(InventoryPlayer invPlayer, TileEntityMachineInserter tedf) { + diFurnace = tedf; + + this.addSlotToContainer(new Slot(tedf, 0, 8, 17)); + this.addSlotToContainer(new Slot(tedf, 1, 26, 17)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 2, 26, 53)); + this.addSlotToContainer(new Slot(tedf, 3, 62, 17)); + this.addSlotToContainer(new Slot(tedf, 4, 80, 17)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 5, 80, 53)); + this.addSlotToContainer(new Slot(tedf, 6, 116, 17)); + this.addSlotToContainer(new Slot(tedf, 7, 134, 17)); + this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 8, 134, 53)); + + 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)); + } + } + + for(int i = 0; i < 9; i++) + { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) + { + ItemStack var3 = null; + Slot var4 = (Slot) this.inventorySlots.get(par2); + + if (var4 != null && var4.getHasStack()) + { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (par2 <= 8) { + if (!this.mergeItemStack(var5, 9, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(var5, 0, 9, false)) + { + return null; + } + + if (var5.stackSize == 0) + { + var4.putStack((ItemStack) null); + } + else + { + var4.onSlotChanged(); + } + } + + return var3; + } + + @Override + public boolean canInteractWith(EntityPlayer player) { + return diFurnace.isUseableByPlayer(player); + } +} diff --git a/com/hbm/inventory/gui/GUIMachineInserter.java b/com/hbm/inventory/gui/GUIMachineInserter.java new file mode 100644 index 000000000..e2dfe6874 --- /dev/null +++ b/com/hbm/inventory/gui/GUIMachineInserter.java @@ -0,0 +1,59 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.FluidTank; +import com.hbm.inventory.container.ContainerMachineInserter; +import com.hbm.inventory.container.ContainerMachineTurbofan; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.machine.TileEntityMachineInserter; +import com.hbm.tileentity.machine.TileEntityMachineTurbofan; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUIMachineInserter extends GuiFluidContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_inserter.png"); + private TileEntityMachineInserter diFurnace; + + public GUIMachineInserter(InventoryPlayer invPlayer, TileEntityMachineInserter tedf) { + super(new ContainerMachineInserter(invPlayer, tedf)); + diFurnace = tedf; + + this.xSize = 176; + this.ySize = 166; + } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + super.drawScreen(mouseX, mouseY, f); + + diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 44, guiTop + 69 - 52, 16, 52); + diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 98, guiTop + 69 - 52, 16, 52); + diFurnace.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 69 - 52, 16, 52); + } + + @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); + + Minecraft.getMinecraft().getTextureManager().bindTexture(FluidTank.fluidTextures); + + diFurnace.tanks[0].renderTank(this, guiLeft + 44, guiTop + 69, diFurnace.tanks[0].getTankType().textureX() * FluidTank.x, diFurnace.tanks[0].getTankType().textureY() * FluidTank.y, 16, 52); + diFurnace.tanks[1].renderTank(this, guiLeft + 98, guiTop + 69, diFurnace.tanks[1].getTankType().textureX() * FluidTank.x, diFurnace.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52); + diFurnace.tanks[2].renderTank(this, guiLeft + 152, guiTop + 69, diFurnace.tanks[2].getTankType().textureX() * FluidTank.x, diFurnace.tanks[2].getTankType().textureY() * FluidTank.y, 16, 52); + } +} diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 381f11adb..6ae021e3b 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -127,6 +127,7 @@ public class ModItems { public static Item pipes_steel; public static Item drill_titanium; public static Item plate_dalekanium; + public static Item plate_euphemium; public static Item ingot_dura_steel; public static Item ingot_polymer; @@ -1082,6 +1083,7 @@ public class ModItems { pipes_steel = new Item().setUnlocalizedName("pipes_steel").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":pipes_steel"); drill_titanium = new Item().setUnlocalizedName("drill_titanium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":drill_titanium"); plate_dalekanium = new Item().setUnlocalizedName("plate_dalekanium").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":plate_dalekanium"); + plate_euphemium = new ItemCustomLore().setUnlocalizedName("plate_euphemium").setCreativeTab(null).setTextureName(RefStrings.MODID + ":plate_euphemium"); ingot_dura_steel = new ItemCustomLore().setUnlocalizedName("ingot_dura_steel").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":ingot_dura_steel"); ingot_polymer = new ItemCustomLore().setUnlocalizedName("ingot_polymer").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":ingot_polymer"); @@ -2169,6 +2171,7 @@ public class ModItems { GameRegistry.registerItem(plate_mixed, plate_mixed.getUnlocalizedName()); GameRegistry.registerItem(plate_paa, plate_paa.getUnlocalizedName()); GameRegistry.registerItem(plate_dalekanium, plate_dalekanium.getUnlocalizedName()); + GameRegistry.registerItem(plate_euphemium, plate_euphemium.getUnlocalizedName()); //Boards GameRegistry.registerItem(board_copper, board_copper.getUnlocalizedName()); diff --git a/com/hbm/items/food/ItemAppleSchrabidium.java b/com/hbm/items/food/ItemAppleSchrabidium.java index 3870e1099..0c8c3ebe6 100644 --- a/com/hbm/items/food/ItemAppleSchrabidium.java +++ b/com/hbm/items/food/ItemAppleSchrabidium.java @@ -43,16 +43,16 @@ public class ItemAppleSchrabidium extends ItemFood { { if (!p_77849_2_.isRemote) { - p_77849_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 6000, 4)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 60000, 4)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 60000, 0)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 6000, 4)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 6000, 2)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 60000, 2)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 6000, 4)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 60000, 9)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 60000, 4)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 60000, 9)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 1200, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 1200, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 1200, 0)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 1200, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 1200, 2)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 1200, 2)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 1200, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 1200, 9)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 1200, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 1200, 9)); } } @@ -60,13 +60,13 @@ public class ItemAppleSchrabidium extends ItemFood { { if (!p_77849_2_.isRemote) { - p_77849_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 2147483647, 99)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 2147483647, 99)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.regeneration.id, 2147483647, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.resistance.id, 2147483647, 1)); p_77849_3_.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 2147483647, 0)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 2147483647, 99)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2147483647, 99)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 2147483647, 6)); - p_77849_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 2147483647, 9)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 2147483647, 9)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 2147483647, 4)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 2147483647, 3)); + p_77849_3_.addPotionEffect(new PotionEffect(Potion.jump.id, 2147483647, 4)); p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 2147483647, 24)); p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2147483647, 14)); p_77849_3_.addPotionEffect(new PotionEffect(Potion.field_76443_y.id, 2147483647, 99)); diff --git a/com/hbm/items/gear/ArmorEuphemium.java b/com/hbm/items/gear/ArmorEuphemium.java index b93140e85..c8a881f39 100644 --- a/com/hbm/items/gear/ArmorEuphemium.java +++ b/com/hbm/items/gear/ArmorEuphemium.java @@ -85,7 +85,9 @@ public class ArmorEuphemium extends ItemArmor implements ISpecialArmor { if(player.motionY < -0.25D) { player.motionY = -0.25D; + player.fallDistance = 0; } + } } diff --git a/com/hbm/items/gear/ArmorSchrabidium.java b/com/hbm/items/gear/ArmorSchrabidium.java index 757fd246b..4fc618676 100644 --- a/com/hbm/items/gear/ArmorSchrabidium.java +++ b/com/hbm/items/gear/ArmorSchrabidium.java @@ -42,7 +42,7 @@ public class ArmorSchrabidium extends ItemArmor implements ISpecialArmor { @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - if(damage >= 20) + if(damage >= 5) { player.setHealth(player.getHealth() - 1F); return new ArmorProperties(1, 1, 2000); @@ -88,19 +88,17 @@ public class ArmorSchrabidium extends ItemArmor implements ISpecialArmor { if(armor.getItem() == ModItems.schrabidium_plate) { - player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 5, 0, true)); - player.addPotionEffect(new PotionEffect(Potion.resistance.id, 5, 0, true)); player.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 5, 0, true)); } if(armor.getItem() == ModItems.schrabidium_legs) { - player.addPotionEffect(new PotionEffect(Potion.jump.id, 5, 4, true)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, 5, 2, true)); } if(armor.getItem() == ModItems.schrabidium_boots) { - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 5, 4, true)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 5, 2, true)); } } diff --git a/com/hbm/items/gear/ModArmor.java b/com/hbm/items/gear/ModArmor.java index 43cc300ff..1a94f357c 100644 --- a/com/hbm/items/gear/ModArmor.java +++ b/com/hbm/items/gear/ModArmor.java @@ -1,11 +1,16 @@ package com.hbm.items.gear; +import com.google.common.collect.Multimap; import com.hbm.items.ModItems; import com.hbm.lib.RefStrings; import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; +import net.minecraft.world.World; public class ModArmor extends ItemArmor { diff --git a/com/hbm/items/special/ItemCustomLore.java b/com/hbm/items/special/ItemCustomLore.java index 537628b35..ccd52ec95 100644 --- a/com/hbm/items/special/ItemCustomLore.java +++ b/com/hbm/items/special/ItemCustomLore.java @@ -556,7 +556,7 @@ public class ItemCustomLore extends ItemRadioactive { @Override public EnumRarity getRarity(ItemStack p_77613_1_) { - if(this == ModItems.nugget_euphemium || this == ModItems.ingot_euphemium || this == ModItems.rod_quad_euphemium || this == ModItems.watch || this == ModItems.powder_iodine || this == ModItems.powder_thorium || this == ModItems.powder_neodymium || this == ModItems.powder_neptunium || this == ModItems.powder_astatine || this == ModItems.powder_caesium || this == ModItems.powder_strontium || this == ModItems.powder_cobalt || this == ModItems.powder_bromine || this == ModItems.powder_niobium || this == ModItems.powder_tennessine || this == ModItems.powder_cerium) + if(this == ModItems.nugget_euphemium || this == ModItems.ingot_euphemium || this == ModItems.rod_quad_euphemium || this == ModItems.plate_euphemium || this == ModItems.watch || this == ModItems.powder_iodine || this == ModItems.powder_thorium || this == ModItems.powder_neodymium || this == ModItems.powder_neptunium || this == ModItems.powder_astatine || this == ModItems.powder_caesium || this == ModItems.powder_strontium || this == ModItems.powder_cobalt || this == ModItems.powder_bromine || this == ModItems.powder_niobium || this == ModItems.powder_tennessine || this == ModItems.powder_cerium) { return EnumRarity.epic; } diff --git a/com/hbm/items/tool/ItemAssemblyTemplate.java b/com/hbm/items/tool/ItemAssemblyTemplate.java index e83e0927a..a1cb479dd 100644 --- a/com/hbm/items/tool/ItemAssemblyTemplate.java +++ b/com/hbm/items/tool/ItemAssemblyTemplate.java @@ -93,6 +93,9 @@ public class ItemAssemblyTemplate extends Item { UPGRADE_PURPLE_I, UPGRADE_PURPLE_II, UPGRADE_PURPLE_III, + UPGRADE_PINK_I, + UPGRADE_PINK_II, + UPGRADE_PINK_III, FUSE, REDCOIL_CAPACITOR, TITANIUM_FILTER, @@ -182,8 +185,6 @@ public class ItemAssemblyTemplate extends Item { MISSILE_ENDO, MISSILE_EXO, DEFAB, - LASER_BUCKSHOT, - ROCKET, MINI_NUKE, MINI_MIRV, DARK_PLUG, @@ -198,8 +199,6 @@ public class ItemAssemblyTemplate extends Item { GRENADE_PLASMA, GRENADE_TAU, GRENADE_SCHRABIDIUM, - GRENADE_MK2, - GRENADE_ASCHRAB, GRENADE_NUKE, GRENADE_ZOMG, GRENADE_BLACK_HOLE, @@ -435,6 +434,12 @@ public class ItemAssemblyTemplate extends Item { return 300; case UPGRADE_PURPLE_III: return 500; + case UPGRADE_PINK_I: + return 200; + case UPGRADE_PINK_II: + return 300; + case UPGRADE_PINK_III: + return 500; case FUSE: return 100; case REDCOIL_CAPACITOR: @@ -613,10 +618,6 @@ public class ItemAssemblyTemplate extends Item { return 350; case DEFAB: return 200; - case LASER_BUCKSHOT: - return 50; - case ROCKET: - return 30; case MINI_NUKE: return 40; case MINI_MIRV: @@ -645,10 +646,6 @@ public class ItemAssemblyTemplate extends Item { return 300; case GRENADE_SCHRABIDIUM: return 300; - case GRENADE_MK2: - return 150; - case GRENADE_ASCHRAB: - return 300; case GRENADE_NUKE: return 200; case GRENADE_ZOMG: diff --git a/com/hbm/items/weapon/GunZOMG.java b/com/hbm/items/weapon/GunZOMG.java index 918037c58..26ad97c6b 100644 --- a/com/hbm/items/weapon/GunZOMG.java +++ b/com/hbm/items/weapon/GunZOMG.java @@ -193,7 +193,7 @@ public class GunZOMG extends Item { @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { - /*if(itemstack.getTagCompound() == null) + if(itemstack.getTagCompound() == null) { list.add("Gun not validated."); } else if(itemstack.getTagCompound().getBoolean("valid")) { @@ -211,9 +211,9 @@ public class GunZOMG extends Item { list.add("Ammo: None (Requires Validation)"); list.add("Damage: 35 - 45"); list.add("Energy Damage: 10000 - 100000"); - list.add("Energy projectiles destroy blocks.");*/ - for(int i = 0; i < 25; i++) - list.add("How do I use the ZOMG? How do I use the ZOMG? How do I use the ZOMG?"); + list.add("Energy projectiles destroy blocks."); + //for(int i = 0; i < 25; i++) + // list.add("How do I use the ZOMG? How do I use the ZOMG? How do I use the ZOMG?"); } @Override diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index 60274a054..789d99feb 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -59,7 +59,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.magnet_circular, 2), new Object[] { "PSP", "MMM", "PSP", 'S', "ingotSteel", 'M', ModBlocks.fusion_conductor, 'P', "plateAdvanced" })); GameRegistry.addRecipe(new ItemStack(ModItems.cyclotron_tower, 1), new Object[] { "CDC", "CDC", "CDC", 'C', ModItems.magnet_circular, 'D', ModItems.magnet_dee }); - GameRegistry.addRecipe(new ItemStack(ModBlocks.marker_structure, 1), new Object[] { "L", "G", "R", 'L', ModItems.powder_lapis, 'G', Items.glowstone_dust, 'R', Blocks.redstone_torch }); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.marker_structure, 1), new Object[] { "L", "G", "R", 'L', "dustLapis", 'G', Items.glowstone_dust, 'R', Blocks.redstone_torch })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_aluminium, 1), new Object[] { "RAR", "ASA", "RAR", 'S', "plateSteel", 'R', "dustRedstone", 'A', ModItems.wire_aluminium })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.circuit_copper, 1), new Object[] { "RAR", "ASA", "RAR", 'S', ModItems.circuit_aluminium, 'R', "dustNetherQuartz", 'A', ModItems.wire_copper })); @@ -301,6 +301,7 @@ public class CraftingManager { GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_unobtainium, 6), new Object[] { ModItems.rod_unobtainium }); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_daffergon, 6), new Object[] { ModItems.rod_daffergon }); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_verticium, 6), new Object[] { ModItems.rod_verticium }); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_euphemium, 6), new Object[] { ModItems.rod_euphemium }); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_uranium, 12), new Object[] { ModItems.rod_dual_uranium }); GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_u235, 12), new Object[] { ModItems.rod_dual_u235 }); @@ -369,8 +370,7 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.part_copper), new Object[] { "P", "D", "P", 'P', "plateSteel", 'D', "dustCopper" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.part_plutonium), new Object[] { "P", "D", "P", 'P', "plateSteel", 'D', "dustPlutonium" })); - if(false) - GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_euphemium, 1, 34), new Object[] { ModItems.rod_quad_euphemium }); + GameRegistry.addShapelessRecipe(new ItemStack(ModItems.nugget_euphemium, 1, 34), new Object[] { ModItems.rod_quad_euphemium }); GameRegistry.addRecipe(new ItemStack(ModItems.ingot_euphemium, 1, 34), new Object[] { "###", "###", "###", '#', new ItemStack(ModItems.nugget_euphemium, 1, 34) }); GameRegistry.addRecipe(new ItemStack(ModItems.nugget_euphemium, 9, 34), new Object[] { "#", '#', new ItemStack(ModItems.ingot_euphemium, 1, 34) }); @@ -933,12 +933,13 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.cape_lpkukin, 1), new Object[] { "W W", "WIW", "WDW", 'W', new ItemStack(Item.getItemFromBlock(Blocks.wool), 1, 13), 'D', new ItemStack(Items.dye, 1, 8), 'I', "plateSteel" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.igniter, 1), new Object[] { " W", "SC", "CE", 'S', "plateSteel", 'W', ModItems.wire_schrabidium, 'C', ModItems.circuit_schrabidium, 'E', new ItemStack(ModItems.ingot_euphemium, 1, 34) })); - GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_helmet, 1), new Object[] { "EEE", "E E", 'E', new ItemStack(ModItems.ingot_euphemium, 1, 34) }); - GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_plate, 1), new Object[] { "EWE", "EEE", "EEE", 'E', new ItemStack(ModItems.ingot_euphemium, 1, 34), 'W', ModItems.watch }); - GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_legs, 1), new Object[] { "EEE", "E E", "E E", 'E', new ItemStack(ModItems.ingot_euphemium, 1, 34) }); - GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_boots, 1), new Object[] { "E E", "E E", 'E', new ItemStack(ModItems.ingot_euphemium, 1, 34) }); + GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_helmet, 1), new Object[] { "EEE", "E E", 'E', ModItems.plate_euphemium }); + GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_plate, 1), new Object[] { "EWE", "EEE", "EEE", 'E', ModItems.plate_euphemium, 'W', ModItems.watch }); + GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_legs, 1), new Object[] { "EEE", "E E", "E E", 'E', ModItems.plate_euphemium }); + GameRegistry.addRecipe(new ItemStack(ModItems.euphemium_boots, 1), new Object[] { "E E", "E E", 'E', ModItems.plate_euphemium }); GameRegistry.addRecipe(new ItemStack(ModItems.watch, 1), new Object[] { "LEL", "EWE", "LEL", 'E', new ItemStack(ModItems.ingot_euphemium, 1, 34), 'L', new ItemStack(Items.dye, 1, 4), 'W', Items.clock }); GameRegistry.addRecipe(new ItemStack(ModItems.apple_euphemium, 1), new Object[] { "EEE", "EAE", "EEE", 'E', new ItemStack(ModItems.nugget_euphemium, 1, 34), 'A', Items.apple }); + GameRegistry.addRecipe(new ItemStack(ModItems.plate_euphemium, 1), new Object[] { "AEA", "ENE", "AEA", 'E', new ItemStack(ModItems.ingot_euphemium, 1, 34), 'N', Items.nether_star, 'A', ModItems.powder_astatine }); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.mask_of_infamy, 1), new Object[] { "III", "III", " I ", 'I', "plateIron" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.designator, 1), new Object[] { " A", "#B#", "#B#", '#', "plateIron", 'A', "plateSteel", 'B', ModItems.circuit_red_copper })); diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index c8b3cee30..5ebc0bc06 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -191,6 +191,7 @@ import com.hbm.tileentity.machine.TileEntityMachineFluidTank; import com.hbm.tileentity.machine.TileEntityMachineGasFlare; import com.hbm.tileentity.machine.TileEntityMachineGenerator; import com.hbm.tileentity.machine.TileEntityMachineIGenerator; +import com.hbm.tileentity.machine.TileEntityMachineInserter; import com.hbm.tileentity.machine.TileEntityMachineMiningDrill; import com.hbm.tileentity.machine.TileEntityMachineOilWell; import com.hbm.tileentity.machine.TileEntityMachinePuF6Tank; @@ -495,6 +496,7 @@ public class MainRegistry GameRegistry.registerTileEntity(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan"); GameRegistry.registerTileEntity(TileEntityCrateIron.class, "tileentity_crate_iron"); GameRegistry.registerTileEntity(TileEntityCrateSteel.class, "tileentity_crate_steel"); + GameRegistry.registerTileEntity(TileEntityMachineInserter.class, "tileentity_inserter"); EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true); EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true); @@ -886,6 +888,8 @@ public class MainRegistry FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_puf6), new ItemStack(ModItems.cell_empty), FluidType.PUF6, 1000)); FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_antimatter), new ItemStack(ModItems.cell_empty), FluidType.AMAT, 1000)); FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_anti_schrabidium), new ItemStack(ModItems.cell_empty), FluidType.ASCHRAB, 1000)); + + FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModBlocks.ore_oil), new ItemStack(ModBlocks.ore_oil_empty), FluidType.OIL, 500)); for(int i = 1; i < FluidType.values().length; i++) { FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.fluid_tank_full, 1, i), new ItemStack(ModItems.fluid_tank_empty), FluidType.getEnum(i), 1000)); diff --git a/com/hbm/tileentity/machine/TileEntityConverterHeRf.java b/com/hbm/tileentity/machine/TileEntityConverterHeRf.java index 412130a6a..fef96bd61 100644 --- a/com/hbm/tileentity/machine/TileEntityConverterHeRf.java +++ b/com/hbm/tileentity/machine/TileEntityConverterHeRf.java @@ -21,31 +21,37 @@ public class TileEntityConverterHeRf extends TileEntity implements IConsumer, IE public void updateEntity() { if (!worldObj.isRemote) { + for(int i = 0; i < 9; i++) if(power >= 100000 && storage.getEnergyStored() + 400000 <= storage.getMaxEnergyStored()) { power -= 100000; storage.setEnergyStored(storage.getEnergyStored() + 400000); } + for(int i = 0; i < 9; i++) if(power >= 10000 && storage.getEnergyStored() + 40000 <= storage.getMaxEnergyStored()) { power -= 10000; storage.setEnergyStored(storage.getEnergyStored() + 40000); } + for(int i = 0; i < 9; i++) if(power >= 1000 && storage.getEnergyStored() + 4000 <= storage.getMaxEnergyStored()) { power -= 1000; storage.setEnergyStored(storage.getEnergyStored() + 4000); } + for(int i = 0; i < 9; i++) if(power >= 100 && storage.getEnergyStored() + 400 <= storage.getMaxEnergyStored()) { power -= 100; storage.setEnergyStored(storage.getEnergyStored() + 400); } + for(int i = 0; i < 9; i++) if(power >= 10 && storage.getEnergyStored() + 40 <= storage.getMaxEnergyStored()) { power -= 10; storage.setEnergyStored(storage.getEnergyStored() + 4); } + for(int i = 0; i < 10; i++) if(power >= 1 && storage.getEnergyStored() + 4 <= storage.getMaxEnergyStored()) { power -= 1; diff --git a/com/hbm/tileentity/machine/TileEntityConverterRfHe.java b/com/hbm/tileentity/machine/TileEntityConverterRfHe.java index 0b9163ed0..43bcf6bf8 100644 --- a/com/hbm/tileentity/machine/TileEntityConverterRfHe.java +++ b/com/hbm/tileentity/machine/TileEntityConverterRfHe.java @@ -24,31 +24,37 @@ public class TileEntityConverterRfHe extends TileEntity implements ISource, IEne public void updateEntity() { if (!worldObj.isRemote) { + for(int i = 0; i < 9; i++) if(storage.getEnergyStored() >= 400000 && power + 100000 <= maxPower) { storage.setEnergyStored(storage.getEnergyStored() - 400000); power += 100000; } + for(int i = 0; i < 9; i++) if(storage.getEnergyStored() >= 40000 && power + 10000 <= maxPower) { storage.setEnergyStored(storage.getEnergyStored() - 40000); power += 10000; } + for(int i = 0; i < 9; i++) if(storage.getEnergyStored() >= 4000 && power + 1000 <= maxPower) { storage.setEnergyStored(storage.getEnergyStored() - 4000); power += 1000; } + for(int i = 0; i < 9; i++) if(storage.getEnergyStored() >= 400 && power + 100 <= maxPower) { storage.setEnergyStored(storage.getEnergyStored() - 400); power += 100; } + for(int i = 0; i < 9; i++) if(storage.getEnergyStored() >= 40 && power + 10 <= maxPower) { storage.setEnergyStored(storage.getEnergyStored() - 40); power += 10; } + for(int i = 0; i < 10; i++) if(storage.getEnergyStored() >= 4 && power + 1 <= maxPower) { storage.setEnergyStored(storage.getEnergyStored() - 4); diff --git a/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java b/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java index 5baab291b..1ae2336fe 100644 --- a/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java +++ b/com/hbm/tileentity/machine/TileEntityMachineIGenerator.java @@ -247,7 +247,7 @@ public class TileEntityMachineIGenerator extends TileEntity implements ISidedInv } } - heat += (7 * this.canLocateRTG()); + heat += (5 * this.canLocateRTG()); heat += (3 * this.canLocateWeakRTG()); diff --git a/com/hbm/tileentity/machine/TileEntityMachineInserter.java b/com/hbm/tileentity/machine/TileEntityMachineInserter.java new file mode 100644 index 000000000..ab99d0363 --- /dev/null +++ b/com/hbm/tileentity/machine/TileEntityMachineInserter.java @@ -0,0 +1,372 @@ +package com.hbm.tileentity.machine; + +import java.util.ArrayList; +import java.util.List; + +import com.hbm.handler.FluidTypeHandler.FluidType; +import com.hbm.interfaces.IFluidAcceptor; +import com.hbm.interfaces.IFluidContainer; +import com.hbm.interfaces.IFluidSource; +import com.hbm.inventory.FluidTank; +import com.hbm.items.ModItems; +import com.hbm.lib.Library; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; + +public class TileEntityMachineInserter extends TileEntity implements ISidedInventory, IFluidContainer, IFluidSource, IFluidAcceptor { + + private ItemStack slots[]; + + //public static final int maxFill = 64 * 3; + public FluidTank tanks[]; + + private static final int[] slots_top = new int[] {0}; + private static final int[] slots_bottom = new int[] {0}; + private static final int[] slots_side = new int[] {0}; + public int age = 0; + public List list1 = new ArrayList(); + public List list2 = new ArrayList(); + public List list3 = new ArrayList(); + + private String customName; + + public TileEntityMachineInserter() { + slots = new ItemStack[9]; + tanks = new FluidTank[3]; + tanks[0] = new FluidTank(FluidType.NONE, 32000, 0); + tanks[1] = new FluidTank(FluidType.NONE, 32000, 0); + tanks[2] = new FluidTank(FluidType.NONE, 32000, 0); + } + + @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.inserter"; + } + + @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 stack) { + return false; + } + + @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 void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + NBTTagList list = nbt.getTagList("items", 10); + + slots = new ItemStack[getSizeInventory()]; + + tanks[0].readFromNBT(nbt, "content1"); + tanks[1].readFromNBT(nbt, "content2"); + tanks[2].readFromNBT(nbt, "content3"); + + 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); + } + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + NBTTagList list = new NBTTagList(); + + tanks[0].writeToNBT(nbt, "content1"); + tanks[1].writeToNBT(nbt, "content2"); + tanks[2].writeToNBT(nbt, "content3"); + + 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 int[] getAccessibleSlotsFromSide(int p_94128_1_) + { + return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side); + } + + @Override + public boolean canInsertItem(int i, ItemStack itemStack, int j) { + return false; + } + + @Override + public boolean canExtractItem(int i, ItemStack itemStack, int j) { + return false; + } + + @Override + public void updateEntity() { + + if(!worldObj.isRemote) + { + age++; + if(age >= 20) + { + age = 0; + } + + if(age == 9 || age == 19) { + if(dna1()) + fillFluidInit(tanks[0].getTankType()); + if(dna2()) + fillFluidInit(tanks[1].getTankType()); + if(dna3()) + fillFluidInit(tanks[2].getTankType()); + } + + tanks[0].setType(1, 2, slots); + tanks[1].setType(4, 5, slots); + tanks[2].setType(7, 8, slots); + tanks[0].updateTank(xCoord, yCoord, zCoord); + tanks[1].updateTank(xCoord, yCoord, zCoord); + tanks[2].updateTank(xCoord, yCoord, zCoord); + } + } + + public boolean dna1() { + if(slots[0] != null && (slots[0].getItem() == ModItems.fuse || slots[0].getItem() == ModItems.screwdriver)) + return true; + return false; + } + + public boolean dna2() { + if(slots[3] != null && (slots[3].getItem() == ModItems.fuse || slots[3].getItem() == ModItems.screwdriver)) + return true; + return false; + } + + public boolean dna3() { + if(slots[6] != null && (slots[6].getItem() == ModItems.fuse || slots[6].getItem() == ModItems.screwdriver)) + return true; + return false; + } + + @Override + public AxisAlignedBB getRenderBoundingBox() { + return TileEntity.INFINITE_EXTENT_AABB; + } + + @Override + @SideOnly(Side.CLIENT) + public double getMaxRenderDistanceSquared() + { + return 65536.0D; + } + + @Override + public void fillFluidInit(FluidType type) { + fillFluid(this.xCoord + 1, this.yCoord, this.zCoord, getTact(), type); + fillFluid(this.xCoord - 1, this.yCoord, this.zCoord, getTact(), type); + fillFluid(this.xCoord, this.yCoord + 1, this.zCoord, getTact(), type); + fillFluid(this.xCoord, this.yCoord - 1, this.zCoord, getTact(), type); + fillFluid(this.xCoord, this.yCoord, this.zCoord + 1, getTact(), type); + fillFluid(this.xCoord, this.yCoord, this.zCoord - 1, getTact(), type); + } + + @Override + public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) { + Library.transmitFluid(x, y, z, newTact, this, worldObj, type); + } + + @Override + public boolean getTact() { + if (age >= 0 && age < 10) { + return true; + } + + return false; + } + + @Override + public void setFillstate(int fill, int index) { + if(index < 3 && tanks[index] != null) + tanks[index].setFill(fill); + } + + @Override + public void setType(FluidType type, int index) { + if(index < 3 && tanks[index] != null) + tanks[index].setTankType(type); + } + + @Override + public void setAFluidFill(int i, FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + tanks[0].setFill(i); + else if(type.name().equals(tanks[1].getTankType().name())) + tanks[1].setFill(i); + else if(type.name().equals(tanks[2].getTankType().name())) + tanks[2].setFill(i); + } + + @Override + public int getAFluidFill(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + return tanks[0].getFill(); + else if(type.name().equals(tanks[1].getTankType().name())) + return tanks[1].getFill(); + else if(type.name().equals(tanks[2].getTankType().name())) + return tanks[2].getFill(); + else + return 0; + } + + @Override + public void setSFluidFill(int i, FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + tanks[0].setFill(i); + else if(type.name().equals(tanks[1].getTankType().name())) + tanks[1].setFill(i); + else if(type.name().equals(tanks[2].getTankType().name())) + tanks[2].setFill(i); + } + + @Override + public int getSFluidFill(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + return tanks[0].getFill(); + else if(type.name().equals(tanks[1].getTankType().name())) + return tanks[1].getFill(); + else if(type.name().equals(tanks[2].getTankType().name())) + return tanks[2].getFill(); + + return 0; + } + + @Override + public int getMaxAFluidFill(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + return tanks[0].getMaxFill(); + else if(type.name().equals(tanks[1].getTankType().name())) + return tanks[1].getMaxFill(); + else if(type.name().equals(tanks[2].getTankType().name())) + return tanks[2].getMaxFill(); + else + return 0; + } + + @Override + public List getFluidList(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + return list1; + if(type.name().equals(tanks[1].getTankType().name())) + return list2; + if(type.name().equals(tanks[2].getTankType().name())) + return list3; + return new ArrayList(); + } + + @Override + public void clearFluidList(FluidType type) { + if(type.name().equals(tanks[0].getTankType().name())) + list1.clear(); + if(type.name().equals(tanks[1].getTankType().name())) + list2.clear(); + if(type.name().equals(tanks[2].getTankType().name())) + list3.clear(); + } +}