From 37dbadc0a500689dfee77ae2d6651a42c1fec911 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Wed, 15 Aug 2012 16:41:41 -0400 Subject: [PATCH] Rebase for 1.3.2 Updated Methods to work with 1.3.2 --- bin/minecraft/armor/glowstone_1.png | Bin 0 -> 2158 bytes bin/minecraft/armor/glowstone_2.png | Bin 0 -> 655 bytes bin/minecraft/armor/lazuli_1.png | Bin 0 -> 1899 bytes bin/minecraft/armor/lazuli_2.png | Bin 0 -> 1390 bytes bin/minecraft/armor/obsidian_1.png | Bin 0 -> 1865 bytes bin/minecraft/armor/obsidian_2.png | Bin 0 -> 1350 bytes bin/minecraft/armor/platinum_1.png | Bin 0 -> 2111 bytes bin/minecraft/armor/platinum_2.png | Bin 0 -> 1592 bytes bin/minecraft/armor/redstone_1.png | Bin 0 -> 2164 bytes bin/minecraft/armor/redstone_2.png | Bin 0 -> 1608 bytes bin/minecraft/gui/GuiChamber.png | Bin 0 -> 3902 bytes bin/minecraft/gui/GuiCombiner.png | Bin 0 -> 4235 bytes bin/minecraft/gui/GuiCompressor.png | Bin 0 -> 3961 bytes bin/minecraft/gui/GuiCrusher.png | Bin 0 -> 4051 bytes bin/minecraft/gui/GuiStopwatch.png | Bin 0 -> 2975 bytes bin/minecraft/gui/GuiWeatherOrb.png | Bin 0 -> 3083 bytes bin/minecraft/obsidian/Combiner.png | Bin 0 -> 3769 bytes bin/minecraft/obsidian/Compressor.png | Bin 0 -> 3499 bytes bin/minecraft/obsidian/Knife.png | Bin 0 -> 264 bytes bin/minecraft/obsidian/ObsidianArrows.png | Bin 0 -> 372 bytes bin/minecraft/obsidian/items.png | Bin 0 -> 12967 bytes bin/minecraft/obsidian/terrain.png | Bin 0 -> 6391 bytes .../uberkat/obsidian/common/BlockBase.java | 68 ++ .../obsidian/common/BlockCombiner.java | 265 ++++++ .../uberkat/obsidian/common/BlockCrusher.java | 249 +++++ .../common/BlockEnrichmentChamber.java | 250 +++++ .../uberkat/obsidian/common/BlockLife.java | 66 ++ .../common/BlockObsidianContainer.java | 25 + .../obsidian/common/BlockObsidianTNT.java | 149 +++ .../common/BlockPlatinumCompressor.java | 267 ++++++ .../obsidian/common/CombinerRecipes.java | 86 ++ .../obsidian/common/CommonGuiHandler.java | 16 + .../uberkat/obsidian/common/CommonProxy.java | 76 ++ .../obsidian/common/ContainerCombiner.java | 163 ++++ .../obsidian/common/ContainerCrusher.java | 163 ++++ .../common/ContainerEnrichmentChamber.java | 163 ++++ .../common/ContainerPlatinumCompressor.java | 163 ++++ .../obsidian/common/CrusherRecipes.java | 85 ++ .../obsidian/common/DamageSourceObsidian.java | 36 + .../common/EnrichmentChamberRecipes.java | 85 ++ .../uberkat/obsidian/common/EntityKnife.java | 146 +++ .../obsidian/common/EntityObsidianArrow.java | 526 ++++++++++ .../obsidian/common/EntityObsidianTNT.java | 124 +++ .../obsidian/common/EntityProjectile.java | 394 ++++++++ .../obsidian/common/ItemBlockBase.java | 46 + .../obsidian/common/ItemLightningRod.java | 55 ++ .../uberkat/obsidian/common/ItemObsidian.java | 17 + .../obsidian/common/ItemObsidianArmor.java | 16 + .../obsidian/common/ItemObsidianAxe.java | 40 + .../obsidian/common/ItemObsidianBow.java | 125 +++ .../obsidian/common/ItemObsidianHoe.java | 62 ++ .../obsidian/common/ItemObsidianKnife.java | 114 +++ .../obsidian/common/ItemObsidianPaxel.java | 79 ++ .../obsidian/common/ItemObsidianPickaxe.java | 87 ++ .../obsidian/common/ItemObsidianSpade.java | 37 + .../obsidian/common/ItemObsidianSword.java | 104 ++ .../obsidian/common/ItemObsidianTool.java | 22 + .../obsidian/common/ItemStopwatch.java | 36 + .../obsidian/common/ItemWeatherOrb.java | 36 + .../obsidian/common/ObsidianHooks.java | 11 + .../obsidian/common/ObsidianIngots.java | 901 ++++++++++++++++++ .../obsidian/common/ObsidianUtils.java | 217 +++++ .../uberkat/obsidian/common/OreHandler.java | 26 + .../obsidian/common/PacketHandler.java | 83 ++ .../obsidian/common/PhysicsHelper.java | 43 + .../common/PlatinumCompressorRecipes.java | 86 ++ .../uberkat/obsidian/common/SlotObsidian.java | 57 ++ .../obsidian/common/ThreadServerData.java | 48 + .../obsidian/common/TileEntityCombiner.java | 378 ++++++++ .../obsidian/common/TileEntityCrusher.java | 380 ++++++++ .../common/TileEntityEnrichmentChamber.java | 378 ++++++++ .../common/TileEntityPlatinumCompressor.java | 379 ++++++++ .../net/uberkat/obsidian/common/Version.java | 41 + .../uberkat/obsidian/client/ClientProxy.java | 152 +++ .../obsidian/client/ClientTickHandler.java | 38 + .../uberkat/obsidian/client/GuiCombiner.java | 49 + .../uberkat/obsidian/client/GuiCredits.java | 76 ++ .../uberkat/obsidian/client/GuiCrusher.java | 49 + .../obsidian/client/GuiEnrichmentChamber.java | 49 + .../client/GuiPlatinumCompressor.java | 49 + .../uberkat/obsidian/client/GuiStopwatch.java | 140 +++ .../obsidian/client/GuiWeatherOrb.java | 145 +++ .../uberkat/obsidian/client/RenderKnife.java | 99 ++ .../obsidian/client/RenderObsidianArrow.java | 83 ++ .../obsidian/client/RenderObsidianTNT.java | 76 ++ .../uberkat/obsidian/client/ThreadUpdate.java | 83 ++ 86 files changed, 8557 insertions(+) create mode 100755 bin/minecraft/armor/glowstone_1.png create mode 100755 bin/minecraft/armor/glowstone_2.png create mode 100755 bin/minecraft/armor/lazuli_1.png create mode 100755 bin/minecraft/armor/lazuli_2.png create mode 100755 bin/minecraft/armor/obsidian_1.png create mode 100755 bin/minecraft/armor/obsidian_2.png create mode 100755 bin/minecraft/armor/platinum_1.png create mode 100755 bin/minecraft/armor/platinum_2.png create mode 100755 bin/minecraft/armor/redstone_1.png create mode 100755 bin/minecraft/armor/redstone_2.png create mode 100755 bin/minecraft/gui/GuiChamber.png create mode 100755 bin/minecraft/gui/GuiCombiner.png create mode 100755 bin/minecraft/gui/GuiCompressor.png create mode 100755 bin/minecraft/gui/GuiCrusher.png create mode 100644 bin/minecraft/gui/GuiStopwatch.png create mode 100644 bin/minecraft/gui/GuiWeatherOrb.png create mode 100644 bin/minecraft/obsidian/Combiner.png create mode 100644 bin/minecraft/obsidian/Compressor.png create mode 100755 bin/minecraft/obsidian/Knife.png create mode 100644 bin/minecraft/obsidian/ObsidianArrows.png create mode 100644 bin/minecraft/obsidian/items.png create mode 100755 bin/minecraft/obsidian/terrain.png create mode 100644 src/common/net/uberkat/obsidian/common/BlockBase.java create mode 100644 src/common/net/uberkat/obsidian/common/BlockCombiner.java create mode 100644 src/common/net/uberkat/obsidian/common/BlockCrusher.java create mode 100644 src/common/net/uberkat/obsidian/common/BlockEnrichmentChamber.java create mode 100644 src/common/net/uberkat/obsidian/common/BlockLife.java create mode 100644 src/common/net/uberkat/obsidian/common/BlockObsidianContainer.java create mode 100644 src/common/net/uberkat/obsidian/common/BlockObsidianTNT.java create mode 100644 src/common/net/uberkat/obsidian/common/BlockPlatinumCompressor.java create mode 100644 src/common/net/uberkat/obsidian/common/CombinerRecipes.java create mode 100644 src/common/net/uberkat/obsidian/common/CommonGuiHandler.java create mode 100644 src/common/net/uberkat/obsidian/common/CommonProxy.java create mode 100644 src/common/net/uberkat/obsidian/common/ContainerCombiner.java create mode 100644 src/common/net/uberkat/obsidian/common/ContainerCrusher.java create mode 100644 src/common/net/uberkat/obsidian/common/ContainerEnrichmentChamber.java create mode 100644 src/common/net/uberkat/obsidian/common/ContainerPlatinumCompressor.java create mode 100644 src/common/net/uberkat/obsidian/common/CrusherRecipes.java create mode 100644 src/common/net/uberkat/obsidian/common/DamageSourceObsidian.java create mode 100644 src/common/net/uberkat/obsidian/common/EnrichmentChamberRecipes.java create mode 100644 src/common/net/uberkat/obsidian/common/EntityKnife.java create mode 100644 src/common/net/uberkat/obsidian/common/EntityObsidianArrow.java create mode 100644 src/common/net/uberkat/obsidian/common/EntityObsidianTNT.java create mode 100644 src/common/net/uberkat/obsidian/common/EntityProjectile.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemBlockBase.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemLightningRod.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidian.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianArmor.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianAxe.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianBow.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianHoe.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianKnife.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianPaxel.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianPickaxe.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianSpade.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianSword.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemObsidianTool.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemStopwatch.java create mode 100644 src/common/net/uberkat/obsidian/common/ItemWeatherOrb.java create mode 100644 src/common/net/uberkat/obsidian/common/ObsidianHooks.java create mode 100644 src/common/net/uberkat/obsidian/common/ObsidianIngots.java create mode 100644 src/common/net/uberkat/obsidian/common/ObsidianUtils.java create mode 100644 src/common/net/uberkat/obsidian/common/OreHandler.java create mode 100644 src/common/net/uberkat/obsidian/common/PacketHandler.java create mode 100644 src/common/net/uberkat/obsidian/common/PhysicsHelper.java create mode 100644 src/common/net/uberkat/obsidian/common/PlatinumCompressorRecipes.java create mode 100644 src/common/net/uberkat/obsidian/common/SlotObsidian.java create mode 100644 src/common/net/uberkat/obsidian/common/ThreadServerData.java create mode 100644 src/common/net/uberkat/obsidian/common/TileEntityCombiner.java create mode 100644 src/common/net/uberkat/obsidian/common/TileEntityCrusher.java create mode 100644 src/common/net/uberkat/obsidian/common/TileEntityEnrichmentChamber.java create mode 100644 src/common/net/uberkat/obsidian/common/TileEntityPlatinumCompressor.java create mode 100644 src/common/net/uberkat/obsidian/common/Version.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/ClientProxy.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/ClientTickHandler.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/GuiCombiner.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/GuiCredits.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/GuiCrusher.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/GuiEnrichmentChamber.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/GuiPlatinumCompressor.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/GuiStopwatch.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/GuiWeatherOrb.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/RenderKnife.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/RenderObsidianArrow.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/RenderObsidianTNT.java create mode 100644 src/minecraft/net/uberkat/obsidian/client/ThreadUpdate.java diff --git a/bin/minecraft/armor/glowstone_1.png b/bin/minecraft/armor/glowstone_1.png new file mode 100755 index 0000000000000000000000000000000000000000..8a963db49f51dee4a172440707315a90d2b88e63 GIT binary patch literal 2158 zcmV-!2$A=RP)4Tx05}naRo`#hR1`jmZ&IWdKOk5~hl<6oRa0BJ8yc;~21%2p?MfD<>DVeH z9(p*dx19w`~g7O0}n_%Aq@s%d)fBDv`JHkDym6Hd+5XuAtvnwRpGmK zVkc9?T=n|PIo~X-eVh__(Z?q}P9Z-Dj?gOW6|D%o20XmjW-qs4UjrD(li^iv8@eK9k+ZFm zVRFymFOPAzG5-%Pn|1W;U4vNroTa&AxDScmEA~{ri9gr1^c?U@uwSpaNnw8l_>cP1 zd;)kMQS_;jeRSUEM_*s96y65j1$)tOrwdK{YIQMt92l|D^(E_=$Rjw{b!QT@q!)ni zR`|5oW9X5n$Wv+HVc@|^eX5yXnsHX8PF3UX~a6)MwxDE0HaPjyrlI!;jX{6Kvuh*8ej?;85ekN$?5uuCiS zBTvvVG+XTxAO{m@bvM#Jr)z6J><&E22D|vq?Y?Vkbo_DijopiF$2PET#mZ8eu=y$(ArYkv7@Ex`GL?QCc!_*KFrd&;n1r7 zqW-CFs9&fT)ZaU5gc&=gBz-DaCw(vdOp0__x+47~U6sC(E(JNe@4cTT*n6*E zVH4eoU1-&7pEV~_PRe`a7v+@vy!^5}8?Y3)UmlaER000C9NklvpM=sk!A%<$(3r;5V;p?#@)7t5p8v)|hS-OXUDo`_spod$qFX!{FhgGu?bEmvd4% z0L_Vi!M*99>Yn9+;oo^~QT-|4*lYV*kq3(t&%x^X0Ri8%NM*jsWA4 zkI_q&T@B}=^&xQo!Js!B!?fyFJ8e_tgAlj87cTaDl#^n%{KNMppG1lifSGcGE?Iu? z1pfT8FE0FY!^18%zV13vD2Z22nk_fCH+Kk}%k~G@WzOYeC$v2Uyv9BJ$syVWi^Z1nyXf`IYm-AKsUZDJf4M&;o-VJva^uYa}o?=Qc8tcz7=1${F>LU z4fP25Q{{kgQiziuh)V%|YcPG?5aEHI#1Ef-A)R_c5Y8tbSblgdu6apqQ)&`5lITfAo%n70|K7Ef4*D3wu|zQiV954%-Iu_W#lj^Lr-a8C zE3Y>NR#U6kE{REIw{0JB+U;b`(~56yG)AcX8Iut>11G5f!a#Nm6{w)$u#%7E&^h8c ziq`KrDm9yB!EF`=w^=--W1LMw7!OX|vYpuhHUw~tszMnBKXPoc6YVHl?*JYttU}c7 zC?f#3ajCjqbmG&-BnI;egwYseUx%1Od}=pH2H%IDP_W+;{is_1BE+%7s!1t!0}2V( zZm>8G!tkURC9IIC5YX#T5-*0e3d2_XSvtczfbA_M5iaGGNkbfdR*6+_rDSMSE50m^ k=|)!1&*FJCEUh#C0u=_%SkgJ$SO5S307*qoM6N<$g08kA^#A|> literal 0 HcmV?d00001 diff --git a/bin/minecraft/armor/glowstone_2.png b/bin/minecraft/armor/glowstone_2.png new file mode 100755 index 0000000000000000000000000000000000000000..69ba88e4f40f1f05379baf48140e3d4608fb4f9d GIT binary patch literal 655 zcmV;A0&x9_P)d>+wyWU5D7(eRUyO?Py`lR zIgJf)h_@ynWF)qFt$^4f9^$PP5Hb>5y;eYM5fAa!3J4jAtzIi2wupy#8)3uN*7v{0 ztyVSP0|dT`IvzIVs$1U@AnK=QnE^fq1tj4+K>=6v zMMBsvWt2TfxFxW$p4#-ZAekK<^>P5f=_fCUl=pXYIifeByrop24)*K|;N(PRQ=f#O zfXl1Qch{#5)yoUttO1Dmxy*LSLF^O&`1P*L zF+i@a^hX#~09wHD5g~41NiS&;l*-5-*<%8UDpZH8hsSEDz=ax#6JY^tHZv!Cfu~Q) zKnj2a^}B&3y)*#9!RM(17e1=(3$y2!p4^{bQiBwHMS$`^cyy+}NR0f$Ha)9&heM6m zxM6>Ra_4}bCc$LFc1@egR^|OtVLvC)p>hOo)^Am{o zWAE;L|FF*)fBrPacSX(+MC|R&697Pn5Me5dfUz;}KRW7tAONCfXMAp9c|i#M!zRF| zdq0m~U5hFymH{C-^Wb96(3wLr*A9c9+Q>O7(>^TwGXYFe2~v{;ETA9+uow}=mme~h pQAh40BWBk(nY$kzX2$P7>;vy>4Lvne)oTC%002ovPDHLkV1oBVA%g$_ literal 0 HcmV?d00001 diff --git a/bin/minecraft/armor/lazuli_1.png b/bin/minecraft/armor/lazuli_1.png new file mode 100755 index 0000000000000000000000000000000000000000..c09f87191d256ce979c1e42feb1c82f24d5dd4b0 GIT binary patch literal 1899 zcmV-x2bB1UP)4Tx0C)j~RNrgUP!#^!Wu36$i#lf!2|j3%Ze&w*L!7p2SGvtw>Nd9_NSmf@ zT$;ut?S8Na*^6&F#dq-sKKTa>*@JI;k`2ZbVfd_wB24xov!0tYO(#d#()tZ$I5%3%!zLYh@BH>w}XODA7?mkV}ap}jU$$3 zG&Mk)3Bm`(LOM&hKscCb;PVaG&Vdx+MpZJHTQ(R_;DA31$+jOGBoLXk_De?ey1m!ik&_4G zH9n^))_*|$z4!HUisgBd@awc5jn(v9k~&t~+vLrrBg4dZQ9lDnLV}JQWGLW~LJVP= zW5lZXOcog;N~F?hbX0k=IMzETla}oqM|jC!4!B+x^;@#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oDl$m%qK_=m@??E82m5CTm59`Zn`m=P3c3mu6v_t%OTTlFVj-!ZYM}U zZP=Z%05I#k{^kTphTy|(@ae4cm=y9>_rd3vq5wKMc-P;dp*KX!R7X2O0_c>Wz!eNd z0l`^d`Z!{s1t>xGqqX2$a%fY>o$UVsZ;OX?R||HQ5x*EFNC1uh_7UXF2J~4wlNK0g z1L^?wN`QZv3DBdyt%CWl%qMAs;=t~hYIrBJloQse+0kV`eFAG{8rM_9WK=b8BH1IM z1Od$@AfHTmmKQEU7{oRy2H_56nqz`zyX-yS?vT+6ntiwev;;iWB5Cn} z?j(sDVIc!G2Ot4k*u~Ma1Ds6;Oc|XZPADBpGp@5f$$ lTY_|iBTqenS(j`6`U_pKkwRGQxAFi0002ovPDHLkV1hkbhAjX9 literal 0 HcmV?d00001 diff --git a/bin/minecraft/armor/lazuli_2.png b/bin/minecraft/armor/lazuli_2.png new file mode 100755 index 0000000000000000000000000000000000000000..7f298cf1fd3935e5b8fb78fb13045fb91a01ebda GIT binary patch literal 1390 zcmV-!1(EuRP)4Tx0C)j~RNrgUP!#^!Wu36$i#lf!2|j3%Ze&w*L!7p2SGvtw>Nd9_NSmf@ zT$;ut?S8Na*^6&F#dq-sKKTa>*@JI;k`2ZbVfd_wB24xov!0tYO(#d#()tZ$I5%3%!zLYh@BH>w}XODA7?mkV}ap}jU$$3 zG&Mk)3Bm`(LOM&hKscCb;PVaG&Vdx+MpZJHTQ(R_;DA31$+jOGBoLXk_De?ey1m!ik&_4G zH9n^))_*|$z4!HUisgBd@awc5jn(v9k~&t~+vLrrBg4dZQ9lDnLV}JQWGLW~LJVP= zW5lZXOcog;N~F?hbX0k=IMzETla}oqM|jC!4!B+x^;@#I_Tc-T-6hwKycLDTx1-om z?X`jFy0R0R8-I0SrK4`)H@W4T8*Qr#2vPou<*`U!Wy(*2QP*`g=8#jD{B;Y@GL-Hm zb`n?&x~%YC_$q7)PlXr4m%r4=&fcvN%Ybn#KC7Nn&Bp8{(oE9pWVpYI^+LuN`H(R~ zTAjWmO`M83^4d@fCkA(d>*nHIFV_d2yUbnT`nd?LE^;G|!WZ>Ld?E0@Grm4ww{M7H zr`x{MWb30bTI;*hk-DO>dX$gbC-yy#suLNqvA(f>RtPJ!qGM`Gvvf}Y10`)vm-7Xa z?-7Ixe2A_siI1ydSCCID3U8SVUY86>uSnT0use_K1GZDvUFKY)t}F* z)!pahe+zh{{06Bb3f97*Uorpy0t-n*K~!i3?N~cf!!QuFJUKurYE3FG07K0T3`gJq z9Dx&2$`ierqH%VcBw20+RZ1tEgE9%NEr4o&G7v)h6Kasv8NZeX!-e zN1y}%%v}Qb#Q@$t!gezdLO*RH053Z4F(TBJVK?jnZllvTP#!wS=|KjJO}q`V?*{_n z7r+oaK?iN<5p+PKn2zCO#zmdug)cK`qY07*qoM6N<$g1`NPIsgCw literal 0 HcmV?d00001 diff --git a/bin/minecraft/armor/obsidian_1.png b/bin/minecraft/armor/obsidian_1.png new file mode 100755 index 0000000000000000000000000000000000000000..483cd21b6785e1c7923996f16df769113859ee08 GIT binary patch literal 1865 zcmV-P2e$Z$P)4Tx0C)j~RNrgUP!#^!Wu36$i#lf!2|j3%Ze&w*L!7p2SGvtw>Nd9_NSmf@ zT$;ut?S8Na*^6&F#dq-sKKTa>*@JI;k`2ZbVfd_wB24xov!0tYO(#d#()tZ$I5%3%!zLYh@BH>w}XODA7?mkV}ap}jU$$3 zG&Mk)3Bm`(LOM&hKscCb;PVaG&Vdx+MpZJHTQ(R_;DA31$+jOGBoLXk_De?ey1m!ik&_4G zH9n^))_*|$z4!HUisgBd@awc5jn(v9k~&t~+vLrrBg4dZQ9lDnLV}JQWGLW~LJVP= zW5lZXOcog;N~F?hbX0k=IMzETla}oqM|jC!4!B+x^;@#I_Tc-T-6hwKycLDTx1-om z?X`jFy0R0R8-I0SrK4`)H@W4T8*Qr#2vPou<*`U!Wy(*2QP*`g=8#jD{B;Y@GL-Hm zb`n?&x~%YC_$q7)PlXr4m%r4=&fcvN%Ybn#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8lcg{8nqhqbT6oBSVVRG8tthCm8Jp5UBYJ)DniKSCkIor%T1U;qFB07*qo IM6N<$f@OGt?*IS* literal 0 HcmV?d00001 diff --git a/bin/minecraft/armor/platinum_1.png b/bin/minecraft/armor/platinum_1.png new file mode 100755 index 0000000000000000000000000000000000000000..e7f9ec0d6ed07f5c80bf41f9872fa49126ee8217 GIT binary patch literal 2111 zcmV-F2*CG=P)4Tx04R}-Ro!pfR1`mnZ(O7nKcKOW4i$^9Ra0BJ8yc;~21%2p=|UR0&DbiW z$#rfTQ`a`O(`{9s_5yDV_yd5l2Of}kLK+Oj_Ok5(v`JGz71bo9J#^YYXp{DWs&KBa zQ@dTpxRI}aIp=pi@6k0t$5)!;m`NF6-tt{FpOKHBn3g+MAqmexC-gw4rh87hTrL7G z#)U`L!(So6-Zux@>;H3gR;i~0B%VTSS3P|m@o9jRsXML@Al^p#@G0Lx-0?i(9WEw_ zSYddU<1E8793KxjQ|c&UmW!mTC>k>?{om1c9S zUx<6_jj_!T&^M{wWM#>IBbOSf*xP<^F{$j$aOQ5Y{cT zROCL1M7^NKKL z&(yA}mSw#iM0^;IB{ZO5!wl{^Sg-*ysE~&Yz8!E;Qv(A`lu*=Clo*MpVGd>OdF6n^ zam1Jntk;<}MrqIC5$=Q>n{*R}?8oOIDUw5En2dl--Xw34!z7E+5pr-OgyQ-soSab)C%saskMla`aQLVzg0+MZf20tJU&K{hZoBrUc+U4e9&3o zw|KmGEe4#xz17wBu{f`SS_4i66?j31EjY7n{zGfhONK~c+td!TS#B}JoR}5UAd7p& z5phTyXSkK0xCeD3xaYP^o&J~#Xp9xFb0C;HHml5fA<%h1eR|qw7wxF+oNL9T1Aits?sKNIwvGaN)^WO$I^cUV)HzL_| z1K?{9p!>B*)`xfEv!4N6IG{J&h49W#Bz^(#YWw%`e_a{8n{G9m5AeR~_yl0%<7V@p zTF~*;K@^q!kvqH>6AYxoF#zcfz1#>Mu`lC

fO zK(I5g19`8HG%3lIMJfFj@#&o&@7=q*ci*WH1Ob!KY_$V`(Qp8OY1zowv}|6zcv6_S zz>1?dO<*(}@bHJnYW(!%EuPn>3S6B2zDV72!BhhXo}Rn~!1MY5_`XkRF*@anwd)A$ zn|GXs3X6{!Q$4`6Z1xVG17H}&!WGIJGlhWTG=R_pYPAYbS)@+6;#wh)gxm-pGiLID zm%r{}S~jEMfU{%N^Z&sBh0QO&4)i-dxiJ|hWhOl**UG9PfThvb%JidRYDO$rDfBl^CQNQi;g3qzyA2K0C4-8?}HET->GqZ zV>1BQ-`!DeeR=DyT3o&pLgAFS~hdGaE(IvN=2c1z>7z|Ka^RKKb-B zH9mcPaz(b;Y6r=fcikQk))5jSp4VTABwCn8hUSGBMDmOnqjY}6XgEkUVxCyI0R*~d zK)UxV1GyPsRWY>?O2+iE@9kuNVqQtgaHhrvQ zwe^znlQ6ddAkHI3!vR(P-4xMt5=pL5u6J0EV!Lb@u{f_1=O;kwyq=?y@>!UxAp%^X z&bk7Zx9(D|ckq25-}ja4`o5207*~>*VHh}0Ln$w7XN~oD>H5sNdAK1DNJG5t4~dYF zAHBCY8V=OSOY2RCY1t5!%_YlLNl?u}Y&;qcU>KjDgd52L>j{es>yx_QaT-^suVL(})xNZ-_ zFt|7mztc}kViceh8ANZ3$?tUojJt;_o^|LluG`DS1B%I)NKA`co0d&EdQN8faYl?b zTkSya3_;i*%qmKnt#)wM9dL0P53fISpvw6^RRHm7=d+JSkj$2 literal 0 HcmV?d00001 diff --git a/bin/minecraft/armor/platinum_2.png b/bin/minecraft/armor/platinum_2.png new file mode 100755 index 0000000000000000000000000000000000000000..b1bc421dd061167d932db09ad92c86bbafb64213 GIT binary patch literal 1592 zcmV-82FLk{P)4Tx04R}-Ro!pfR1`mnZ(O7nKcKOW4i$^9Ra0BJ8yc;~21%2p=|UR0&DbiW z$#rfTQ`a`O(`{9s_5yDV_yd5l2Of}kLK+Oj_Ok5(v`JGz71bo9J#^YYXp{DWs&KBa zQ@dTpxRI}aIp=pi@6k0t$5)!;m`NF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-uwGoBP`kGqr?YLxd5L8#@F% zY45Mo{zI1=>G&;J+xUqaTdn?z4*5(;jy3u<6Lz!UaQKpPPsah5A?CeS=e+6$gL_O$ z$#IuOZ$&q%5xdx8{{*Yr zn5x)mcd442I@+<|oEOzUc(cW7RYA<$K7TkQEA=kQy8W9yx$j-N;@M3Fo@_QGmQ~@? z>FIt?spe4mp@4pdMtK<(&LSjYfj015|xoBcr%VO?F?mZ8rKDAugBM2NmUrS5C;Pt`%uA za@I)H3Zu&x30w7%cg@fnq3_GNNyTr6n-5p)mxEH}%{x5a))yuI=tXQ42vsmc9ZQ7H zP)D-}1z2z~$uU?0*c%2AyesC=Xe??BKye(#A7%1`+eflZTM@I{5P}O#i8Ljl@6~D)p^z|}?e3i4%!ogAqmM&mdY{=pUkZ~qW1kuD0 zAgRYEc;JbX@|4)jxEQcN_~Qcc!-3cDb1M`oK!mn2xd zw1zBBW419o8l*xT)WuRz^`T=2SFW-!jLVdofvH zv&!Nn{2~!Rj}q^iIAXOF>5!HXaoUIodPFd~_KZLScN0wp?M*=W0rhwpKhoDM(4)ij zDj~*Jz?WaQ+mHqJIMyX7P!>@GT5Jt_8b=2k8hsub(!;m|0n`@G;o(uxzEQX#659Zr z;Xc+Xfv|C6BV5GcV}Zeg`}HD{n+^T=8LzIQYVlrpcn`wG#dT}EzP?`dz=8YCs`*Ap zFA|JR^(2@wASBID>^ToM*c4ow1nE!2G=%Xgfev<%q*}7>F8LpRL04zJ*kp~N{fG9@ z0`cBGBg+5-U~DLfWrXg#{>l=&74(Up=`MmegBCi=#pM!I!31wb z8x=4w0rc_+pFYVIg}a+& literal 0 HcmV?d00001 diff --git a/bin/minecraft/gui/GuiCompressor.png b/bin/minecraft/gui/GuiCompressor.png new file mode 100755 index 0000000000000000000000000000000000000000..2e94d61de8b87e7d25e3c3102dde2494b78291a6 GIT binary patch literal 3961 zcmeH~YdBPE8^@ounlWRP^I;mNp+b?vrcyKpIYmf0GsYn#imlP)IHN6FQ&Cb$Ly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 0000000000000000000000000000000000000000..472ed095e298fda003d77231de4c1d7c9337c0ed GIT binary patch literal 2975 zcmeH}`BzhC8prRwCQKHV5P`NxNoo=SS;V%ej4T%pjKLtL3bH4$?kqJemPL@Z_c2om9N00DCeQyfHs)0TkBmSzMjVG&745R$p=nLlBEm>+z9d7ksG&-;8o z=Xu{EZqzOtk~0Ya0GkMQ*ggONF&6{~R+vfps^%yFkdH=$g+ynAv!i>?ClMX3CK3-- zoE=_gOS1i4UEk#JWVtxZ^Cm@vq-3!^ zBlGL8Tl${sp100rF9v%S)aldP!^G7Cu`DjdydlaAg)C7AYLv<1CyZrAl`RS7%4aikpu_D zxvjX{m{Y5%K$SQLR0%B$iII2*^pBGyM0Z4jpVLq)Nbbm;!b1>wJr^L8N4ib|=R>wsyQRbR9J+g7SCdt-jJ$XDvPBjQ?BSrobqfI=HLihV%*Q&y^v7y$7UN|__^6h^&Idt|XhmR1iKS+r5bKMAa&rPKmEtD;%;POA zp@s%ko>_a*ZPbLyI1{Rp20QJ!J~PfI8qgM5boE_VP_r`r=fGk&vrz?W&ryf@i|=hl z*6OvD1j=wVDj^BE82mcalm-OV&0GKdr<){{9@*C@>0RHv9`f^(-!Xv*2wEg|HP!T76iGXm8(`IW$zFhEFswYXZm1KeDbgDb!Q;l>?cy$j)8 z7XHh^hlN#D3~LEAguU$tX8NAJdgU<^8dpVN64H3!1(t9|U4Qn>EL*@3=H&%k7)W$! z*d$M21WA1#QnSrP>!8>;w3okL)dtmkaDoIv9#B4^qU=f_@l&j{SVc34w=jF<4T+}2JgDsQrtew?%ro$KE9-SJvnzw!*3$lEM@_fcQ)ALU@;j d|1k@w1!RoT@W(|Us#;6DkNjhp}g literal 0 HcmV?d00001 diff --git a/bin/minecraft/gui/GuiWeatherOrb.png b/bin/minecraft/gui/GuiWeatherOrb.png new file mode 100644 index 0000000000000000000000000000000000000000..c52900b4ab9ac7e63bde4db35474dba4c80b5131 GIT binary patch literal 3083 zcmeH}|1;Ei9LL}L@gZOG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C`D*68Hr=~=hj zhyyn*0|u5LIm(bFNPA;8i%WKSwLo`?|ZgEX;DG&GI?7{8l{w56$CCENK%OsVuCKdh8U+Qsi7N=iT zEnn*Mp=+%>k5KR!xITShI@dPxeBc5zplzxUYHHd7OBXP|BCf9jmwaiC-5l?$iuZtL zhy@Aq1(>-Pu`b*+cp#na8rXxIe9mY89U7=LJ8ry4DsXqd?zKjf4ij&uq~}M@|Musl zKCbFG)ttLtWbzs^a9tn7$u9&j`c3n4X9Kf*%*tVQ8fKTl>@J+W4S&FC90w)eOzFq9 Tqu%b96xjb=?4E~_C$Ib$&?9}w literal 0 HcmV?d00001 diff --git a/bin/minecraft/obsidian/Compressor.png b/bin/minecraft/obsidian/Compressor.png new file mode 100644 index 0000000000000000000000000000000000000000..bd8962f36dc7fed45b07476771e322cd9a171e0e GIT binary patch literal 3499 zcmeHK`%}{g690k-fmGqzs|fT++nXEgsi0L}MUX8&7$wbc%Ja^3=U1T)@QK zpYiPDDJRBf?e=R*v=<~+^mO%1{Cmo14D7hkHeq*5K+wI(m;}>DcKS(J*~ueZr*q&H zC@}HlTCLu(6g-f-s^QVLM%cOG`vWy^w3veX3%_S+-q`= z$XW8VjDw%qz9dbiU&V%#AS>MkX@-0G9pT8c*YNU7M1$5~8yY;mm>r)6k%X@0@F@w1 zX2{Bn&u%xg?o`o?zs(aNhxL}CzB`J`RV-pwDlNhJb!Zw!m4O${UxyZ17~@zpt?!DY z2YWqwje?zvUR=Yv(1_^80b)Pa8d?NdT#_x~xFtr_WKzLOTi7SZI{>LgKd7$z2h|IU^(Kf4z#V3(oKh=4asd=t==j zAwxfeUdaQQSH|k$PqD{bVPiw=0J+|GaIm2Eel0zmXdq$3qIl%6qzWNK!J}Mt1^9GC zpuom-RA!@a8~taeqxxuQs3)ho7=>-0fr9nXe9O$^qynDIuchUM#e9{jYco7h7^k;4 zblT^a^^QyrhL^&FJ-+L(ue_`xKSFpCG;i6Ti#l5hpqdFCJN5+wMb^uT-T_{sos7+* z`?dK5M)9b;ny?&FDxsaU^U_@whssZtfjToKWLVa~kvXz*LI#q4d-9)Jy7~CJErX10 z)$c?oG&|+mm|4*bB zk3_?6HuejD^-0f>{LHFz+sH@Zdxy)ohDBT zmsz$DX`ih6t{WnaZvHTccpa~_r2KP!n8N`7C=5sSKN)ZHa;C5ORrm^LT40IOZPE(GM2S%_4iQKRUF&Z+Cy zA+?Eh5`w`KxJjA}6f0qKud{fEz*w*des^5~fEur2^|tLqqY><1ivJhD8j~IYVoKnZ z#K-ja%L;XWlK$-4^Eu;Uz^iW#ej}Ye!8Crc;xb0WzOniq-LJEijXl=*Uq>HFjkXy! z<~9%`SMAHMr8O@JYltjcUNA0*s`0t#C$(k4ckYPve7Kr7Alwh0yP?`Zf6`WsbCc}f zG&bha(QVUr{4hHGo*K&%@ucdOi4;!*{EzsYs!Mb|K3_*!`(Y*R1?1Z7Zxg$r2V{$1 znRPKthBjo8L}Czj=z1e85msYV(nvY-sov!nx{vrVJ3I}{R@Yu$~{jQ Oa5nXP%0P17jsF3j1Xy$c literal 0 HcmV?d00001 diff --git a/bin/minecraft/obsidian/Knife.png b/bin/minecraft/obsidian/Knife.png new file mode 100755 index 0000000000000000000000000000000000000000..3d1be0953879e48d674c77b4787a9013b28b631b GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJ^PVn_ArYL(fByfsXXaV*+pEda z*xWw7rSsyfw4Oqtw%rY#osv28lS|a&s)dDwRy=bMo8bF?-yhcK6DRo=#_z3az0MdL z8=K%hed^S}Hv(c4p32+(XNo>?=15!8$L;y|1AZ9zIXg2S6+3(;$;FSEuj)?1eAyje zre=v9&^hF~*n(lYQdF1mL7w?R8C?E728LA^3fSlDDVZ<#E%63pdBYA3`!*F@7B+vW w1?~A8Z!-2XvgV6Q|K(8@)y85}Sb4q9e0G$$NcK`qY literal 0 HcmV?d00001 diff --git a/bin/minecraft/obsidian/ObsidianArrows.png b/bin/minecraft/obsidian/ObsidianArrows.png new file mode 100644 index 0000000000000000000000000000000000000000..78bc25250194659a83b25d9733f1b2a272a22c21 GIT binary patch literal 372 zcmV-)0gL{LP)mT`WI&wmCWxN_?)gQJlmhzSN992^Xf z-@IZF<>7+~f$7&@J~31`zGRT$He#@o&SdDmqR)t;fK(317o>)O6szff5T-^5kZd_M zEJZehNmf=C6oixoBdNiTq@EGv8YloU=Dd|Dk*kn=WABLjdMY zpwD4Uy3$M!A3g*}!M}h1=xQw*(*+Ekk`U-~y7(B~666p-m!k`xi7vL_v1HT%qaiRF0;3@?8Ug@0nE9|; SZ5k;60000`_s&j3ql`AB>sb)%)}Let*B;ALcpdJmvqhS%TF1j=X~O#nw~ld#M!To$ES!HFJ`iuN_eB))v3@RlA_$ zoeLrbqDu~8{xmv-D)tHB5qM)H@ERfYStL&s_}lkPJECU2gZWl!Z~UfuE2Wu%MC zTOyW)fH42h-2*GFpV))&QN~!@#t@OcV<-&}a2;>7nYpOp@+OnCHTwX@%cG}k#=5Ml zwNbUtEv#tLOtry;aMZp74b>amDjw-*6WzlNk^JJG(^o8@0ps`1+!k+{hQ`zTn1p)> zY_-Lwz+fYuCz-~RGR(NUDT#G)J%<-UM$$v^TLg(W#_qLW7<4F@Sb;9y}tJKZR7ZmZQ4Avu=XyAu9UKZIelLn^OwO65Ut|( zgV#R=Ia3=Pa87$IAs*{sQ7keV%KNsoLq{E@8ZUx4BMgMGAH4g1djFA~9H&z|KdiZN z3_s>p&g8YD5U$!-dsfS(ALoJk;<04Op!7rm(obSp@g2LM+^eQU32i1_x^(qqEwAz+ zxm1%Bvbn0m9P~w{#aSU%qGh{-FHBt-b}5Q%3J0EkOo?~V4hEDrHI!i;WO9tIuvlg= zSBdWL2x%PpdETtd%l&ar0C^zf14@sSUyxbUm(`U@KA{qy2lSZZ6_2V?kwVS5TcVT? zHpicdJ0N=Mfup4Is>6zMs-{qc6(oUVUL(8vKvs|!6PLU-Qpp0Ktx-5$EGwjv%ay^) zD91!(*+I-I@79!$s30S=?3B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hvGUlQ`bkxlG?`zRy#^5t-;bs;@v&rsX*LO!$vu(hL=6Zp|Wh8HW5rQlEGH3A9Ve8=P zE&oR`ad!tT%@+fk`uCf55CBj*5>4gG*p5SQC|Gw4LcW|^CYqOF{3E90l-+t{#K(d= z(=}vg`SM+`l3cy^O(A7lg#L(((wr0ioH9qh>=<2yPz=*_gH_SY2L|h{R}MUez9Hq4 zOh`{h7Kajdkf(a&sXQa5ng|gEYauRO>tK!-mnkPSO*HMw4heFxo~`w@4IBj50DNDL z$LB+F_FxNiVU3-+734A`B!o-%-BzHT6-45EGqAOVzIS_VP43B6N}ilwY>h5Qt*324 z@vx``5aBFt_>DW#1JGu1%^xj0H2zG7C@RB{lUzBxl+)L|cRzUwK^==ze$%CL+^(Fi z;l>&p?=jkGOdS63WIy?z)NwXt9}tJFkC)bSeq#+UbLj|0QJiCOzOa!cgIgNX1HZ-u zAIdObEI-a*V2&#RDZ3(f8BRLzgM6&+q=DVZek4fwLk8#&Jwf- R_zx(6(OF~tqB9Pm{|DZ3lXL(8 literal 0 HcmV?d00001 diff --git a/bin/minecraft/obsidian/terrain.png b/bin/minecraft/obsidian/terrain.png new file mode 100755 index 0000000000000000000000000000000000000000..3f8663cea493a61e832026371799ee7f6c01ef08 GIT binary patch literal 6391 zcmchcXH=8f*2kaF1W|}!8&QE#EEE}~286^x$ASZ>2uKSSLW zQIJGR5(F_~=v7LHNC_nc2uTQp1xG6{rbf&6AKorFYCQG( zu5aphz8t!2cUgW4Vfa$q8~pV#_C2g=Lln4nASovPm@w>7tk7UMoFxiSSDMRR%ideo)m#eLF` z?az&9H|*@hmD|vi$(HMWan_-1w{#cl`ucj*$ftzxK`x`3adU(BgqpVPpgAKR9S|bo zS+XM*YgtjuDPP2sQMynB=}^J1)P+w9wsZN7^RV5J*<%Z`Re z=0f27p?!PC7d>PPrS{kXm0>un?~8YM>{r5w(6Qh5Ik6WB*Yx%K&2LLhXQ=B1YjM8) zdQXd3BuTP_5s0$9o$J2N=RIkb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DW)-M^I&|+HQ!#Gq7Rp z6TieF7D0jLr|)YZbTR-rXoA}RSJ0cS2ve(7y7z5CrNQp~bBLNxz6bIoH>{8*uk3eA zQDKuE0J(Jh^hv04tR@1eOFs*V{sdyS=~VJs1uzO46?D-Jk-Hb1d~()Pj7C_3{AB*L z9(rjNL?L(Y>7xg9pbh}!zbfUX{zqbz0B}?P*P!DGdjtAL$IjZ#h(*j16&>jB0Oa;> zak}6V2r)A5F(B6t9^%rqjlb&Pz^n0>2Z6_U)_ztwdS2ztR$v7-m*$n+4L45*OpfBLI;eB0%A?-<>V4{qX5%a`n#1C>OjSZ zo8Ckr&Vx53A^+G)x#%FU!hcf=Wa^K^q80xF3>=2PL@O%jfVz$Y9i?{1faptL)gMwT z=qy{kP=Mav5d|E4UJsR<1ZDl}gNj!C;PyWx#OXZ;6#@wv|9d$46C``&|6utC?;!Nb zu4;y$Jt7xOUb`RM{#(LH zgP%Zm1_}9P#oxlwpCAd^!yhdF;2m6fAM67GA5D%?u)oEk{=^ZdAwRhNw}eNKjk`dF zpbp@v{(3+96OR6;wSk=f;fX&i3tXv7mRD6qfPT~j`8zD?PaILIt>mX-1xLNx3;v-2 O96jW4u;f>tn12APO7i&t literal 0 HcmV?d00001 diff --git a/src/common/net/uberkat/obsidian/common/BlockBase.java b/src/common/net/uberkat/obsidian/common/BlockBase.java new file mode 100644 index 000000000..9c0a02ad3 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockBase.java @@ -0,0 +1,68 @@ +package net.uberkat.obsidian.common; +import java.util.ArrayList; +import java.util.Random; + +import cpw.mods.fml.common.registry.BlockProxy; + +import net.minecraft.src.*; + +public class BlockBase extends Block implements BlockProxy +{ + public BlockBase(int i, int j) + { + super(i, j, Material.iron); + + if(blockID == ObsidianIngots.platinumOreID) + { + setHardness(3F); + setResistance(5F); + } + if(blockID == ObsidianIngots.refinedGlowstoneID || blockID == ObsidianIngots.refinedObsidianID || blockID == ObsidianIngots.coalBlockID || blockID == ObsidianIngots.redstoneBlockID || blockID == ObsidianIngots.platinumBlockID) + { + setHardness(5F); + setResistance(10F); + if(blockID == ObsidianIngots.refinedObsidianID) + { + setLightValue(0.5F); + } + if(blockID == ObsidianIngots.refinedGlowstoneID) + { + setLightValue(0.875F); + } + } + } + + public int idDropped(int i, Random random) + { + return this.blockID; + } + + public int quantityDropped(Random random) + { + return 1; + } + + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3) + { + if(blockID == ObsidianIngots.refinedObsidianID) + { + entityplayer.openGui(ObsidianIngots.instance, 19, world, x, y, z); + } + return false; + } + + public void addCreativeItems(ArrayList itemList) + { + if(blockID != ObsidianIngots.platinumOreID) + { + itemList.add(new ItemStack(this)); + } + else { + //Do nothing + } + } + + public String getTextureFile() { + return "/obsidian/terrain.png"; + } +} \ No newline at end of file diff --git a/src/common/net/uberkat/obsidian/common/BlockCombiner.java b/src/common/net/uberkat/obsidian/common/BlockCombiner.java new file mode 100644 index 000000000..dbcbea098 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockCombiner.java @@ -0,0 +1,265 @@ +package net.uberkat.obsidian.common; + +import java.util.ArrayList; +import java.util.Random; + +import cpw.mods.fml.common.registry.BlockProxy; +import net.minecraft.src.*; + +public class BlockCombiner extends BlockContainer implements BlockProxy +{ + private Random combinerRand = new Random(); + + private static boolean keepCombinerInventory = false; + private static int currentTextureIndex = 0; + + public BlockCombiner(int par1) + { + super(par1, Material.iron); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + int var5 = par1World.getBlockId(par2, par3, par4 - 1); + int var6 = par1World.getBlockId(par2, par3, par4 + 1); + int var7 = par1World.getBlockId(par2 - 1, par3, par4); + int var8 = par1World.getBlockId(par2 + 1, par3, par4); + byte var9 = 3; + + if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) + { + var9 = 3; + } + + if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) + { + var9 = 2; + } + + if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) + { + var9 = 5; + } + + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, var9); + } + } + + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) + { + int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var6 == 0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2); + } + + if (var6 == 1) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 5); + } + + if (var6 == 2) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 3); + } + + if (var6 == 3) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 4); + } + } + + public int idDropped(int par1, Random par2Random, int par3) + { + return ObsidianIngots.combinerID; + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + int metadata = world.getBlockMetadata(x, y, z); + if(metadata > 5) return 14; + else return 0; + } + + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + setDefaultDirection(par1World, par2, par3, par4); + super.onBlockAdded(par1World, par2, par3, par4); + } + + public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + { + int metadata = world.getBlockMetadata(x, y, z); + int sideMeta = (metadata > 5 ? metadata - 8 : metadata); + return side != sideMeta ? 16 : (metadata > 5 ? currentTextureIndex : 17); + } + + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if(currentTextureIndex < 15 && currentTextureIndex > -1) + { + currentTextureIndex++; + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + } + else if(currentTextureIndex == 15) + { + currentTextureIndex = 0; + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + } + + int var6 = par1World.getBlockMetadata(par2, par3, par4); + if (var6 > 5) + { + int metadata = (var6 - 8); + float var7 = (float)par2 + 0.5F; + float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; + float var9 = (float)par4 + 0.5F; + float var10 = 0.52F; + float var11 = par5Random.nextFloat() * 0.6F - 0.3F; + + if (metadata == 4) + { + par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 5) + { + par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 2) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 3) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + } + } + } + + public int getBlockTextureFromSideAndMetadata(int side, int meta) + { + return side != 3 ? 16 : (meta > 5 ? 0 : 17); + } + + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int i1, float f1, float f2, float f3) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityCombiner var6 = (TileEntityCombiner)par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null) + { + par5EntityPlayer.openGui(ObsidianIngots.instance, 23, par1World, par2, par3, par4); + } + + return true; + } + } + + public static void updateCombinerBlockState(boolean par0, World par1World, int par2, int par3, int par4) + { + int var5 = par1World.getBlockMetadata(par2, par3, par4); + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + keepCombinerInventory = true; + + if (par0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5+8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + else + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5-8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + + keepCombinerInventory = false; + + if (var6 != null) + { + var6.validate(); + par1World.setBlockTileEntity(par2, par3, par4, var6); + } + } + + public void breakBlock(World par1World, int par2, int par3, int par4, int i1, int i2) + { + if (!keepCombinerInventory) + { + TileEntityCombiner var5 = (TileEntityCombiner)par1World.getBlockTileEntity(par2, par3, par4); + + if (var5 != null) + { + for (int var6 = 0; var6 < var5.getSizeInventory(); ++var6) + { + ItemStack var7 = var5.getStackInSlot(var6); + + if (var7 != null) + { + float var8 = this.combinerRand.nextFloat() * 0.8F + 0.1F; + float var9 = this.combinerRand.nextFloat() * 0.8F + 0.1F; + float var10 = this.combinerRand.nextFloat() * 0.8F + 0.1F; + + while (var7.stackSize > 0) + { + int var11 = this.combinerRand.nextInt(21) + 10; + + if (var11 > var7.stackSize) + { + var11 = var7.stackSize; + } + + var7.stackSize -= var11; + EntityItem var12 = new EntityItem(par1World, (double)((float)par2 + var8), (double)((float)par3 + var9), (double)((float)par4 + var10), new ItemStack(var7.itemID, var11, var7.getItemDamage())); + + if (var7.hasTagCompound()) + { + var12.item.setTagCompound((NBTTagCompound)var7.getTagCompound().copy()); + } + + float var13 = 0.05F; + var12.motionX = (double)((float)this.combinerRand.nextGaussian() * var13); + var12.motionY = (double)((float)this.combinerRand.nextGaussian() * var13 + 0.2F); + var12.motionZ = (double)((float)this.combinerRand.nextGaussian() * var13); + par1World.spawnEntityInWorld(var12); + } + } + } + } + } + + super.breakBlock(par1World, par2, par3, par4, i1, i2); + } + + public void addCreativeItems(ArrayList itemList) + { + itemList.add(new ItemStack(this)); + } + + public String getTextureFile() + { + return "/obsidian/Combiner.png"; + } + + public TileEntity createNewTileEntity(World var1) { + return new TileEntityCombiner(); + } +} diff --git a/src/common/net/uberkat/obsidian/common/BlockCrusher.java b/src/common/net/uberkat/obsidian/common/BlockCrusher.java new file mode 100644 index 000000000..cc8145ade --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockCrusher.java @@ -0,0 +1,249 @@ +package net.uberkat.obsidian.common; + +import java.util.ArrayList; +import java.util.Random; + +import cpw.mods.fml.common.registry.BlockProxy; +import net.minecraft.src.*; + +public class BlockCrusher extends BlockObsidianContainer implements BlockProxy +{ + private Random crusherRand = new Random(); + + private static boolean keepCrusherInventory = false; + + public BlockCrusher(int par1) + { + super(par1, Material.iron); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + int var5 = par1World.getBlockId(par2, par3, par4 - 1); + int var6 = par1World.getBlockId(par2, par3, par4 + 1); + int var7 = par1World.getBlockId(par2 - 1, par3, par4); + int var8 = par1World.getBlockId(par2 + 1, par3, par4); + byte var9 = 3; + + if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) + { + var9 = 3; + } + + if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) + { + var9 = 2; + } + + if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) + { + var9 = 5; + } + + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, var9); + } + } + + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) + { + int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var6 == 0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2); + } + + if (var6 == 1) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 5); + } + + if (var6 == 2) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 3); + } + + if (var6 == 3) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 4); + } + } + + public int idDropped(int par1, Random par2Random, int par3) + { + return ObsidianIngots.crusherID; + } + + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + setDefaultDirection(par1World, par2, par3, par4); + super.onBlockAdded(par1World, par2, par3, par4); + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + int metadata = world.getBlockMetadata(x, y, z); + if(metadata > 5) return 14; + else return 0; + } + + public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + { + int metadata = world.getBlockMetadata(x, y, z); + int sideMeta = (metadata > 5 ? metadata - 8 : metadata); + return side != sideMeta ? 2 : (metadata > 5 ? 16 : 17); + } + + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + int var6 = par1World.getBlockMetadata(par2, par3, par4); + if (var6 > 5) + { + int metadata = (var6 - 8); + float var7 = (float)par2 + 0.5F; + float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; + float var9 = (float)par4 + 0.5F; + float var10 = 0.52F; + float var11 = par5Random.nextFloat() * 0.6F - 0.3F; + + if (metadata == 4) + { + par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 5) + { + par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 2) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 3) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + } + } + } + + public int getBlockTextureFromSideAndMetadata(int side, int meta) + { + return side != 3 ? 2 : (meta > 5 ? 16 : 17); + } + + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int i1, float f1, float f2, float f3) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityCrusher var6 = (TileEntityCrusher)par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null) + { + par5EntityPlayer.openGui(ObsidianIngots.instance, 24, par1World, par2, par3, par4); + } + + return true; + } + } + + public static void updateCrusherBlockState(boolean par0, World par1World, int par2, int par3, int par4) + { + int var5 = par1World.getBlockMetadata(par2, par3, par4); + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + keepCrusherInventory = true; + + if (par0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5+8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + else + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5-8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + + keepCrusherInventory = false; + + if (var6 != null) + { + var6.validate(); + par1World.setBlockTileEntity(par2, par3, par4, var6); + } + } + + public TileEntity getBlockEntity() + { + return new TileEntityCrusher(); + } + + public void breakBlock(World par1World, int par2, int par3, int par4, int i1, int i2) + { + if (!keepCrusherInventory) + { + TileEntityCrusher var5 = (TileEntityCrusher)par1World.getBlockTileEntity(par2, par3, par4); + + if (var5 != null) + { + for (int var6 = 0; var6 < var5.getSizeInventory(); ++var6) + { + ItemStack var7 = var5.getStackInSlot(var6); + + if (var7 != null) + { + float var8 = this.crusherRand.nextFloat() * 0.8F + 0.1F; + float var9 = this.crusherRand.nextFloat() * 0.8F + 0.1F; + float var10 = this.crusherRand.nextFloat() * 0.8F + 0.1F; + + while (var7.stackSize > 0) + { + int var11 = this.crusherRand.nextInt(21) + 10; + + if (var11 > var7.stackSize) + { + var11 = var7.stackSize; + } + + var7.stackSize -= var11; + EntityItem var12 = new EntityItem(par1World, (double)((float)par2 + var8), (double)((float)par3 + var9), (double)((float)par4 + var10), new ItemStack(var7.itemID, var11, var7.getItemDamage())); + + if (var7.hasTagCompound()) + { + var12.item.setTagCompound((NBTTagCompound)var7.getTagCompound().copy()); + } + + float var13 = 0.05F; + var12.motionX = (double)((float)this.crusherRand.nextGaussian() * var13); + var12.motionY = (double)((float)this.crusherRand.nextGaussian() * var13 + 0.2F); + var12.motionZ = (double)((float)this.crusherRand.nextGaussian() * var13); + par1World.spawnEntityInWorld(var12); + } + } + } + } + } + + super.breakBlock(par1World, par2, par3, par4, i1, i2); + } + + public void addCreativeItems(ArrayList itemList) + { + itemList.add(new ItemStack(this)); + } +} diff --git a/src/common/net/uberkat/obsidian/common/BlockEnrichmentChamber.java b/src/common/net/uberkat/obsidian/common/BlockEnrichmentChamber.java new file mode 100644 index 000000000..16030ff83 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockEnrichmentChamber.java @@ -0,0 +1,250 @@ +package net.uberkat.obsidian.common; + +import java.util.ArrayList; +import java.util.Random; + +import cpw.mods.fml.common.registry.BlockProxy; +import net.minecraft.src.*; + +public class BlockEnrichmentChamber extends BlockObsidianContainer implements BlockProxy +{ + private Random chamberRand = new Random(); + + private static boolean keepChamberInventory = false; + + public BlockEnrichmentChamber(int par1) + { + super(par1, Material.iron); + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + int metadata = world.getBlockMetadata(x, y, z); + if(metadata > 5) return 14; + else return 0; + } + + /** + * Called when the block is placed in the world. + */ + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) + { + int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var6 == 0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2); + } + + if (var6 == 1) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 5); + } + + if (var6 == 2) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 3); + } + + if (var6 == 3) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 4); + } + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + int var5 = par1World.getBlockId(par2, par3, par4 - 1); + int var6 = par1World.getBlockId(par2, par3, par4 + 1); + int var7 = par1World.getBlockId(par2 - 1, par3, par4); + int var8 = par1World.getBlockId(par2 + 1, par3, par4); + byte var9 = 3; + + if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) + { + var9 = 3; + } + + if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) + { + var9 = 2; + } + + if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) + { + var9 = 5; + } + + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, var9); + } + } + + public int idDropped(int par1, Random par2Random, int par3) + { + return ObsidianIngots.enrichmentChamberID; + } + + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + setDefaultDirection(par1World, par2, par3, par4); + super.onBlockAdded(par1World, par2, par3, par4); + } + + public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + { + int metadata = world.getBlockMetadata(x, y, z); + int sideMeta = (metadata > 5 ? metadata - 8 : metadata); + return side != sideMeta ? 2 : (metadata > 5 ? 8 : 9); + } + + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + int var6 = par1World.getBlockMetadata(par2, par3, par4); + if (var6 > 5) + { + int metadata = (var6 - 8); + float var7 = (float)par2 + 0.5F; + float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; + float var9 = (float)par4 + 0.5F; + float var10 = 0.52F; + float var11 = par5Random.nextFloat() * 0.6F - 0.3F; + + if (metadata == 4) + { + par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 5) + { + par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 2) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 3) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + } + } + } + + public int getBlockTextureFromSideAndMetadata(int side, int meta) + { + return side != 3 ? 2 : (meta > 5 ? 8 : 9); + } + + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int i1, float f1, float f2, float f3) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityEnrichmentChamber var6 = (TileEntityEnrichmentChamber)par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null) + { + par5EntityPlayer.openGui(ObsidianIngots.instance, 21, par1World, par2, par3, par4); + } + + return true; + } + } + + public static void updateChamberBlockState(boolean par0, World par1World, int par2, int par3, int par4) + { + int var5 = par1World.getBlockMetadata(par2, par3, par4); + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + keepChamberInventory = true; + + if (par0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5+8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + else + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5-8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + + keepChamberInventory = false; + if (var6 != null) + { + var6.validate(); + par1World.setBlockTileEntity(par2, par3, par4, var6); + } + } + + public TileEntity getBlockEntity() + { + return new TileEntityEnrichmentChamber(); + } + + public void onBlockRemoval(World par1World, int par2, int par3, int par4, int i1, int i2) + { + if(!keepChamberInventory) + { + TileEntityEnrichmentChamber var5 = (TileEntityEnrichmentChamber)par1World.getBlockTileEntity(par2, par3, par4); + + if (var5 != null) + { + for (int var6 = 0; var6 < var5.getSizeInventory(); ++var6) + { + ItemStack var7 = var5.getStackInSlot(var6); + + if (var7 != null) + { + float var8 = this.chamberRand.nextFloat() * 0.8F + 0.1F; + float var9 = this.chamberRand.nextFloat() * 0.8F + 0.1F; + float var10 = this.chamberRand.nextFloat() * 0.8F + 0.1F; + + while (var7.stackSize > 0) + { + int var11 = this.chamberRand.nextInt(21) + 10; + + if (var11 > var7.stackSize) + { + var11 = var7.stackSize; + } + + var7.stackSize -= var11; + EntityItem var12 = new EntityItem(par1World, (double)((float)par2 + var8), (double)((float)par3 + var9), (double)((float)par4 + var10), new ItemStack(var7.itemID, var11, var7.getItemDamage())); + + if (var7.hasTagCompound()) + { + var12.item.setTagCompound((NBTTagCompound)var7.getTagCompound().copy()); + } + + float var13 = 0.05F; + var12.motionX = (double)((float)this.chamberRand.nextGaussian() * var13); + var12.motionY = (double)((float)this.chamberRand.nextGaussian() * var13 + 0.2F); + var12.motionZ = (double)((float)this.chamberRand.nextGaussian() * var13); + par1World.spawnEntityInWorld(var12); + } + } + } + } + } + super.breakBlock(par1World, par2, par3, par4, i1, i2); + } + + public void addCreativeItems(ArrayList itemList) + { + itemList.add(new ItemStack(this)); + } +} diff --git a/src/common/net/uberkat/obsidian/common/BlockLife.java b/src/common/net/uberkat/obsidian/common/BlockLife.java new file mode 100644 index 000000000..bbaf7b8a8 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockLife.java @@ -0,0 +1,66 @@ +package net.uberkat.obsidian.common; + +import java.util.ArrayList; +import java.util.Random; + +import cpw.mods.fml.common.registry.BlockProxy; + +import net.minecraft.src.*; + +public class BlockLife extends Block implements BlockProxy +{ + private Random lifeRand; + + public BlockLife(int i, int j) + { + super(i, j, Material.iron); + lifeRand = new Random(); + setHardness(1F); + setResistance(3F); + setLightValue(2F); + } + + public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) + { + if(!world.isRemote) + { + int random = lifeRand.nextInt(3); + world.spawnParticle("hugeexplosion", i, j, k, 0.0D, 0.0D, 0.0D); + switch(random) + { + case 0: + entityplayer.inventory.addItemStackToInventory(new ItemStack(ObsidianIngots.Stopwatch, 1)); + world.setBlock(i, j, k, 0); + break; + case 1: + entityplayer.inventory.addItemStackToInventory(new ItemStack(ObsidianIngots.LightningRod, 1)); + world.setBlock(i, j, k, 0); + break; + case 2: + entityplayer.inventory.addItemStackToInventory(new ItemStack(ObsidianIngots.WeatherOrb, 1)); + world.setBlock(i, j, k, 0); + break; + } + } + return true; + } + + public int idDropped(int i, Random random) + { + return 0; + } + + public int quantityDropped(Random random) + { + return 0; + } + + public void addCreativeItems(ArrayList itemList) + { + itemList.add(new ItemStack(this)); + } + + public String getTextureFile() { + return "/obsidian/terrain.png"; + } +} diff --git a/src/common/net/uberkat/obsidian/common/BlockObsidianContainer.java b/src/common/net/uberkat/obsidian/common/BlockObsidianContainer.java new file mode 100644 index 000000000..1a234fdbf --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockObsidianContainer.java @@ -0,0 +1,25 @@ +package net.uberkat.obsidian.common; + +import java.util.ArrayList; + +import cpw.mods.fml.common.registry.BlockProxy; + +import net.minecraft.src.*; + +public class BlockObsidianContainer extends BlockContainer implements BlockProxy +{ + public BlockObsidianContainer(int i, Material material) + { + super(i, material); + } + + public TileEntity createNewTileEntity(World world) + { + return null; + } + + public String getTextureFile() + { + return "/obsidian/terrain.png"; + } +} diff --git a/src/common/net/uberkat/obsidian/common/BlockObsidianTNT.java b/src/common/net/uberkat/obsidian/common/BlockObsidianTNT.java new file mode 100644 index 000000000..de6ea06a2 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockObsidianTNT.java @@ -0,0 +1,149 @@ +package net.uberkat.obsidian.common; + +import java.util.ArrayList; +import java.util.Random; + +import cpw.mods.fml.common.registry.BlockProxy; +import net.minecraft.src.*; + +public class BlockObsidianTNT extends Block implements BlockProxy +{ + public BlockObsidianTNT(int par1) + { + super(par1, Material.tnt); + setStepSound(Block.soundGrassFootstep); + setHardness(0.0F); + setResistance(0.0F); + } + + /** + * Returns the block texture based on the side being looked at. Args: side + */ + public int getBlockTextureFromSide(int par1) + { + if(par1 == 1) + { + return 5; + } + if(par1 == 0) + { + return 7; + } + else { + return 6; + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + + if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) + { + this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); + par1World.setBlockWithNotify(par2, par3, par4, 0); + } + } + + /** + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor blockID + */ + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) + { + if (par5 > 0 && Block.blocksList[par5].canProvidePower() && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) + { + this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); + par1World.setBlockWithNotify(par2, par3, par4, 0); + } + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(Random par1Random) + { + return 0; + } + + /** + * Called upon the block being destroyed by an explosion + */ + public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + EntityObsidianTNT var5 = new EntityObsidianTNT(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F)); + var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; + par1World.spawnEntityInWorld(var5); + } + } + + /** + * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData + */ + public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) + { + if (!par1World.isRemote) + { + if ((par5 & 1) == 0) + { + this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(ObsidianIngots.ObsidianTNT, 1, 0)); + } + else + { + EntityObsidianTNT var6 = new EntityObsidianTNT(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F)); + par1World.spawnEntityInWorld(var6); + par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); + } + } + } + + /** + * Called when the block is clicked by a player. Args: x, y, z, entityPlayer + */ + public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) + { + super.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); + } + + /** + * Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the + * block. + */ + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int i1, float f1, float f2, float f3) + { + if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.shiftedIndex) + { + this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); + par1World.setBlockWithNotify(par2, par3, par4, 0); + return true; + } + else + { + return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, i1, f1, f2, f3); + } + } + + /** + * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage + * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. + */ + protected ItemStack createStackedBlock(int par1) + { + return null; + } + + public void addCreativeItems(ArrayList itemList) + { + itemList.add(new ItemStack(this)); + } + + public String getTextureFile() + { + return "/obsidian/terrain.png"; + } +} diff --git a/src/common/net/uberkat/obsidian/common/BlockPlatinumCompressor.java b/src/common/net/uberkat/obsidian/common/BlockPlatinumCompressor.java new file mode 100644 index 000000000..0c3b66761 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/BlockPlatinumCompressor.java @@ -0,0 +1,267 @@ +package net.uberkat.obsidian.common; + +import java.util.ArrayList; +import java.util.Random; + +import cpw.mods.fml.common.registry.BlockProxy; +import net.minecraft.src.*; + +public class BlockPlatinumCompressor extends BlockContainer implements BlockProxy +{ + private Random compressorRand = new Random(); + + private static boolean keepCompressorInventory = false; + + private static int currentTextureIndex; + + public BlockPlatinumCompressor(int par1) + { + super(par1, Material.iron); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + int var5 = par1World.getBlockId(par2, par3, par4 - 1); + int var6 = par1World.getBlockId(par2, par3, par4 + 1); + int var7 = par1World.getBlockId(par2 - 1, par3, par4); + int var8 = par1World.getBlockId(par2 + 1, par3, par4); + byte var9 = 3; + + if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) + { + var9 = 3; + } + + if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) + { + var9 = 2; + } + + if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) + { + var9 = 5; + } + + if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) + { + var9 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, var9); + } + } + + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) + { + int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + if (var6 == 0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2); + } + + if (var6 == 1) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 5); + } + + if (var6 == 2) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 3); + } + + if (var6 == 3) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 4); + } + } + + public int idDropped(int par1, Random par2Random, int par3) + { + return ObsidianIngots.platinumCompressorID; + } + + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + setDefaultDirection(par1World, par2, par3, par4); + super.onBlockAdded(par1World, par2, par3, par4); + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + int metadata = world.getBlockMetadata(x, y, z); + if(metadata > 5) return 14; + else return 0; + } + + public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + { + int metadata = world.getBlockMetadata(x, y, z); + int sideMeta = (metadata > 5 ? metadata - 8 : metadata); + return side != sideMeta ? 16 : (metadata > 5 ? currentTextureIndex : 17); + } + + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if(currentTextureIndex < 15 && currentTextureIndex > -1) + { + currentTextureIndex++; + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + } + else if(currentTextureIndex == 15) + { + currentTextureIndex = 0; + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + } + + int var6 = par1World.getBlockMetadata(par2, par3, par4); + if (var6 > 5) + { + int metadata = (var6 - 8); + float var7 = (float)par2 + 0.5F; + float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; + float var9 = (float)par4 + 0.5F; + float var10 = 0.52F; + float var11 = par5Random.nextFloat() * 0.6F - 0.3F; + + if (metadata == 4) + { + par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 5) + { + par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 2) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); + } + else if (metadata == 3) + { + par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + par1World.spawnParticle("reddust", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + } + } + } + + public int getBlockTextureFromSideAndMetadata(int side, int meta) + { + return side != 3 ? 16 : (meta > 5 ? 0 : 17); + } + + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int i1, float f1, float f2, float f3) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityPlatinumCompressor var6 = (TileEntityPlatinumCompressor)par1World.getBlockTileEntity(par2, par3, par4); + + if (var6 != null) + { + par5EntityPlayer.openGui(ObsidianIngots.instance, 22, par1World, par2, par3, par4); + } + + return true; + } + } + + public static void updateCompressorBlockState(boolean par0, World par1World, int par2, int par3, int par4) + { + int var5 = par1World.getBlockMetadata(par2, par3, par4); + TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + keepCompressorInventory = true; + + if (par0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5+8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + else + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, var5-8); + par1World.markBlockAsNeedsUpdate(par2, par3, par4); + par1World.updateAllLightTypes(par2, par3, par4); + } + + keepCompressorInventory = false; + + if (var6 != null) + { + var6.validate(); + par1World.setBlockTileEntity(par2, par3, par4, var6); + } + } + + public TileEntity createNewTileEntity(World world) + { + return new TileEntityPlatinumCompressor(); + } + + public void breakBlock(World par1World, int par2, int par3, int par4, int i1, int i2) + { + if (!keepCompressorInventory) + { + TileEntityPlatinumCompressor var5 = (TileEntityPlatinumCompressor)par1World.getBlockTileEntity(par2, par3, par4); + + if (var5 != null) + { + for (int var6 = 0; var6 < var5.getSizeInventory(); ++var6) + { + ItemStack var7 = var5.getStackInSlot(var6); + + if (var7 != null) + { + float var8 = this.compressorRand.nextFloat() * 0.8F + 0.1F; + float var9 = this.compressorRand.nextFloat() * 0.8F + 0.1F; + float var10 = this.compressorRand.nextFloat() * 0.8F + 0.1F; + + while (var7.stackSize > 0) + { + int var11 = this.compressorRand.nextInt(21) + 10; + + if (var11 > var7.stackSize) + { + var11 = var7.stackSize; + } + + var7.stackSize -= var11; + EntityItem var12 = new EntityItem(par1World, (double)((float)par2 + var8), (double)((float)par3 + var9), (double)((float)par4 + var10), new ItemStack(var7.itemID, var11, var7.getItemDamage())); + + if (var7.hasTagCompound()) + { + var12.item.setTagCompound((NBTTagCompound)var7.getTagCompound().copy()); + } + + float var13 = 0.05F; + var12.motionX = (double)((float)this.compressorRand.nextGaussian() * var13); + var12.motionY = (double)((float)this.compressorRand.nextGaussian() * var13 + 0.2F); + var12.motionZ = (double)((float)this.compressorRand.nextGaussian() * var13); + par1World.spawnEntityInWorld(var12); + } + } + } + } + } + + super.breakBlock(par1World, par2, par3, par4, i1, i2); + } + + public void addCreativeItems(ArrayList itemList) + { + itemList.add(new ItemStack(this)); + } + + public String getTextureFile() + { + return "/obsidian/Compressor.png"; + } +} diff --git a/src/common/net/uberkat/obsidian/common/CombinerRecipes.java b/src/common/net/uberkat/obsidian/common/CombinerRecipes.java new file mode 100644 index 000000000..36b97cf80 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/CombinerRecipes.java @@ -0,0 +1,86 @@ +package net.uberkat.obsidian.common; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.src.*; + +public class CombinerRecipes +{ + private static final CombinerRecipes smeltingBase = new CombinerRecipes(); + + /** The list of smelting results. */ + private Map smeltingList = new HashMap(); + private Map metaSmeltingList = new HashMap(); + + /** + * Used to call methods addSmelting and getSmeltingResult. + */ + public static final CombinerRecipes smelting() + { + return smeltingBase; + } + + private CombinerRecipes() + { + addSmelting(Item.redstone.shiftedIndex, new ItemStack(Block.oreRedstone, 1)); + addSmelting(ObsidianIngots.ObsidianDust.shiftedIndex, new ItemStack(Block.obsidian, 1)); + addSmelting(ObsidianIngots.IronDust.shiftedIndex, new ItemStack(Block.oreIron, 1)); + addSmelting(ObsidianIngots.GoldDust.shiftedIndex, new ItemStack(Block.oreGold, 1)); + addSmelting(Item.diamond.shiftedIndex, new ItemStack(Block.oreDiamond, 1)); + addSmelting(new ItemStack(Item.dyePowder, 1, 4).getItem().shiftedIndex, new ItemStack(Block.oreLapis, 1)); + } + + /** + * Adds a smelting recipe. + */ + public void addSmelting(int par1, ItemStack par2ItemStack) + { + this.smeltingList.put(Integer.valueOf(par1), par2ItemStack); + } + + /** + * Returns the smelting result of an item. + * Deprecated in favor of a metadata sensitive version + */ + @Deprecated + public ItemStack getSmeltingResult(int par1) + { + return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); + } + + public Map getSmeltingList() + { + return this.smeltingList; + } + + /** + * Add a metadata-sensitive furnace recipe + * @param itemID The Item ID + * @param metadata The Item Metadata + * @param itemstack The ItemStack for the result + */ + public void addSmelting(int itemID, int metadata, ItemStack itemstack) + { + metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack); + } + + /** + * Used to get the resulting ItemStack form a source ItemStack + * @param item The Source ItemStack + * @return The result ItemStack + */ + public ItemStack getSmeltingResult(ItemStack item) + { + if (item == null) + { + return null; + } + ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); + if (ret != null) + { + return ret; + } + return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); + } +} diff --git a/src/common/net/uberkat/obsidian/common/CommonGuiHandler.java b/src/common/net/uberkat/obsidian/common/CommonGuiHandler.java new file mode 100644 index 000000000..6bfeb3f80 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/CommonGuiHandler.java @@ -0,0 +1,16 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.World; +import cpw.mods.fml.common.network.IGuiHandler; + +public class CommonGuiHandler implements IGuiHandler +{ + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + return ObsidianIngots.proxy.getServerGui(ID, player, world, x, y, z); + } + + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + return ObsidianIngots.proxy.getClientGui(ID, player, world, x, y, z); + } +} diff --git a/src/common/net/uberkat/obsidian/common/CommonProxy.java b/src/common/net/uberkat/obsidian/common/CommonProxy.java new file mode 100644 index 000000000..7dc2499a8 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/CommonProxy.java @@ -0,0 +1,76 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Container; +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.World; +import cpw.mods.fml.common.network.IGuiHandler; + +/** + * Common proxy for Obsidian Ingots mod. + * @author AidanBrady + * + */ +public abstract class CommonProxy +{ + /** + * Register and load client-only render information. + */ + public abstract void registerRenderInformation(); + + /** + * Set and load the default properties for the mod. + */ + public abstract void setProperties(); + + /** + * Load and initiate utilities for the mod. + */ + public abstract void loadUtilities(); + + /** + * Set up and load the client-only tick handler. + */ + public abstract void loadTickHandler(); + + /** + * Get the actual interface for a GUI. Client-only. + * @param ID - gui ID + * @param player - player that opened the GUI + * @param world - world the GUI was opened in + * @param x - gui's x position + * @param y - gui's y position + * @param z - gui's z position + * @return the GuiScreen of the interface + */ + public abstract Object getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z); + + /** + * Get the container for a GUI. Common. + * @param ID - gui ID + * @param player - player that opened the GUI + * @param world - world the GUI was opened in + * @param x - gui's x position + * @param y - gui's y position + * @param z - gui's z position + * @return the Container of the interface + */ + public Container getServerGui(int ID, EntityPlayer player, World world, int x, int y, int z) + { + switch(ID) + { + case 21: + TileEntityEnrichmentChamber tileentity = (TileEntityEnrichmentChamber)world.getBlockTileEntity(x, y, z); + return new ContainerEnrichmentChamber(player.inventory, tileentity); + case 22: + TileEntityPlatinumCompressor tileentity1 = (TileEntityPlatinumCompressor)world.getBlockTileEntity(x, y, z); + return new ContainerPlatinumCompressor(player.inventory, tileentity1); + case 23: + TileEntityCombiner tileentity2 = (TileEntityCombiner)world.getBlockTileEntity(x, y, z); + return new ContainerCombiner(player.inventory, tileentity2); + case 24: + TileEntityCrusher tileentity3 = (TileEntityCrusher)world.getBlockTileEntity(x, y, z); + return new ContainerCrusher(player.inventory, tileentity3); + } + return null; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ContainerCombiner.java b/src/common/net/uberkat/obsidian/common/ContainerCombiner.java new file mode 100644 index 000000000..39e14f019 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ContainerCombiner.java @@ -0,0 +1,163 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ContainerCombiner extends Container +{ + private TileEntityCombiner combiner; + private int lastCookTime = 0; + private int lastBurnTime = 0; + private int lastItemBurnTime = 0; + + public ContainerCombiner(InventoryPlayer par1InventoryPlayer, TileEntityCombiner par2TileEntityCombiner) + { + this.combiner = par2TileEntityCombiner; + this.addSlotToContainer(new Slot(par2TileEntityCombiner, 0, 56, 17)); + this.addSlotToContainer(new Slot(par2TileEntityCombiner, 1, 56, 53)); + this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityCombiner, 2, 116, 35)); + int var3; + + for (var3 = 0; var3 < 3; ++var3) + { + for (int var4 = 0; var4 < 9; ++var4) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + + /** + * Updates crafting matrix; called from onCraftMatrixChanged. Args: none + */ + public void updateCraftingResults() + { + super.updateCraftingResults(); + + for (int var1 = 0; var1 < this.crafters.size(); ++var1) + { + ICrafting var2 = (ICrafting)this.crafters.get(var1); + + if (this.lastCookTime != this.combiner.combinerCookTime) + { + var2.updateCraftingInventoryInfo(this, 0, this.combiner.combinerCookTime); + } + + if (this.lastBurnTime != this.combiner.combinerBurnTime) + { + var2.updateCraftingInventoryInfo(this, 1, this.combiner.combinerBurnTime); + } + + if (this.lastItemBurnTime != this.combiner.currentItemBurnTime) + { + var2.updateCraftingInventoryInfo(this, 2, this.combiner.currentItemBurnTime); + } + } + + this.lastCookTime = this.combiner.combinerCookTime; + this.lastBurnTime = this.combiner.combinerBurnTime; + this.lastItemBurnTime = this.combiner.currentItemBurnTime; + } + + public void updateProgressBar(int par1, int par2) + { + if (par1 == 0) + { + this.combiner.combinerCookTime = par2; + } + + if (par1 == 1) + { + this.combiner.combinerBurnTime = par2; + } + + if (par1 == 2) + { + this.combiner.currentItemBurnTime = par2; + } + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.combiner.isUseableByPlayer(par1EntityPlayer); + } + + /** + * Called to transfer a stack from one inventory to the other eg. when shift clicking. + */ + public ItemStack transferStackInSlot(int par1) + { + ItemStack var2 = null; + Slot var3 = (Slot)this.inventorySlots.get(par1); + + if (var3 != null && var3.getHasStack()) + { + ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + + if (par1 == 2) + { + if (!this.mergeItemStack(var4, 3, 39, true)) + { + return null; + } + + var3.onSlotChange(var4, var2); + } + else if (par1 != 1 && par1 != 0) + { + if (CombinerRecipes.smelting().getSmeltingResult(var4) != null) + { + if (!this.mergeItemStack(var4, 0, 1, false)) + { + return null; + } + } + else if (TileEntityCombiner.isItemFuel(var4)) + { + if (!this.mergeItemStack(var4, 1, 2, false)) + { + return null; + } + } + else if (par1 >= 3 && par1 < 30) + { + if (!this.mergeItemStack(var4, 30, 39, false)) + { + return null; + } + } + else if (par1 >= 30 && par1 < 39 && !this.mergeItemStack(var4, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(var4, 3, 39, false)) + { + return null; + } + + if (var4.stackSize == 0) + { + var3.putStack((ItemStack)null); + } + else + { + var3.onSlotChanged(); + } + + if (var4.stackSize == var2.stackSize) + { + return null; + } + + var3.onPickupFromSlot(var4); + } + + return var2; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ContainerCrusher.java b/src/common/net/uberkat/obsidian/common/ContainerCrusher.java new file mode 100644 index 000000000..20290eb9e --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ContainerCrusher.java @@ -0,0 +1,163 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ContainerCrusher extends Container +{ + private TileEntityCrusher crusher; + private int lastCookTime = 0; + private int lastBurnTime = 0; + private int lastItemBurnTime = 0; + + public ContainerCrusher(InventoryPlayer par1InventoryPlayer, TileEntityCrusher par2TileEntityCrusher) + { + this.crusher = par2TileEntityCrusher; + this.addSlotToContainer(new Slot(par2TileEntityCrusher, 0, 56, 17)); + this.addSlotToContainer(new Slot(par2TileEntityCrusher, 1, 56, 53)); + this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityCrusher, 2, 116, 35)); + int var3; + + for (var3 = 0; var3 < 3; ++var3) + { + for (int var4 = 0; var4 < 9; ++var4) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + + /** + * Updates crafting matrix; called from onCraftMatrixChanged. Args: none + */ + public void updateCraftingResults() + { + super.updateCraftingResults(); + + for (int var1 = 0; var1 < this.crafters.size(); ++var1) + { + ICrafting var2 = (ICrafting)this.crafters.get(var1); + + if (this.lastCookTime != this.crusher.crusherCookTime) + { + var2.updateCraftingInventoryInfo(this, 0, this.crusher.crusherCookTime); + } + + if (this.lastBurnTime != this.crusher.crusherBurnTime) + { + var2.updateCraftingInventoryInfo(this, 1, this.crusher.crusherBurnTime); + } + + if (this.lastItemBurnTime != this.crusher.currentItemBurnTime) + { + var2.updateCraftingInventoryInfo(this, 2, this.crusher.currentItemBurnTime); + } + } + + this.lastCookTime = this.crusher.crusherCookTime; + this.lastBurnTime = this.crusher.crusherBurnTime; + this.lastItemBurnTime = this.crusher.currentItemBurnTime; + } + + public void updateProgressBar(int par1, int par2) + { + if (par1 == 0) + { + this.crusher.crusherCookTime = par2; + } + + if (par1 == 1) + { + this.crusher.crusherBurnTime = par2; + } + + if (par1 == 2) + { + this.crusher.currentItemBurnTime = par2; + } + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.crusher.isUseableByPlayer(par1EntityPlayer); + } + + /** + * Called to transfer a stack from one inventory to the other eg. when shift clicking. + */ + public ItemStack transferStackInSlot(int par1) + { + ItemStack var2 = null; + Slot var3 = (Slot)this.inventorySlots.get(par1); + + if (var3 != null && var3.getHasStack()) + { + ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + + if (par1 == 2) + { + if (!this.mergeItemStack(var4, 3, 39, true)) + { + return null; + } + + var3.onSlotChange(var4, var2); + } + else if (par1 != 1 && par1 != 0) + { + if (CrusherRecipes.smelting().getSmeltingResult(var4) != null) + { + if (!this.mergeItemStack(var4, 0, 1, false)) + { + return null; + } + } + else if (TileEntityCrusher.isItemFuel(var4)) + { + if (!this.mergeItemStack(var4, 1, 2, false)) + { + return null; + } + } + else if (par1 >= 3 && par1 < 30) + { + if (!this.mergeItemStack(var4, 30, 39, false)) + { + return null; + } + } + else if (par1 >= 30 && par1 < 39 && !this.mergeItemStack(var4, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(var4, 3, 39, false)) + { + return null; + } + + if (var4.stackSize == 0) + { + var3.putStack((ItemStack)null); + } + else + { + var3.onSlotChanged(); + } + + if (var4.stackSize == var2.stackSize) + { + return null; + } + + var3.onPickupFromSlot(var4); + } + + return var2; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ContainerEnrichmentChamber.java b/src/common/net/uberkat/obsidian/common/ContainerEnrichmentChamber.java new file mode 100644 index 000000000..f197f11e3 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ContainerEnrichmentChamber.java @@ -0,0 +1,163 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ContainerEnrichmentChamber extends Container +{ + private TileEntityEnrichmentChamber chamber; + private int lastCookTime = 0; + private int lastBurnTime = 0; + private int lastItemBurnTime = 0; + + public ContainerEnrichmentChamber(InventoryPlayer par1InventoryPlayer, TileEntityEnrichmentChamber par2TileEntityEnrichmentChamber) + { + this.chamber = par2TileEntityEnrichmentChamber; + this.addSlotToContainer(new Slot(par2TileEntityEnrichmentChamber, 0, 56, 17)); + this.addSlotToContainer(new Slot(par2TileEntityEnrichmentChamber, 1, 56, 53)); + this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityEnrichmentChamber, 2, 116, 35)); + int var3; + + for (var3 = 0; var3 < 3; ++var3) + { + for (int var4 = 0; var4 < 9; ++var4) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + + /** + * Updates crafting matrix; called from onCraftMatrixChanged. Args: none + */ + public void updateCraftingResults() + { + super.updateCraftingResults(); + + for (int var1 = 0; var1 < this.crafters.size(); ++var1) + { + ICrafting var2 = (ICrafting)this.crafters.get(var1); + + if (this.lastCookTime != this.chamber.chamberCookTime) + { + var2.updateCraftingInventoryInfo(this, 0, this.chamber.chamberCookTime); + } + + if (this.lastBurnTime != this.chamber.chamberBurnTime) + { + var2.updateCraftingInventoryInfo(this, 1, this.chamber.chamberBurnTime); + } + + if (this.lastItemBurnTime != this.chamber.currentItemBurnTime) + { + var2.updateCraftingInventoryInfo(this, 2, this.chamber.currentItemBurnTime); + } + } + + this.lastCookTime = this.chamber.chamberCookTime; + this.lastBurnTime = this.chamber.chamberBurnTime; + this.lastItemBurnTime = this.chamber.currentItemBurnTime; + } + + public void updateProgressBar(int par1, int par2) + { + if (par1 == 0) + { + this.chamber.chamberCookTime = par2; + } + + if (par1 == 1) + { + this.chamber.chamberBurnTime = par2; + } + + if (par1 == 2) + { + this.chamber.currentItemBurnTime = par2; + } + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.chamber.isUseableByPlayer(par1EntityPlayer); + } + + /** + * Called to transfer a stack from one inventory to the other eg. when shift clicking. + */ + public ItemStack transferStackInSlot(int par1) + { + ItemStack var2 = null; + Slot var3 = (Slot)this.inventorySlots.get(par1); + + if (var3 != null && var3.getHasStack()) + { + ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + + if (par1 == 2) + { + if (!this.mergeItemStack(var4, 3, 39, true)) + { + return null; + } + + var3.onSlotChange(var4, var2); + } + else if (par1 != 1 && par1 != 0) + { + if (EnrichmentChamberRecipes.smelting().getSmeltingResult(var4) != null) + { + if (!this.mergeItemStack(var4, 0, 1, false)) + { + return null; + } + } + else if (TileEntityEnrichmentChamber.isItemFuel(var4)) + { + if (!this.mergeItemStack(var4, 1, 2, false)) + { + return null; + } + } + else if (par1 >= 3 && par1 < 30) + { + if (!this.mergeItemStack(var4, 30, 39, false)) + { + return null; + } + } + else if (par1 >= 30 && par1 < 39 && !this.mergeItemStack(var4, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(var4, 3, 39, false)) + { + return null; + } + + if (var4.stackSize == 0) + { + var3.putStack((ItemStack)null); + } + else + { + var3.onSlotChanged(); + } + + if (var4.stackSize == var2.stackSize) + { + return null; + } + + var3.onPickupFromSlot(var4); + } + + return var2; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ContainerPlatinumCompressor.java b/src/common/net/uberkat/obsidian/common/ContainerPlatinumCompressor.java new file mode 100644 index 000000000..0611cff52 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ContainerPlatinumCompressor.java @@ -0,0 +1,163 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ContainerPlatinumCompressor extends Container +{ + private TileEntityPlatinumCompressor compressor; + private int lastCookTime = 0; + private int lastBurnTime = 0; + private int lastItemBurnTime = 0; + + public ContainerPlatinumCompressor(InventoryPlayer par1InventoryPlayer, TileEntityPlatinumCompressor par2TileEntityPlatinumCompressor) + { + this.compressor = par2TileEntityPlatinumCompressor; + this.addSlotToContainer(new Slot(par2TileEntityPlatinumCompressor, 0, 56, 17)); + this.addSlotToContainer(new Slot(par2TileEntityPlatinumCompressor, 1, 56, 53)); + this.addSlotToContainer(new SlotObsidian(par1InventoryPlayer.player, par2TileEntityPlatinumCompressor, 2, 116, 35)); + int var3; + + for (var3 = 0; var3 < 3; ++var3) + { + for (int var4 = 0; var4 < 9; ++var4) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } + } + + /** + * Updates crafting matrix; called from onCraftMatrixChanged. Args: none + */ + public void updateCraftingResults() + { + super.updateCraftingResults(); + + for (int var1 = 0; var1 < this.crafters.size(); ++var1) + { + ICrafting var2 = (ICrafting)this.crafters.get(var1); + + if (this.lastCookTime != this.compressor.compressorCookTime) + { + var2.updateCraftingInventoryInfo(this, 0, this.compressor.compressorCookTime); + } + + if (this.lastBurnTime != this.compressor.compressorBurnTime) + { + var2.updateCraftingInventoryInfo(this, 1, this.compressor.compressorBurnTime); + } + + if (this.lastItemBurnTime != this.compressor.currentItemBurnTime) + { + var2.updateCraftingInventoryInfo(this, 2, this.compressor.currentItemBurnTime); + } + } + + this.lastCookTime = this.compressor.compressorCookTime; + this.lastBurnTime = this.compressor.compressorBurnTime; + this.lastItemBurnTime = this.compressor.currentItemBurnTime; + } + + public void updateProgressBar(int par1, int par2) + { + if (par1 == 0) + { + this.compressor.compressorCookTime = par2; + } + + if (par1 == 1) + { + this.compressor.compressorBurnTime = par2; + } + + if (par1 == 2) + { + this.compressor.currentItemBurnTime = par2; + } + } + + public boolean canInteractWith(EntityPlayer par1EntityPlayer) + { + return this.compressor.isUseableByPlayer(par1EntityPlayer); + } + + /** + * Called to transfer a stack from one inventory to the other eg. when shift clicking. + */ + public ItemStack transferStackInSlot(int par1) + { + ItemStack var2 = null; + Slot var3 = (Slot)this.inventorySlots.get(par1); + + if (var3 != null && var3.getHasStack()) + { + ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + + if (par1 == 2) + { + if (!this.mergeItemStack(var4, 3, 39, true)) + { + return null; + } + + var3.onSlotChange(var4, var2); + } + else if (par1 != 1 && par1 != 0) + { + if (PlatinumCompressorRecipes.smelting().getSmeltingResult(var4) != null) + { + if (!this.mergeItemStack(var4, 0, 1, false)) + { + return null; + } + } + else if (TileEntityPlatinumCompressor.isItemFuel(var4)) + { + if (!this.mergeItemStack(var4, 1, 2, false)) + { + return null; + } + } + else if (par1 >= 3 && par1 < 30) + { + if (!this.mergeItemStack(var4, 30, 39, false)) + { + return null; + } + } + else if (par1 >= 30 && par1 < 39 && !this.mergeItemStack(var4, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(var4, 3, 39, false)) + { + return null; + } + + if (var4.stackSize == 0) + { + var3.putStack((ItemStack)null); + } + else + { + var3.onSlotChanged(); + } + + if (var4.stackSize == var2.stackSize) + { + return null; + } + + var3.onPickupFromSlot(var4); + } + + return var2; + } +} diff --git a/src/common/net/uberkat/obsidian/common/CrusherRecipes.java b/src/common/net/uberkat/obsidian/common/CrusherRecipes.java new file mode 100644 index 000000000..0fc21eb95 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/CrusherRecipes.java @@ -0,0 +1,85 @@ +package net.uberkat.obsidian.common; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.src.*; + +public class CrusherRecipes +{ + private static final CrusherRecipes smeltingBase = new CrusherRecipes(); + + /** The list of smelting results. */ + private Map smeltingList = new HashMap(); + private Map metaSmeltingList = new HashMap(); + + /** + * Used to call methods addSmelting and getSmeltingResult. + */ + public static final CrusherRecipes smelting() + { + return smeltingBase; + } + + private CrusherRecipes() + { + addSmelting(ObsidianIngots.RedstoneIngot.shiftedIndex, new ItemStack(Item.redstone, 1)); + addSmelting(Item.ingotIron.shiftedIndex, new ItemStack(ObsidianIngots.IronDust, 1)); + addSmelting(Item.ingotGold.shiftedIndex, new ItemStack(ObsidianIngots.GoldDust, 1)); + addSmelting(ObsidianIngots.PlatinumIngot.shiftedIndex, new ItemStack(ObsidianIngots.PlatinumDust, 1)); + addSmelting(ObsidianIngots.GlowstoneIngot.shiftedIndex, new ItemStack(Item.lightStoneDust)); + } + + /** + * Adds a smelting recipe. + */ + public void addSmelting(int par1, ItemStack par2ItemStack) + { + this.smeltingList.put(Integer.valueOf(par1), par2ItemStack); + } + + /** + * Returns the smelting result of an item. + * Deprecated in favor of a metadata sensitive version + */ + @Deprecated + public ItemStack getSmeltingResult(int par1) + { + return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); + } + + public Map getSmeltingList() + { + return this.smeltingList; + } + + /** + * Add a metadata-sensitive furnace recipe + * @param itemID The Item ID + * @param metadata The Item Metadata + * @param itemstack The ItemStack for the result + */ + public void addSmelting(int itemID, int metadata, ItemStack itemstack) + { + metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack); + } + + /** + * Used to get the resulting ItemStack form a source ItemStack + * @param item The Source ItemStack + * @return The result ItemStack + */ + public ItemStack getSmeltingResult(ItemStack item) + { + if (item == null) + { + return null; + } + ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); + if (ret != null) + { + return ret; + } + return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); + } +} diff --git a/src/common/net/uberkat/obsidian/common/DamageSourceObsidian.java b/src/common/net/uberkat/obsidian/common/DamageSourceObsidian.java new file mode 100644 index 000000000..a7f833392 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/DamageSourceObsidian.java @@ -0,0 +1,36 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class DamageSourceObsidian extends EntityDamageSourceIndirect +{ + private Entity damageSourceProjectile; + private Entity damageSourceEntity; + + public DamageSourceObsidian(String s, Entity entity, Entity entity1) + { + super(s, entity, entity1); + damageSourceProjectile = entity; + damageSourceEntity = entity1; + } + + public Entity getProjectile() + { + return damageSourceProjectile; + } + + public Entity getEntity() + { + return damageSourceEntity; + } + + public static DamageSource causeWeaponDamage(Entity entity, Entity entity1) + { + return (new DamageSourceObsidian("weapon", entity, entity1)).setProjectile(); + } + + public static DamageSource causeObsidianArrowDamage(EntityObsidianArrow arrow, Entity entity) + { + return (new EntityDamageSourceIndirect("arrow", arrow, entity)).setProjectile(); + } +} diff --git a/src/common/net/uberkat/obsidian/common/EnrichmentChamberRecipes.java b/src/common/net/uberkat/obsidian/common/EnrichmentChamberRecipes.java new file mode 100644 index 000000000..6d9c834f6 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/EnrichmentChamberRecipes.java @@ -0,0 +1,85 @@ +package net.uberkat.obsidian.common; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.src.*; + +public class EnrichmentChamberRecipes +{ + private static final EnrichmentChamberRecipes smeltingBase = new EnrichmentChamberRecipes(); + + /** The list of smelting results. */ + private Map smeltingList = new HashMap(); + private Map metaSmeltingList = new HashMap(); + + /** + * Used to call methods addSmelting and getSmeltingResult. + */ + public static final EnrichmentChamberRecipes smelting() + { + return smeltingBase; + } + + private EnrichmentChamberRecipes() + { + addSmelting(Block.obsidian.blockID, new ItemStack(ObsidianIngots.ObsidianDust, 1)); + addSmelting(Block.oreIron.blockID, new ItemStack(ObsidianIngots.IronDust, 1)); + addSmelting(Block.oreGold.blockID, new ItemStack(ObsidianIngots.GoldDust, 1)); + addSmelting(ObsidianIngots.platinumOreID, new ItemStack(ObsidianIngots.PlatinumDust, 1)); + addSmelting(Block.oreRedstone.blockID, new ItemStack(Item.redstone)); + } + + /** + * Adds a smelting recipe. + */ + public void addSmelting(int par1, ItemStack par2ItemStack) + { + this.smeltingList.put(Integer.valueOf(par1), par2ItemStack); + } + + /** + * Returns the smelting result of an item. + * Deprecated in favor of a metadata sensitive version + */ + @Deprecated + public ItemStack getSmeltingResult(int par1) + { + return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); + } + + public Map getSmeltingList() + { + return this.smeltingList; + } + + /** + * Add a metadata-sensitive furnace recipe + * @param itemID The Item ID + * @param metadata The Item Metadata + * @param itemstack The ItemStack for the result + */ + public void addSmelting(int itemID, int metadata, ItemStack itemstack) + { + metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack); + } + + /** + * Used to get the resulting ItemStack form a source ItemStack + * @param item The Source ItemStack + * @return The result ItemStack + */ + public ItemStack getSmeltingResult(ItemStack item) + { + if (item == null) + { + return null; + } + ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); + if (ret != null) + { + return ret; + } + return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); + } +} diff --git a/src/common/net/uberkat/obsidian/common/EntityKnife.java b/src/common/net/uberkat/obsidian/common/EntityKnife.java new file mode 100644 index 000000000..31b8be109 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/EntityKnife.java @@ -0,0 +1,146 @@ +package net.uberkat.obsidian.common; + +import java.util.Random; +import net.minecraft.src.*; + +public class EntityKnife extends EntityProjectile +{ + protected ItemStack thrownItem; + private int soundTimer; + + public EntityKnife(World world) + { + super(world); + } + + public EntityKnife(World world, double d, double d1, double d2) + { + this(world); + setPosition(d, d1, d2); + } + + public EntityKnife(World world, EntityLiving entityliving, ItemStack itemstack) + { + this(world); + thrownItem = itemstack; + shootingEntity = entityliving; + doesArrowBelongToPlayer = entityliving instanceof EntityPlayer; + soundTimer = 0; + setLocationAndAngles(entityliving.posX, entityliving.posY + (double)entityliving.getEyeHeight(), entityliving.posZ, entityliving.rotationYaw, entityliving.rotationPitch); + posX -= MathHelper.cos((rotationYaw / 180F) * (float)Math.PI) * 0.16F; + posY -= 0.10000000000000001D; + posZ -= MathHelper.sin((rotationYaw / 180F) * (float)Math.PI) * 0.16F; + setPosition(posX, posY, posZ); + yOffset = 0.0F; + motionX = -MathHelper.sin((rotationYaw / 180F) * (float)Math.PI) * MathHelper.cos((rotationPitch / 180F) * (float)Math.PI); + motionZ = MathHelper.cos((rotationYaw / 180F) * (float)Math.PI) * MathHelper.cos((rotationPitch / 180F) * (float)Math.PI); + motionY = -MathHelper.sin((rotationPitch / 180F) * (float)Math.PI); + setArrowHeading(motionX, motionY, motionZ, 0.8F, 3F); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (inGround || beenInGround) + { + return; + } + + rotationPitch -= 70F; + + if (soundTimer >= 3) + { + if (!isInsideOfMaterial(Material.water)) + { + worldObj.playSoundAtEntity(this, "random.bow", 0.6F, 1.0F / (rand.nextFloat() * 0.2F + 0.6F + (float)ticksInAir / 15F)); + } + + soundTimer = 0; + } + + soundTimer++; + } + + public void onEntityHit(Entity entity) + { + if (worldObj.isRemote) + { + return; + } + + DamageSource damagesource = null; + + if (shootingEntity == null) + { + damagesource = DamageSourceObsidian.causeWeaponDamage(this, this); + } + else + { + damagesource = DamageSourceObsidian.causeWeaponDamage(this, shootingEntity); + } + + if (entity.attackEntityFrom(damagesource, thrownItem.getDamageVsEntity(entity))) + { + if (thrownItem.getItemDamage() + 2 > thrownItem.getMaxDamage()) + { + thrownItem.stackSize--; + setDead(); + } + else + { + thrownItem.damageItem(2, null); + setVelocity(0.20000000000000001D * rand.nextDouble() - 0.10000000000000001D, 0.20000000000000001D * rand.nextDouble() - 0.10000000000000001D, 0.20000000000000001D * rand.nextDouble() - 0.10000000000000001D); + } + } + else + { + bounceBack(); + } + } + + public boolean aimRotation() + { + return beenInGround; + } + + public int getMaxArrowShake() + { + return 4; + } + + public float getGravity() + { + return 0.03F; + } + + public ItemStack getPickupItem() + { + return thrownItem; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) + { + super.writeEntityToNBT(nbttagcompound); + + if (thrownItem != null) + { + nbttagcompound.setCompoundTag("thrownItem", thrownItem.writeToNBT(new NBTTagCompound())); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) + { + super.readEntityFromNBT(nbttagcompound); + thrownItem = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("thrownItem")); + } +} diff --git a/src/common/net/uberkat/obsidian/common/EntityObsidianArrow.java b/src/common/net/uberkat/obsidian/common/EntityObsidianArrow.java new file mode 100644 index 000000000..06fa21dcd --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/EntityObsidianArrow.java @@ -0,0 +1,526 @@ +package net.uberkat.obsidian.common; + +import cpw.mods.fml.common.Side; +import cpw.mods.fml.common.asm.SideOnly; +import java.util.Iterator; +import java.util.List; +import net.minecraft.src.*; + +public class EntityObsidianArrow extends Entity +{ + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private int inTile = 0; + private int inData = 0; + private boolean inGround = false; + + /** 1 if the player can pick up the arrow */ + public int canBePickedUp = 0; + + /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake = 0; + + /** The owner of this arrow. */ + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir = 0; + private double damage = 2.0D; + + /** The amount of knockback an arrow applies when it hits a mob. */ + private int knockbackStrength; + + public EntityObsidianArrow(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.5F); + } + + public EntityObsidianArrow(World par1World, double par2, double par4, double par6) + { + super(par1World); + this.setSize(0.5F, 0.5F); + this.setPosition(par2, par4, par6); + this.yOffset = 0.0F; + } + + public EntityObsidianArrow(World par1World, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving, float par4, float par5) + { + super(par1World); + this.shootingEntity = par2EntityLiving; + + if (par2EntityLiving instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.posY = par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight() - 0.10000000149011612D; + double var6 = par3EntityLiving.posX - par2EntityLiving.posX; + double var8 = par3EntityLiving.posY + (double)par3EntityLiving.getEyeHeight() - 0.699999988079071D - this.posY; + double var10 = par3EntityLiving.posZ - par2EntityLiving.posZ; + double var12 = (double)MathHelper.sqrt_double(var6 * var6 + var10 * var10); + + if (var12 >= 1.0E-7D) + { + float var14 = (float)(Math.atan2(var10, var6) * 180.0D / Math.PI) - 90.0F; + float var15 = (float)(-(Math.atan2(var8, var12) * 180.0D / Math.PI)); + double var16 = var6 / var12; + double var18 = var10 / var12; + this.setLocationAndAngles(par2EntityLiving.posX + var16, this.posY, par2EntityLiving.posZ + var18, var14, var15); + this.yOffset = 0.0F; + float var20 = (float)var12 * 0.2F; + this.setArrowHeading(var6, var8 + (double)var20, var10, par4, par5); + } + } + + public EntityObsidianArrow(World par1World, EntityLiving par2EntityLiving, float par3) + { + super(par1World); + this.shootingEntity = par2EntityLiving; + + if (par2EntityLiving instanceof EntityPlayer) + { + this.canBePickedUp = 1; + } + + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + (double)par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); + this.setArrowHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F); + } + + protected void entityInit() + { + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + + /** + * Uses the provided coordinates as a heading and determines the velocity from it with the set force and random + * variance. Args: x, y, z, force, forceVariation + */ + public void setArrowHeading(double par1, double par3, double par5, float par7, float par8) + { + float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); + par1 /= (double)var9; + par3 /= (double)var9; + par5 /= (double)var9; + par1 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; + par3 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; + par5 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; + par1 *= (double)par7; + par3 *= (double)par7; + par5 *= (double)par7; + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; + float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + @SideOnly(Side.CLIENT) + + /** + * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, + * posY, posZ, yaw, pitch + */ + public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) + { + this.setPosition(par1, par3, par5); + this.setRotation(par7, par8); + } + + @SideOnly(Side.CLIENT) + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double par1, double par3, double par5) + { + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); + } + + int var16 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); + + if (var16 > 0) + { + Block.blocksList[var16].setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); + AxisAlignedBB var2 = Block.blocksList[var16].getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); + + if (var2 != null && var2.isVecInside(Vec3.getVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) + { + this.inGround = true; + } + } + + if (this.arrowShake > 0) + { + --this.arrowShake; + } + + if (this.inGround) + { + int var18 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); + int var19 = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + + if (var18 == this.inTile && var19 == this.inData) + { + ++this.ticksInGround; + + if (this.ticksInGround == 1200) + { + this.setDead(); + } + } + else + { + this.inGround = false; + this.motionX *= (double)(this.rand.nextFloat() * 0.2F); + this.motionY *= (double)(this.rand.nextFloat() * 0.2F); + this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } + else + { + ++this.ticksInAir; + Vec3 var17 = Vec3.getVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var3 = Vec3.getVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition var4 = this.worldObj.rayTraceBlocks_do_do(var17, var3, false, true); + var17 = Vec3.getVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var3 = Vec3.getVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (var4 != null) + { + var3 = Vec3.getVec3Pool().getVecFromPool(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + } + + Entity var5 = null; + List var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var7 = 0.0D; + Iterator var9 = var6.iterator(); + float var11; + + while (var9.hasNext()) + { + Entity var10 = (Entity)var9.next(); + + if (var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) + { + var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand((double)var11, (double)var11, (double)var11); + MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); + + if (var13 != null) + { + double var14 = var17.distanceTo(var13.hitVec); + + if (var14 < var7 || var7 == 0.0D) + { + var5 = var10; + var7 = var14; + } + } + } + } + + if (var5 != null) + { + var4 = new MovingObjectPosition(var5); + } + + float var20; + + if (var4 != null) + { + if (var4.entityHit != null) + { + var20 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int var24 = MathHelper.ceiling_double_int((double)var20 * this.damage); + + if (this.func_70241_g()) + { + var24 += this.rand.nextInt(var24 / 2 + 2); + } + + DamageSource var22 = null; + + if (this.shootingEntity == null) + { + var22 = DamageSourceObsidian.causeObsidianArrowDamage(this, this); + } + else + { + var22 = DamageSourceObsidian.causeObsidianArrowDamage(this, this.shootingEntity); + } + + if (this.isBurning()) + { + var4.entityHit.setFire(5); + } + + if (var4.entityHit.attackEntityFrom(var22, var24)) + { + if (var4.entityHit instanceof EntityLiving) + { + ++((EntityLiving)var4.entityHit).arrowHitTempCounter; + + if (this.knockbackStrength > 0) + { + float var25 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var25 > 0.0F) + { + var4.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)var25, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)var25); + } + } + } + + this.worldObj.playSoundAtEntity(this, "random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.setDead(); + } + else + { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } + else + { + this.xTile = var4.blockX; + this.yTile = var4.blockY; + this.zTile = var4.blockZ; + this.inTile = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); + this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + this.motionX = (double)((float)(var4.hitVec.xCoord - this.posX)); + this.motionY = (double)((float)(var4.hitVec.yCoord - this.posY)); + this.motionZ = (double)((float)(var4.hitVec.zCoord - this.posZ)); + var20 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / (double)var20 * 0.05000000074505806D; + this.posY -= this.motionY / (double)var20 * 0.05000000074505806D; + this.posZ -= this.motionZ / (double)var20 * 0.05000000074505806D; + this.worldObj.playSoundAtEntity(this, "random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.func_70243_d(false); + } + } + + if (this.func_70241_g()) + { + for (int var21 = 0; var21 < 4; ++var21) + { + this.worldObj.spawnParticle("portal", this.posX + this.motionX * (double)var21 / 4.0D, this.posY + this.motionY * (double)var21 / 4.0D, this.posZ + this.motionZ * (double)var21 / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + var20 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + + for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var20) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) + { + ; + } + + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) + { + this.prevRotationPitch += 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw < -180.0F) + { + this.prevRotationYaw -= 360.0F; + } + + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) + { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var23 = 0.99F; + var11 = 0.05F; + + if (this.isInWater()) + { + for (int var26 = 0; var26 < 4; ++var26) + { + float var27 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var27, this.posY - this.motionY * (double)var27, this.posZ - this.motionZ * (double)var27, this.motionX, this.motionY, this.motionZ); + } + + var23 = 0.8F; + } + + this.motionX *= (double)var23; + this.motionY *= (double)var23; + this.motionZ *= (double)var23; + this.motionY -= (double)var11; + this.setPosition(this.posX, this.posY, this.posZ); + this.doBlockCollisions(); + } + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setShort("xTile", (short)this.xTile); + par1NBTTagCompound.setShort("yTile", (short)this.yTile); + par1NBTTagCompound.setShort("zTile", (short)this.zTile); + par1NBTTagCompound.setByte("inTile", (byte)this.inTile); + par1NBTTagCompound.setByte("inData", (byte)this.inData); + par1NBTTagCompound.setByte("shake", (byte)this.arrowShake); + par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + par1NBTTagCompound.setByte("pickup", (byte)this.canBePickedUp); + par1NBTTagCompound.setDouble("damage", this.damage); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + this.xTile = par1NBTTagCompound.getShort("xTile"); + this.yTile = par1NBTTagCompound.getShort("yTile"); + this.zTile = par1NBTTagCompound.getShort("zTile"); + this.inTile = par1NBTTagCompound.getByte("inTile") & 255; + this.inData = par1NBTTagCompound.getByte("inData") & 255; + this.arrowShake = par1NBTTagCompound.getByte("shake") & 255; + this.inGround = par1NBTTagCompound.getByte("inGround") == 1; + + if (par1NBTTagCompound.hasKey("damage")) + { + this.damage = par1NBTTagCompound.getDouble("damage"); + } + + if (par1NBTTagCompound.hasKey("pickup")) + { + this.canBePickedUp = par1NBTTagCompound.getByte("pickup"); + } + else if (par1NBTTagCompound.hasKey("player")) + { + this.canBePickedUp = par1NBTTagCompound.getBoolean("player") ? 1 : 0; + } + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) + { + if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) + { + boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode; + + if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(ObsidianIngots.ObsidianArrow, 1))) + { + var2 = false; + } + + if (var2) + { + this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + par1EntityPlayer.onItemPickup(this, 1); + this.setDead(); + } + } + } + + @SideOnly(Side.CLIENT) + public float getShadowSize() + { + return 0.0F; + } + + public void setDamage(double par1) + { + this.damage = par1; + } + + public double getDamage() + { + return this.damage; + } + + /** + * Sets the amount of knockback the arrow applies when it hits a mob. + */ + public void setKnockbackStrength(int par1) + { + this.knockbackStrength = par1; + } + + /** + * If returns false, the item will not inflict any damage against entities. + */ + public boolean canAttackWithItem() + { + return false; + } + + public void func_70243_d(boolean par1) + { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); + + if (par1) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } + } + + public boolean func_70241_g() + { + byte var1 = this.dataWatcher.getWatchableObjectByte(16); + return (var1 & 1) != 0; + } +} diff --git a/src/common/net/uberkat/obsidian/common/EntityObsidianTNT.java b/src/common/net/uberkat/obsidian/common/EntityObsidianTNT.java new file mode 100644 index 000000000..e8cc183ac --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/EntityObsidianTNT.java @@ -0,0 +1,124 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class EntityObsidianTNT extends Entity +{ + /** How long the fuse is */ + public int fuse; + private boolean hasExploded = false; + + public EntityObsidianTNT(World par1World) + { + super(par1World); + fuse = 0; + preventEntitySpawning = true; + setSize(0.98F, 0.98F); + yOffset = height / 2.0F; + } + + public EntityObsidianTNT(World par1World, double par2, double par4, double par6) + { + this(par1World); + setPosition(par2, par4, par6); + float var8 = (float)(Math.random() * Math.PI * 2.0D); + motionX = (double)(-((float)Math.sin((double)var8)) * 0.02F); + motionY = 0.20000000298023224D; + motionZ = (double)(-((float)Math.cos((double)var8)) * 0.02F); + fuse = ObsidianIngots.ObsidianTNTDelay; + prevPosX = par2; + prevPosY = par4; + prevPosZ = par6; + } + + protected void entityInit() {} + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + /** + * Returns true if other Entities should be prevented from moving through this Entity. + */ + public boolean canBeCollidedWith() + { + return !isDead; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + prevPosX = posX; + prevPosY = posY; + prevPosZ = posZ; + motionY -= 0.03999999910593033D; + moveEntity(motionX, motionY, motionZ); + motionX *= 0.9800000190734863D; + motionY *= 0.9800000190734863D; + motionZ *= 0.9800000190734863D; + + if (onGround) + { + motionX *= 0.699999988079071D; + motionZ *= 0.699999988079071D; + motionY *= -0.5D; + } + + if (fuse-- <= 0) + { + if (!worldObj.isRemote) + { + setDead(); + explode(); + } + else + { + if(hasExploded) + { + setDead(); + } + else { + worldObj.spawnParticle("lava", posX, posY + 0.5D, posZ, 0.0D, 0.0D, 0.0D); + } + } + } + else + { + worldObj.spawnParticle("lava", posX, posY + 0.5D, posZ, 0.0D, 0.0D, 0.0D); + } + } + + private void explode() + { + worldObj.createExplosion((Entity)null, posX, posY, posZ, ObsidianIngots.ObsidianTNTBlastRadius); + hasExploded = true; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setByte("Fuse", (byte)fuse); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + fuse = par1NBTTagCompound.getByte("Fuse"); + } + + public float getShadowSize() + { + return 0.0F; + } +} diff --git a/src/common/net/uberkat/obsidian/common/EntityProjectile.java b/src/common/net/uberkat/obsidian/common/EntityProjectile.java new file mode 100644 index 000000000..d39263d81 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/EntityProjectile.java @@ -0,0 +1,394 @@ +package net.uberkat.obsidian.common; + +import java.util.List; +import net.minecraft.src.*; +import java.util.Random; + +public abstract class EntityProjectile extends Entity +{ + protected int xTile; + protected int yTile; + protected int zTile; + protected int inTile; + protected int inData; + protected boolean inGround; + public boolean doesArrowBelongToPlayer; + public int arrowShake; + public Entity shootingEntity; + protected int ticksInGround; + protected int ticksInAir; + public boolean beenInGround; + public boolean isCritical; + + public EntityProjectile(World world) + { + super(world); + xTile = -1; + yTile = -1; + zTile = -1; + inTile = 0; + inData = 0; + inGround = false; + doesArrowBelongToPlayer = false; + isCritical = false; + arrowShake = 0; + ticksInAir = 0; + yOffset = 0.0F; + setSize(0.5F, 0.5F); + } + + protected void entityInit() + { + } + + public void setArrowHeading(double d, double d1, double d2, float f, float f1) + { + float f2 = MathHelper.sqrt_double(d * d + d1 * d1 + d2 * d2); + d /= f2; + d1 /= f2; + d2 /= f2; + d += rand.nextGaussian() * 0.0074999999999999997D * (double)f1; + d1 += rand.nextGaussian() * 0.0074999999999999997D * (double)f1; + d2 += rand.nextGaussian() * 0.0074999999999999997D * (double)f1; + d *= f; + d1 *= f; + d2 *= f; + motionX = d; + motionY = d1; + motionZ = d2; + float f3 = MathHelper.sqrt_double(d * d + d2 * d2); + prevRotationYaw = rotationYaw = (float)((Math.atan2(d, d2) * 180D) / Math.PI); + prevRotationPitch = rotationPitch = (float)((Math.atan2(d1, f3) * 180D) / Math.PI); + ticksInGround = 0; + } + + /** + * Sets the velocity to the args. Args: x, y, z + */ + public void setVelocity(double d, double d1, double d2) + { + motionX = d; + motionY = d1; + motionZ = d2; + + if (prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + if (aimRotation()) + { + float f = MathHelper.sqrt_double(d * d + d2 * d2); + prevRotationYaw = rotationYaw = (float)((Math.atan2(d, d2) * 180D) / Math.PI); + prevRotationPitch = rotationPitch = (float)((Math.atan2(d1, f) * 180D) / Math.PI); + prevRotationPitch = rotationPitch; + prevRotationYaw = rotationYaw; + } + + setLocationAndAngles(posX, posY, posZ, rotationYaw, rotationPitch); + ticksInGround = 0; + } + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + + if (aimRotation() && prevRotationPitch == 0.0F && prevRotationYaw == 0.0F) + { + float f = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + prevRotationYaw = rotationYaw = (float)((Math.atan2(motionX, motionZ) * 180D) / Math.PI); + prevRotationPitch = rotationPitch = (float)((Math.atan2(motionY, f) * 180D) / Math.PI); + } + + int i = worldObj.getBlockId(xTile, yTile, zTile); + + if (i > 0) + { + Block.blocksList[i].setBlockBoundsBasedOnState(worldObj, xTile, yTile, zTile); + AxisAlignedBB axisalignedbb = Block.blocksList[i].getCollisionBoundingBoxFromPool(worldObj, xTile, yTile, zTile); + + if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(posX, posY, posZ))) + { + inGround = true; + } + } + + if (arrowShake > 0) + { + arrowShake--; + } + + if (inGround) + { + int j = worldObj.getBlockId(xTile, yTile, zTile); + int k = worldObj.getBlockMetadata(xTile, yTile, zTile); + + if (j != inTile || k != inData) + { + inGround = false; + motionX *= rand.nextFloat() * 0.2F; + motionY *= rand.nextFloat() * 0.2F; + motionZ *= rand.nextFloat() * 0.2F; + ticksInGround = 0; + ticksInAir = 0; + } + else + { + ticksInGround++; + + if (ticksInGround >= (doesArrowBelongToPlayer ? 200 : 800)) + { + setDead(); + } + } + + return; + } + + ticksInAir++; + Vec3 vec3d = Vec3.createVectorHelper(posX, posY, posZ); + Vec3 vec3d1 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ); + MovingObjectPosition movingobjectposition = worldObj.rayTraceBlocks_do_do(vec3d, vec3d1, false, true); + vec3d = Vec3.createVectorHelper(posX, posY, posZ); + vec3d1 = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ); + + if (movingobjectposition != null) + { + vec3d1 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } + + Entity entity = null; + List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D)); + double d = 0.0D; + + for (int l = 0; l < list.size(); l++) + { + Entity entity1 = (Entity)list.get(l); + + if (!entity1.canBeCollidedWith() || entity1 == shootingEntity && ticksInAir < 5) + { + continue; + } + + float f4 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand(f4, f4, f4); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3d, vec3d1); + + if (movingobjectposition1 == null) + { + continue; + } + + double d1 = vec3d.distanceTo(movingobjectposition1.hitVec); + + if (d1 < d || d == 0.0D) + { + entity = entity1; + d = d1; + } + } + + if (entity != null) + { + movingobjectposition = new MovingObjectPosition(entity); + } + + if (movingobjectposition != null) + { + if (movingobjectposition.entityHit != null) + { + onEntityHit(movingobjectposition.entityHit); + } + else + { + onGroundHit(movingobjectposition); + } + } + + if (isCritical) + { + for (int i1 = 0; i1 < 2; i1++) + { + worldObj.spawnParticle("crit", posX + (motionX * (double)i1) / 4D, posY + (motionY * (double)i1) / 4D, posZ + (motionZ * (double)i1) / 4D, -motionX, -motionY + 0.20000000000000001D, -motionZ); + } + } + + posX += motionX; + posY += motionY; + posZ += motionZ; + + if (aimRotation()) + { + float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ); + rotationYaw = (float)((Math.atan2(motionX, motionZ) * 180D) / Math.PI); + + for (rotationPitch = (float)((Math.atan2(motionY, f1) * 180D) / Math.PI); rotationPitch - prevRotationPitch < -180F; prevRotationPitch -= 360F) { } + + for (; rotationPitch - prevRotationPitch >= 180F; prevRotationPitch += 360F) { } + + for (; rotationYaw - prevRotationYaw < -180F; prevRotationYaw -= 360F) { } + + for (; rotationYaw - prevRotationYaw >= 180F; prevRotationYaw += 360F) { } + + rotationPitch = prevRotationPitch + (rotationPitch - prevRotationPitch) * 0.2F; + rotationYaw = prevRotationYaw + (rotationYaw - prevRotationYaw) * 0.2F; + } + + float f2 = getAirResistance(); + float f3 = getGravity(); + + if (isInWater()) + { + beenInGround = true; + + for (int j1 = 0; j1 < 4; j1++) + { + float f5 = 0.25F; + worldObj.spawnParticle("bubble", posX - motionX * (double)f5, posY - motionY * (double)f5, posZ - motionZ * (double)f5, motionX, motionY, motionZ); + } + + f2 = 0.8F; + } + + motionX *= f2; + motionY *= f2; + motionZ *= f2; + motionY -= f3; + setPosition(posX, posY, posZ); + } + + public final double getTotalVelocity() + { + return Math.sqrt(motionX * motionX + motionY * motionY + motionZ * motionZ); + } + + public boolean aimRotation() + { + return true; + } + + public void onEntityHit(Entity entity) + { + bounceBack(); + } + + public void onGroundHit(MovingObjectPosition movingobjectposition) + { + xTile = movingobjectposition.blockX; + yTile = movingobjectposition.blockY; + zTile = movingobjectposition.blockZ; + inTile = worldObj.getBlockId(xTile, yTile, zTile); + inData = worldObj.getBlockMetadata(xTile, yTile, zTile); + motionX = (float)(movingobjectposition.hitVec.xCoord - posX); + motionY = (float)(movingobjectposition.hitVec.yCoord - posY); + motionZ = (float)(movingobjectposition.hitVec.zCoord - posZ); + float f = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ); + posX -= (motionX / (double)f) * 0.050000000000000003D; + posY -= (motionY / (double)f) * 0.050000000000000003D; + posZ -= (motionZ / (double)f) * 0.050000000000000003D; + inGround = true; + beenInGround = true; + isCritical = false; + arrowShake = getMaxArrowShake(); + playHitSound(); + } + + protected void bounceBack() + { + motionX *= -0.10000000000000001D; + motionY *= -0.10000000000000001D; + motionZ *= -0.10000000000000001D; + rotationYaw += 180F; + prevRotationYaw += 180F; + ticksInAir = 0; + } + + public ItemStack getPickupItem() + { + return null; + } + + public float getAirResistance() + { + return 0.99F; + } + + public float getGravity() + { + return 0.05F; + } + + public int getMaxArrowShake() + { + return 7; + } + + public void playHitSound() + { + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer(EntityPlayer entityplayer) + { + if (worldObj.isRemote) + { + return; + } + + ItemStack itemstack = getPickupItem(); + + if (itemstack == null) + { + return; + } + + if (inGround && doesArrowBelongToPlayer && arrowShake <= 0 && entityplayer.inventory.addItemStackToInventory(itemstack)) + { + worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + entityplayer.onItemPickup(this, 1); + setDead(); + } + } + + public float getShadowSize() + { + return 0.0F; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound nbttagcompound) + { + nbttagcompound.setShort("xTile", (short)xTile); + nbttagcompound.setShort("yTile", (short)yTile); + nbttagcompound.setShort("zTile", (short)zTile); + nbttagcompound.setByte("inTile", (byte)inTile); + nbttagcompound.setByte("inData", (byte)inData); + nbttagcompound.setByte("shake", (byte)arrowShake); + nbttagcompound.setBoolean("inGround", inGround); + nbttagcompound.setBoolean("player", doesArrowBelongToPlayer); + nbttagcompound.setBoolean("crit", isCritical); + nbttagcompound.setBoolean("beenInGround", beenInGround); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound nbttagcompound) + { + xTile = nbttagcompound.getShort("xTile"); + yTile = nbttagcompound.getShort("yTile"); + zTile = nbttagcompound.getShort("zTile"); + inTile = nbttagcompound.getByte("inTile") & 0xff; + inData = nbttagcompound.getByte("inData") & 0xff; + arrowShake = nbttagcompound.getByte("shake") & 0xff; + inGround = nbttagcompound.getBoolean("inGround"); + doesArrowBelongToPlayer = nbttagcompound.getBoolean("player"); + isCritical = nbttagcompound.getBoolean("crit"); + beenInGround = nbttagcompound.getBoolean("beenInGrond"); + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemBlockBase.java b/src/common/net/uberkat/obsidian/common/ItemBlockBase.java new file mode 100644 index 000000000..cc91b10a1 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemBlockBase.java @@ -0,0 +1,46 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ItemBlockBase extends ItemBlock +{ + public ItemBlockBase(int i, Block block) + { + super(i); + setMaxDamage(0); + setHasSubtypes(true); + } + + @Override + public String getItemNameIS(ItemStack itemstack) + { + String name = ""; + switch(itemstack.getItemDamage()) + { + case 0: + name = "baseObsidian"; + break; + case 1: + name = "baseRedstone"; + break; + case 2: + name = "basePlatinum"; + break; + case 3: + name = "basePlatinumOre"; + break; + case 4: + name = "baseCoal"; + break; + case 5: + name = "baseGlowstone"; + break; + } + return name; + } + + public int getMetadata(int i) + { + return i; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemLightningRod.java b/src/common/net/uberkat/obsidian/common/ItemLightningRod.java new file mode 100644 index 000000000..4156bd8f7 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemLightningRod.java @@ -0,0 +1,55 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ItemLightningRod extends ItemObsidian +{ + public ItemLightningRod(int i) + { + super(i); + setMaxStackSize(1); + setMaxDamage(100); + setTabToDisplayOn(CreativeTabs.tabTools); + } + + public boolean hasEffect(ItemStack par1ItemStack) + { + return true; + } + + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) + { + if(itemstack.getItemDamage() == 0) + { + MovingObjectPosition movingobjectposition = entityplayer.rayTrace(75.0D, 1.0F); + if(movingobjectposition == null) + { + return itemstack; + } + Vec3 vec3d = movingobjectposition.hitVec; + double x = vec3d.xCoord; + double y = vec3d.yCoord; + double z = vec3d.zCoord; + int i = MathHelper.floor_double(x); + int j = MathHelper.floor_double(y); + int k = MathHelper.floor_double(z); + if(world.canBlockSeeTheSky(i, j, k) == false) + { + return itemstack; + } + EntityLightningBolt entitybolt = new EntityLightningBolt(world, 0D, 0D, 0D); + entitybolt.setLocationAndAngles(x, y, z, 0, 0.0F); + world.spawnEntityInWorld(entitybolt); + itemstack.setItemDamage(99); + } + return itemstack; + } + + public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) + { + if(itemstack.getItemDamage() > 0) + { + itemstack.damageItem(-1, (EntityLiving)entity); + } + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidian.java b/src/common/net/uberkat/obsidian/common/ItemObsidian.java new file mode 100644 index 000000000..f1f759f09 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidian.java @@ -0,0 +1,17 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ItemObsidian extends Item +{ + public ItemObsidian(int i) + { + super(i); + itemsList[256 + i] = this; + setTabToDisplayOn(CreativeTabs.tabAllSearch); + } + + public String getTextureFile() { + return "/obsidian/items.png"; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianArmor.java b/src/common/net/uberkat/obsidian/common/ItemObsidianArmor.java new file mode 100644 index 000000000..2032d279c --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianArmor.java @@ -0,0 +1,16 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ItemObsidianArmor extends ItemArmor +{ + public ItemObsidianArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) + { + super(par1, par2EnumArmorMaterial, par3, par4); + setTabToDisplayOn(CreativeTabs.tabCombat); + } + + public String getTextureFile() { + return "/obsidian/items.png"; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianAxe.java b/src/common/net/uberkat/obsidian/common/ItemObsidianAxe.java new file mode 100644 index 000000000..bcc544cd8 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianAxe.java @@ -0,0 +1,40 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Block; +import net.minecraft.src.EnumToolMaterial; +import net.minecraft.src.ItemStack; +import net.minecraft.src.Material; + +public class ItemObsidianAxe extends ItemObsidianTool +{ + private static Block blocksEffectiveAgainst[]; + + public ItemObsidianAxe(int par1, EnumToolMaterial par2EnumToolMaterial) + { + super(par1, 3, par2EnumToolMaterial, blocksEffectiveAgainst); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + if (par2Block != null && par2Block.blockMaterial == Material.wood) + { + return efficiencyOnProperMaterial; + } + else + { + return super.getStrVsBlock(par1ItemStack, par2Block); + } + } + + static + { + blocksEffectiveAgainst = (new Block[] + { + Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.woodSingleSlab, Block.woodDoubleSlab, Block.pumpkin, Block.pumpkinLantern + }); + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianBow.java b/src/common/net/uberkat/obsidian/common/ItemObsidianBow.java new file mode 100644 index 000000000..2b7342150 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianBow.java @@ -0,0 +1,125 @@ +package net.uberkat.obsidian.common; + +import java.util.Random; +import net.minecraft.src.*; + +public class ItemObsidianBow extends ItemObsidian +{ + public ItemObsidianBow(int par1) + { + super(par1); + maxStackSize = 1; + setMaxDamage(750); + setTabToDisplayOn(CreativeTabs.tabCombat); + } + + /** + * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount + */ + public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) + { + boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; + + if (flag || par3EntityPlayer.inventory.hasItem(ObsidianIngots.ObsidianArrow.shiftedIndex)) + { + int i = getMaxItemUseDuration(par1ItemStack) - par4; + float f = (float)i / 20F; + f = (f * f + f * 2.0F) / 3F; + + if ((double)f < 0.10000000000000001D) + { + return; + } + + if (f > 1.0F) + { + f = 1.0F; + } + + EntityObsidianArrow entityobsidianarrow = new EntityObsidianArrow(par2World, par3EntityPlayer, f * 2.0F); + + if (f == 1.0F) + { + entityobsidianarrow.func_70243_d(true); + } + + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack); + + if (j > 0) + { + entityobsidianarrow.setDamage(entityobsidianarrow.getDamage() + (double)j * 0.5D + 0.5D); + } + + int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack); + + if (k > 0) + { + entityobsidianarrow.setKnockbackStrength(k); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) + { + entityobsidianarrow.setFire(100); + } + + par1ItemStack.damageItem(1, par3EntityPlayer); + par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + + if (flag) + { + entityobsidianarrow.canBePickedUp = 2; + } + else + { + par3EntityPlayer.inventory.consumeInventoryItem(ObsidianIngots.ObsidianArrow.shiftedIndex); + } + + if (!par2World.isRemote) + { + par2World.spawnEntityInWorld(entityobsidianarrow); + } + } + } + + public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + return par1ItemStack; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack par1ItemStack) + { + return 0x11940; + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.bow; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(ObsidianIngots.ObsidianArrow.shiftedIndex)) + { + par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); + } + + return par1ItemStack; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return 1; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianHoe.java b/src/common/net/uberkat/obsidian/common/ItemObsidianHoe.java new file mode 100644 index 000000000..b56aa3178 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianHoe.java @@ -0,0 +1,62 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Block; +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.EnumToolMaterial; +import net.minecraft.src.Item; +import net.minecraft.src.ItemStack; +import net.minecraft.src.World; + +public class ItemObsidianHoe extends ItemObsidian +{ + public ItemObsidianHoe(int par1, EnumToolMaterial par2EnumToolMaterial) + { + super(par1); + maxStackSize = 1; + setMaxDamage(par2EnumToolMaterial.getMaxUses()); + } + + /** + * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return + * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ! + */ + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7) + { + if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6)) + { + return false; + } + + int i = par3World.getBlockId(par4, par5, par6); + int j = par3World.getBlockId(par4, par5 + 1, par6); + + if (par7 != 0 && j == 0 && i == Block.grass.blockID || i == Block.dirt.blockID) + { + Block block = Block.tilledField; + par3World.playSoundEffect((float)par4 + 0.5F, (float)par5 + 0.5F, (float)par6 + 0.5F, block.stepSound.getStepSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); + + if (par3World.isRemote) + { + return true; + } + else + { + par3World.setBlockWithNotify(par4, par5, par6, block.blockID); + par1ItemStack.damageItem(1, par2EntityPlayer); + return true; + } + } + else + { + return false; + } + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() + { + return true; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianKnife.java b/src/common/net/uberkat/obsidian/common/ItemObsidianKnife.java new file mode 100644 index 000000000..d95d0099f --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianKnife.java @@ -0,0 +1,114 @@ +package net.uberkat.obsidian.common; + +import java.util.Random; +import net.minecraft.src.*; + +public class ItemObsidianKnife extends ItemObsidian +{ + private EnumToolMaterial enumToolMaterial; + protected int weaponDamage; + protected float knockBack; + protected float strVsBlock; + protected int entityDamage; + protected int blockDamage; + protected int enchantability; + + public ItemObsidianKnife(int i, EnumToolMaterial enumtoolmaterial) + { + super(i); + enumToolMaterial = enumtoolmaterial; + maxStackSize = 1; + setMaxDamage((int)((float)enumtoolmaterial.getMaxUses() * 0.5F)); + weaponDamage = (int)((float)3 + (float)enumtoolmaterial.getDamageVsEntity() * 1.5F); + knockBack = 0.2F + (enumtoolmaterial != EnumToolMaterial.GOLD ? 0.0F : 0.2F); + strVsBlock = 1; + entityDamage = 2; + blockDamage = 2; + enchantability = enumtoolmaterial.getEnchantability(); + setTabToDisplayOn(CreativeTabs.tabCombat); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) + { + entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack)); + world.playSoundAtEntity(entityplayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!world.isRemote) + { + EntityKnife entityknife = new EntityKnife(world, entityplayer, itemstack); + + if (entityplayer.capabilities.isCreativeMode) + { + entityknife.doesArrowBelongToPlayer = false; + } + + world.spawnEntityInWorld(entityknife); + } + + if (entityplayer.capabilities.isCreativeMode) + { + return itemstack; + } + else + { + return new ItemStack(shiftedIndex, 0, 0); + } + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack itemstack, Block block) + { + return strVsBlock * (block.blockID != Block.web.blockID ? 1.0F : 10F); + } + + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block block) + { + return block.blockID == Block.web.blockID; + } + + public int getItemEnchantability() + { + return enchantability; + } + + public int getMaxItemUseDuration(ItemStack itemstack) + { + return 0x11940; + } + + public boolean isFull3D() + { + return true; + } + + public int getDamageVsEntity(Entity entity) + { + return weaponDamage; + } + + public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving) + { + itemstack.damageItem(blockDamage, entityliving); + return true; + } + + public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) + { + if (knockBack != 0.0F) + { + PhysicsHelper.knockBack(entityliving, entityliving1, knockBack); + } + + itemstack.damageItem(entityDamage, entityliving1); + return true; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianPaxel.java b/src/common/net/uberkat/obsidian/common/ItemObsidianPaxel.java new file mode 100644 index 000000000..11c8d448b --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianPaxel.java @@ -0,0 +1,79 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Block; +import net.minecraft.src.CreativeTabs; +import net.minecraft.src.EnumToolMaterial; +import net.minecraft.src.ItemStack; +import net.minecraft.src.Material; + +public class ItemObsidianPaxel extends ItemObsidianTool +{ + private static Block blocksEffectiveAgainst[]; + + public ItemObsidianPaxel(int i, EnumToolMaterial enumtoolmaterial) + { + super(i, 3, enumtoolmaterial, blocksEffectiveAgainst); + setTabToDisplayOn(CreativeTabs.tabTools); + } + + public boolean canHarvestBlock(Block block) + { + if (block == Block.obsidian) + { + return toolMaterial.getHarvestLevel() == 3; + } + if (block == Block.blockDiamond || block == Block.oreDiamond) + { + return toolMaterial.getHarvestLevel() >= 2; + } + if (block == Block.blockGold || block == Block.oreGold) + { + return toolMaterial.getHarvestLevel() >= 2; + } + if (block == Block.blockSteel || block == Block.oreIron) + { + return toolMaterial.getHarvestLevel() >= 1; + } + if (block == Block.blockLapis || block == Block.oreLapis) + { + return toolMaterial.getHarvestLevel() >= 1; + } + if (block == Block.oreRedstone || block == Block.oreRedstoneGlowing) + { + return toolMaterial.getHarvestLevel() >= 2; + } + if (block.blockMaterial == Material.rock) + { + return true; + } + else + { + return block.blockMaterial == Material.iron; + } + } + + public float getStrVsBlock(ItemStack itemstack, Block block) + { + if (block != null && (block.blockMaterial == Material.iron || block.blockMaterial == Material.rock)) + { + return efficiencyOnProperMaterial; + } + else + { + return super.getStrVsBlock(itemstack, block); + } + } + + static + { + blocksEffectiveAgainst = (new Block[] + { + Block.cobblestone, Block.woodSingleSlab, Block.woodDoubleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, + Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, + Block.railDetector, Block.railPowered, Block.leaves, Block.grass, Block.dirt, Block.sand, + Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium, Block.planks, Block.bookShelf, Block.wood, + Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern, Block.snow, Block.pistonBase, Block.pistonStickyBase, Block.workbench, + Block.stoneOvenActive, Block.stoneOvenIdle, Block.music, Block.trapdoor, Block.silverfish, Block.stoneBrick, Block.glowStone + }); + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianPickaxe.java b/src/common/net/uberkat/obsidian/common/ItemObsidianPickaxe.java new file mode 100644 index 000000000..c66fb8ee4 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianPickaxe.java @@ -0,0 +1,87 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Block; +import net.minecraft.src.CreativeTabs; +import net.minecraft.src.EnumToolMaterial; +import net.minecraft.src.ItemStack; +import net.minecraft.src.Material; + +public class ItemObsidianPickaxe extends ItemObsidianTool +{ + private static Block blocksEffectiveAgainst[]; + + public ItemObsidianPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial) + { + super(par1, 2, par2EnumToolMaterial, blocksEffectiveAgainst); + setTabToDisplayOn(CreativeTabs.tabTools); + } + + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block par1Block) + { + if (par1Block == Block.obsidian) + { + return toolMaterial.getHarvestLevel() == 3; + } + + if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond) + { + return toolMaterial.getHarvestLevel() >= 2; + } + + if (par1Block == Block.blockGold || par1Block == Block.oreGold) + { + return toolMaterial.getHarvestLevel() >= 2; + } + + if (par1Block == Block.blockSteel || par1Block == Block.oreIron) + { + return toolMaterial.getHarvestLevel() >= 1; + } + + if (par1Block == Block.blockLapis || par1Block == Block.oreLapis) + { + return toolMaterial.getHarvestLevel() >= 1; + } + + if (par1Block == Block.oreRedstone || par1Block == Block.oreRedstoneGlowing) + { + return toolMaterial.getHarvestLevel() >= 2; + } + + if (par1Block.blockMaterial == Material.rock) + { + return true; + } + + return par1Block.blockMaterial == Material.iron; + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock)) + { + return efficiencyOnProperMaterial; + } + else + { + return super.getStrVsBlock(par1ItemStack, par2Block); + } + } + + static + { + blocksEffectiveAgainst = (new Block[] + { + Block.cobblestone, Block.stoneSingleSlab, Block.stoneDoubleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold, + Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, + Block.railDetector, Block.railPowered + }); + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianSpade.java b/src/common/net/uberkat/obsidian/common/ItemObsidianSpade.java new file mode 100644 index 000000000..497641e5d --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianSpade.java @@ -0,0 +1,37 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Block; +import net.minecraft.src.CreativeTabs; +import net.minecraft.src.EnumToolMaterial; + +public class ItemObsidianSpade extends ItemObsidianTool +{ + private static Block blocksEffectiveAgainst[]; + + public ItemObsidianSpade(int par1, EnumToolMaterial par2EnumToolMaterial) + { + super(par1, 1, par2EnumToolMaterial, blocksEffectiveAgainst); + setTabToDisplayOn(CreativeTabs.tabTools); + } + + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block par1Block) + { + if (par1Block == Block.snow) + { + return true; + } + + return par1Block == Block.blockSnow; + } + + static + { + blocksEffectiveAgainst = (new Block[] + { + Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium + }); + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianSword.java b/src/common/net/uberkat/obsidian/common/ItemObsidianSword.java new file mode 100644 index 000000000..fc4044d5a --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianSword.java @@ -0,0 +1,104 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Block; +import net.minecraft.src.CreativeTabs; +import net.minecraft.src.Entity; +import net.minecraft.src.EntityLiving; +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.EnumAction; +import net.minecraft.src.EnumToolMaterial; +import net.minecraft.src.Item; +import net.minecraft.src.ItemStack; +import net.minecraft.src.World; + +public class ItemObsidianSword extends ItemObsidian +{ + private int weaponDamage; + private final EnumToolMaterial toolMaterial; + + public ItemObsidianSword(int par1, EnumToolMaterial par2EnumToolMaterial) + { + super(par1); + toolMaterial = par2EnumToolMaterial; + maxStackSize = 1; + setMaxDamage(par2EnumToolMaterial.getMaxUses()); + weaponDamage = 4 + par2EnumToolMaterial.getDamageVsEntity(); + setTabToDisplayOn(CreativeTabs.tabCombat); + } + + /** + * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if + * sword + */ + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) + { + return par2Block.blockID != Block.web.blockID ? 1.5F : 15F; + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving) + { + par1ItemStack.damageItem(1, par3EntityLiving); + return true; + } + + public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving) + { + par1ItemStack.damageItem(2, par6EntityLiving); + return true; + } + + /** + * Returns the damage against a given entity. + */ + public int getDamageVsEntity(Entity par1Entity) + { + return weaponDamage; + } + + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() + { + return true; + } + + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.block; + } + + public int getMaxItemUseDuration(ItemStack par1ItemStack) + { + return 0x11940; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack)); + return par1ItemStack; + } + + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block par1Block) + { + return par1Block.blockID == Block.web.blockID; + } + + /** + * Return the enchantability factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() + { + return toolMaterial.getEnchantability(); + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemObsidianTool.java b/src/common/net/uberkat/obsidian/common/ItemObsidianTool.java new file mode 100644 index 000000000..53e98fe9a --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemObsidianTool.java @@ -0,0 +1,22 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.Block; +import net.minecraft.src.Entity; +import net.minecraft.src.EntityLiving; +import net.minecraft.src.EnumToolMaterial; +import net.minecraft.src.Item; +import net.minecraft.src.ItemStack; +import net.minecraft.src.ItemTool; + +public class ItemObsidianTool extends ItemTool +{ + public ItemObsidianTool(int par1, int par2, EnumToolMaterial par3EnumToolMaterial, Block par4ArrayOfBlock[]) + { + super(par1, par2, par3EnumToolMaterial, par4ArrayOfBlock); + } + + public String getTextureFile() + { + return "/obsidian/items.png"; + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemStopwatch.java b/src/common/net/uberkat/obsidian/common/ItemStopwatch.java new file mode 100644 index 000000000..0a260701a --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemStopwatch.java @@ -0,0 +1,36 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ItemStopwatch extends ItemObsidian { + + public ItemStopwatch(int i) + { + super(i); + setMaxStackSize(1); + setMaxDamage(5000); + setTabToDisplayOn(CreativeTabs.tabTools); + } + + public boolean hasEffect(ItemStack itemstack) + { + return true; + } + + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) + { + if(itemstack.getItemDamage() == 0) + { + entityplayer.openGui(ObsidianIngots.instance, 18, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ); + } + return itemstack; + } + + public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) + { + if(itemstack.getItemDamage() > 0) + { + itemstack.damageItem(-1, (EntityLiving)entity); + } + } +} diff --git a/src/common/net/uberkat/obsidian/common/ItemWeatherOrb.java b/src/common/net/uberkat/obsidian/common/ItemWeatherOrb.java new file mode 100644 index 000000000..4ce72e7cd --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ItemWeatherOrb.java @@ -0,0 +1,36 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ItemWeatherOrb extends ItemObsidian +{ + public ItemWeatherOrb(int i) + { + super(i); + setMaxStackSize(1); + setMaxDamage(5000); + setTabToDisplayOn(CreativeTabs.tabTools); + } + + public boolean hasEffect(ItemStack itemstack) + { + return true; + } + + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) + { + if(itemstack.getItemDamage() == 0) + { + entityplayer.openGui(ObsidianIngots.instance, 20, world, (int)entityplayer.posX, (int)entityplayer.posY, (int)entityplayer.posZ); + } + return itemstack; + } + + public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag) + { + if(itemstack.getItemDamage() > 0) + { + itemstack.damageItem(-1, (EntityLiving)entity); + } + } +} diff --git a/src/common/net/uberkat/obsidian/common/ObsidianHooks.java b/src/common/net/uberkat/obsidian/common/ObsidianHooks.java new file mode 100644 index 000000000..21c4076e1 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ObsidianHooks.java @@ -0,0 +1,11 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class ObsidianHooks +{ + public void hook() + { + //To be completed in the future. + } +} diff --git a/src/common/net/uberkat/obsidian/common/ObsidianIngots.java b/src/common/net/uberkat/obsidian/common/ObsidianIngots.java new file mode 100644 index 000000000..227d824b6 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ObsidianIngots.java @@ -0,0 +1,901 @@ +package net.uberkat.obsidian.common; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.Socket; +import java.net.URL; +import java.util.Map; +import java.util.Properties; +import java.util.Random; +import java.util.logging.Logger; + +import net.minecraftforge.common.*; +import net.minecraft.src.*; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.*; +import cpw.mods.fml.common.Mod.Init; +import cpw.mods.fml.common.Mod.PreInit; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.NetworkMod; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.common.registry.TickRegistry; + +/** + * Obsidian Ingots mod -- adds in Tools, Armor, Weapons, Machines, and Magic. Universal files. + * @author AidanBrady + * + */ +@Mod(modid = "ObsidianIngots", name = "Obsidian Ingots", version = "4.0") +@NetworkMod(channels = { "ObsidianIngots" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) +public class ObsidianIngots +{ + /** + * Obsidian Ingots logger instance + */ + public static Logger logger = Logger.getLogger("Minecraft"); + + /** + * Obsidian Ingots proxy instance + */ + @SidedProxy(clientSide = "net.uberkat.obsidian.client.ClientProxy", serverSide = "net.uberkat.obsidian.server.ServerProxy") + public static CommonProxy proxy; + + /** + * Obsidian Ingots mod instance + */ + public static ObsidianIngots instance; + + /** + * Obsidian Ingots hooks instance + */ + public static ObsidianHooks hooks; + + //Initial Declarations + + public static Version versionNumber = new Version(4, 0, 0); + public static String latestVersionNumber; + public static String recentNews; + public static String hostIP = "71.56.58.57"; + public static int hostPort = 3073; + //Enums + //Tools + public static EnumToolMaterial toolOBSIDIAN = EnumHelper.addToolMaterial("OBSIDIAN", 3, 2500, 20F, 10, 50); + public static EnumToolMaterial toolOBSIDIAN2 = EnumHelper.addToolMaterial("OBSIDIAN2", 3, 3000, 25F, 10, 100); + public static EnumToolMaterial toolLAZULI = EnumHelper.addToolMaterial("LAZULI", 2, 200, 5.0F, 0, 22); + public static EnumToolMaterial toolLAZULI2 = EnumHelper.addToolMaterial("LAZULI2", 2, 250, 6.0F, 4, 50); + public static EnumToolMaterial toolPLATINUM = EnumHelper.addToolMaterial("PLATINUM", 3, 800, 15F, 5, 30); + public static EnumToolMaterial toolPLATINUM2 = EnumHelper.addToolMaterial("PLATINUM2", 3, 1000, 20F, 5, 60); + public static EnumToolMaterial toolREDSTONE = EnumHelper.addToolMaterial("REDSTONE", 2, 250, 10F, 6, 50); + public static EnumToolMaterial toolREDSTONE2 = EnumHelper.addToolMaterial("REDSTONE2", 2, 400, 12F, 6, 60); + public static EnumToolMaterial toolGLOWSTONE = EnumHelper.addToolMaterial("GLOWSTONE", 2, 300, 14, 5, 80); + public static EnumToolMaterial toolGLOWSTONE2 = EnumHelper.addToolMaterial("GLOWSTONE2", 2, 450, 18, 5, 100); + //Armor + public static EnumArmorMaterial armorOBSIDIAN = EnumHelper.addArmorMaterial("OBSIDIAN", 50, new int[]{5, 12, 8, 5}, 50); + public static EnumArmorMaterial armorLAZULI = EnumHelper.addArmorMaterial("LAZULI", 13, new int[]{2, 5, 4, 2}, 50); + public static EnumArmorMaterial armorPLATINUM = EnumHelper.addArmorMaterial("PLATINUM", 30, new int[]{4, 10, 7, 4}, 50); + public static EnumArmorMaterial armorREDSTONE = EnumHelper.addArmorMaterial("REDSTONE", 16, new int[]{2, 7, 5, 3}, 50); + public static EnumArmorMaterial armorGLOWSTONE = EnumHelper.addArmorMaterial("GLOWSTONE", 18, new int[]{3, 7, 6, 3}, 50); + //Block IDs + public static int platinumOreID = 200; + public static int platinumBlockID = 201; + public static int redstoneBlockID = 202; + public static int obsidianTNTID = 203; + public static int refinedObsidianID = 204; + public static int lifeBlockID = 205; + public static int enrichmentChamberID = 206; + public static int platinumCompressorID = 207; + public static int combinerID = 208; + public static int crusherID = 209; + public static int coalBlockID = 210; + public static int refinedGlowstoneID = 211; + + //Base Items + public static Item WoodPaxel; + public static Item StonePaxel; + public static Item IronPaxel; + public static Item DiamondPaxel; + public static Item GoldPaxel; + public static Item WoodKnife; + public static Item StoneKnife; + public static Item IronKnife; + public static Item DiamondKnife; + public static Item GoldKnife; + public static Item IronDust; + public static Item GoldDust; + + //Glowstone Items + public static Block RefinedGlowstone; + public static Item GlowstoneIngot; + public static Item GlowstonePaxel; + public static Item GlowstonePickaxe; + public static Item GlowstoneAxe; + public static Item GlowstoneSpade; + public static Item GlowstoneHoe; + public static Item GlowstoneSword; + public static Item GlowstoneHelmet; + public static Item GlowstoneBody; + public static Item GlowstoneLegs; + public static Item GlowstoneBoots; + public static Item GlowstoneKnife; + + //Redstone Items + public static Block RedstoneBlock; + public static Item RedstoneIngot; + public static Item RedstonePaxel; + public static Item RedstonePickaxe; + public static Item RedstoneAxe; + public static Item RedstoneSpade; + public static Item RedstoneHoe; + public static Item RedstoneSword; + public static Item RedstoneHelmet; + public static Item RedstoneBody; + public static Item RedstoneLegs; + public static Item RedstoneBoots; + public static Item RedstoneKnife; + + //Platinum Items + public static Block PlatinumOre; + public static Block PlatinumBlock; + public static Item PlatinumDust; + public static Item PlatinumIngot; + public static Item PlatinumPaxel; + public static Item PlatinumPickaxe; + public static Item PlatinumAxe; + public static Item PlatinumSpade; + public static Item PlatinumHoe; + public static Item PlatinumSword; + public static Item PlatinumHelmet; + public static Item PlatinumBody; + public static Item PlatinumLegs; + public static Item PlatinumBoots; + public static Item PlatinumKnife; + + //Obsidian Items + public static Block RefinedObsidian; + public static Item ObsidianDust; + public static Item ObsidianHelmet; + public static Item ObsidianBody; + public static Item ObsidianLegs; + public static Item ObsidianBoots; + public static Item ObsidianIngot; + public static Item ObsidianPaxel; + public static Item ObsidianPickaxe; + public static Item ObsidianAxe; + public static Item ObsidianSpade; + public static Item ObsidianHoe; + public static Item ObsidianSword; + public static Item ObsidianKnife; + + //Lazuli Items + public static Item LazuliPaxel; + public static Item LazuliPickaxe; + public static Item LazuliAxe; + public static Item LazuliSpade; + public static Item LazuliHoe; + public static Item LazuliSword; + public static Item LazuliHelmet; + public static Item LazuliBody; + public static Item LazuliLegs; + public static Item LazuliBoots; + public static Item LazuliKnife; + + //Extra Items + public static Item ObsidianArrow; + public static Item ObsidianBow; + public static Item LightningRod; + public static Item Stopwatch; + public static Item WeatherOrb; + + //Extra Blocks + public static Block ObsidianTNT; + public static Block LifeBlock; + public static Block EnrichmentChamber; + public static Block PlatinumCompressor; + public static Block Combiner; + public static Block Crusher; + public static Block CoalBlock; + + //Boolean Values + public static boolean extrasEnabled; + public static boolean oreGenerationEnabled; + + //Extra data + public static float ObsidianTNTBlastRadius = 12.0F; + public static int ObsidianTNTDelay = 100; + + /** + * Total ticks passed since thePlayer joined theWorld + */ + public static int ticksPassed = 0; + + /** + * Adds all in-game crafting and smelting recipes. + */ + public void addRecipes() + { + //Crafting Recipes + //Base + GameRegistry.addRecipe(new ItemStack(WoodPaxel, 1), new Object[] { + "XYZ", " T ", " T ", Character.valueOf('X'), Item.axeWood, Character.valueOf('Y'), Item.pickaxeWood, Character.valueOf('Z'), Item.shovelWood, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(StonePaxel, 1), new Object[] { + "XYZ", " T ", " T ", Character.valueOf('X'), Item.axeStone, Character.valueOf('Y'), Item.pickaxeStone, Character.valueOf('Z'), Item.shovelStone, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(IronPaxel, 1), new Object[] { + "XYZ", " T ", " T ", Character.valueOf('X'), Item.axeSteel, Character.valueOf('Y'), Item.pickaxeSteel, Character.valueOf('Z'), Item.shovelSteel, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(DiamondPaxel, 1), new Object[] { + "XYZ", " T ", " T ", Character.valueOf('X'), Item.axeDiamond, Character.valueOf('Y'), Item.pickaxeDiamond, Character.valueOf('Z'), Item.shovelDiamond, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GoldPaxel, 1), new Object[] { + "XYZ", " T ", " T ", Character.valueOf('X'), Item.axeGold, Character.valueOf('Y'), Item.pickaxeGold, Character.valueOf('Z'), Item.shovelGold, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(WoodKnife), new Object[] { + " ^", "I ", Character.valueOf('^'), Block.planks, Character.valueOf('I'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(StoneKnife), new Object[] { + " ^", "I ", Character.valueOf('^'), Block.cobblestone, Character.valueOf('I'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(IronKnife), new Object[] { + " ^", "I ", Character.valueOf('^'), Item.ingotIron, Character.valueOf('I'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(DiamondKnife), new Object[] { + " ^", "I ", Character.valueOf('^'), Item.diamond, Character.valueOf('I'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GoldKnife), new Object[] { + " ^", "I ", Character.valueOf('^'), Item.ingotGold, Character.valueOf('I'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(Item.coal, 9), new Object[] { + "*", Character.valueOf('*'), Item.coal + }); + GameRegistry.addRecipe(new ItemStack(CoalBlock, 1), new Object[] { + "***", "***", "***", Character.valueOf('*'), Item.coal + }); + + //Obsidian + GameRegistry.addRecipe(new ItemStack(RefinedObsidian, 0), new Object[] { + "***", "***", "***", Character.valueOf('*'), ObsidianIngot + }); + GameRegistry.addRecipe(new ItemStack(ObsidianIngot, 9), new Object[] { + "*", Character.valueOf('*'), new ItemStack(RefinedObsidian, 0) + }); + GameRegistry.addRecipe(new ItemStack(ObsidianHelmet, 1), new Object[] { + "***", "* *", Character.valueOf('*'), ObsidianIngot + }); + GameRegistry.addRecipe(new ItemStack(ObsidianBody, 1), new Object[] { + "* *", "***", "***", Character.valueOf('*'), ObsidianIngot + }); + GameRegistry.addRecipe(new ItemStack(ObsidianLegs, 1), new Object[] { + "***", "* *", "* *", Character.valueOf('*'), ObsidianIngot + }); + GameRegistry.addRecipe(new ItemStack(ObsidianBoots, 1), new Object[] { + "* *", "* *", Character.valueOf('*'), ObsidianIngot + }); + GameRegistry.addRecipe(new ItemStack(ObsidianPaxel, 1), new Object[]{ + "XYZ", " T ", " T ", Character.valueOf('X'), ObsidianAxe, Character.valueOf('Y'), ObsidianPickaxe, Character.valueOf('Z'), ObsidianSpade, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(ObsidianPickaxe, 1), new Object[]{ + "XXX", " T ", " T ", Character.valueOf('X'), ObsidianIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(ObsidianAxe, 1), new Object[]{ + "XX", "XT", " T", Character.valueOf('X'), ObsidianIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(ObsidianSpade, 1), new Object[]{ + "X", "T", "T", Character.valueOf('X'), ObsidianIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(ObsidianHoe, 1), new Object[]{ + "XX", " T", " T", Character.valueOf('X'), ObsidianIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(ObsidianSword, 1), new Object[]{ + "X", "X", "T", Character.valueOf('X'), ObsidianIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(ObsidianKnife, 1), new Object[] { + " ^", "I ", Character.valueOf('^'), ObsidianIngot, Character.valueOf('I'), Item.stick + }); + + //Glowstone + GameRegistry.addRecipe(new ItemStack(RefinedGlowstone, 1), new Object[] { + "***", "***", "***", Character.valueOf('*'), GlowstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneIngot, 9), new Object[] { + "*", Character.valueOf('*'), RefinedGlowstone + }); + GameRegistry.addRecipe(new ItemStack(GlowstonePaxel, 1), new Object[]{ + "XYZ", " T ", " T ", Character.valueOf('X'), GlowstoneAxe, Character.valueOf('Y'), GlowstonePickaxe, Character.valueOf('Z'), GlowstoneSpade, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GlowstonePickaxe, 1), new Object[]{ + "XXX", " T ", " T ", Character.valueOf('X'), GlowstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneAxe, 1), new Object[]{ + "XX", "XT", " T", Character.valueOf('X'), GlowstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneSpade, 1), new Object[]{ + "X", "T", "T", Character.valueOf('X'), GlowstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneHoe, 1), new Object[]{ + "XX", " T", " T", Character.valueOf('X'), GlowstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneSword, 1), new Object[]{ + "X", "X", "T", Character.valueOf('X'), GlowstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneHelmet, 1), new Object[] { + "***", "* *", Character.valueOf('*'), GlowstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneBody, 1), new Object[] { + "* *", "***", "***", Character.valueOf('*'), GlowstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneLegs, 1), new Object[] { + "***", "* *", "* *", Character.valueOf('*'), GlowstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneBoots, 1), new Object[] { + "* *", "* *", Character.valueOf('*'), GlowstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(GlowstoneKnife, 1), new Object[] { + " ^", "I ", Character.valueOf('^'), GlowstoneIngot, Character.valueOf('I'), Item.stick + }); + + //Lazuli + GameRegistry.addRecipe(new ItemStack(LazuliHelmet, 1), new Object[] { + "***", "* *", Character.valueOf('*'), new ItemStack(Item.dyePowder, 1, 4) + }); + GameRegistry.addRecipe(new ItemStack(LazuliBody, 1), new Object[] { + "* *", "***", "***", Character.valueOf('*'), new ItemStack(Item.dyePowder, 1, 4) + }); + GameRegistry.addRecipe(new ItemStack(LazuliLegs, 1), new Object[] { + "***", "* *", "* *", Character.valueOf('*'), new ItemStack(Item.dyePowder, 1, 4) + }); + GameRegistry.addRecipe(new ItemStack(LazuliBoots, 1), new Object[] { + "* *", "* *", Character.valueOf('*'), new ItemStack(Item.dyePowder, 1, 4) + }); + GameRegistry.addRecipe(new ItemStack(LazuliPaxel, 1), new Object[]{ + "XYZ", " T ", " T ", Character.valueOf('X'), LazuliAxe, Character.valueOf('Y'), LazuliPickaxe, Character.valueOf('Z'), LazuliSpade, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(LazuliPickaxe, 1), new Object[]{ + "XXX", " T ", " T ", Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(LazuliAxe, 1), new Object[]{ + "XX", "XT", " T", Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(LazuliSpade, 1), new Object[]{ + "X", "T", "T", Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(LazuliHoe, 1), new Object[]{ + "XX", " T", " T", Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(LazuliSword, 1), new Object[]{ + "X", "X", "T", Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(LazuliKnife, 1), new Object[] { + " ^", "I ", Character.valueOf('^'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('I'), Item.stick + }); + + //Platinum + GameRegistry.addRecipe(new ItemStack(PlatinumBlock, 1), new Object[]{ + "XXX", "XXX", "XXX", Character.valueOf('X'), PlatinumIngot + }); + GameRegistry.addRecipe(new ItemStack(PlatinumPaxel, 1), new Object[]{ + "XYZ", " T ", " T ", Character.valueOf('X'), PlatinumAxe, Character.valueOf('Y'), PlatinumPickaxe, Character.valueOf('Z'), PlatinumSpade, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(PlatinumPickaxe, 1), new Object[]{ + "XXX", " T ", " T ", Character.valueOf('X'), PlatinumIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(PlatinumAxe, 1), new Object[]{ + "XX", "XT", " T", Character.valueOf('X'), PlatinumIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(PlatinumSpade, 1), new Object[]{ + "X", "T", "T", Character.valueOf('X'), PlatinumIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(PlatinumHoe, 1), new Object[]{ + "XX", " T", " T", Character.valueOf('X'), PlatinumIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(PlatinumSword, 1), new Object[]{ + "X", "X", "T", Character.valueOf('X'), PlatinumIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(PlatinumHelmet, 1), new Object[] { + "***", "* *", Character.valueOf('*'), PlatinumIngot + }); + GameRegistry.addRecipe(new ItemStack(PlatinumBody, 1), new Object[] { + "* *", "***", "***", Character.valueOf('*'), PlatinumIngot + }); + GameRegistry.addRecipe(new ItemStack(PlatinumLegs, 1), new Object[] { + "***", "* *", "* *", Character.valueOf('*'), PlatinumIngot + }); + GameRegistry.addRecipe(new ItemStack(PlatinumBoots, 1), new Object[] { + "* *", "* *", Character.valueOf('*'), PlatinumIngot + }); + GameRegistry.addRecipe(new ItemStack(PlatinumIngot, 9), new Object[] { + "*", Character.valueOf('*'), PlatinumBlock + }); + GameRegistry.addRecipe(new ItemStack(PlatinumKnife, 1), new Object[] { + " ^", "I ", Character.valueOf('^'), PlatinumIngot, Character.valueOf('I'), Item.stick + }); + + //Redstone + GameRegistry.addRecipe(new ItemStack(RedstoneBlock, 1), new Object[] { + "***", "***", "***", Character.valueOf('*'), RedstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(RedstoneIngot, 9), new Object[] { + "*", Character.valueOf('*'), RedstoneBlock + }); + GameRegistry.addRecipe(new ItemStack(RedstonePaxel, 1), new Object[]{ + "XYZ", " T ", " T ", Character.valueOf('X'), RedstoneAxe, Character.valueOf('Y'), RedstonePickaxe, Character.valueOf('Z'), RedstoneSpade, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(RedstonePickaxe, 1), new Object[]{ + "XXX", " T ", " T ", Character.valueOf('X'), RedstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(RedstoneAxe, 1), new Object[]{ + "XX", "XT", " T", Character.valueOf('X'), RedstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(RedstoneSpade, 1), new Object[]{ + "X", "T", "T", Character.valueOf('X'), RedstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(RedstoneHoe, 1), new Object[]{ + "XX", " T", " T", Character.valueOf('X'), RedstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(RedstoneSword, 1), new Object[]{ + "X", "X", "T", Character.valueOf('X'), RedstoneIngot, Character.valueOf('T'), Item.stick + }); + GameRegistry.addRecipe(new ItemStack(RedstoneHelmet, 1), new Object[] { + "***", "* *", Character.valueOf('*'), RedstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(RedstoneBody, 1), new Object[] { + "* *", "***", "***", Character.valueOf('*'), RedstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(RedstoneLegs, 1), new Object[] { + "***", "* *", "* *", Character.valueOf('*'), RedstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(RedstoneBoots, 1), new Object[] { + "* *", "* *", Character.valueOf('*'), RedstoneIngot + }); + GameRegistry.addRecipe(new ItemStack(RedstoneKnife, 1), new Object[] { + " ^", "I ", Character.valueOf('^'), RedstoneIngot, Character.valueOf('I'), Item.stick + }); + + //Extra + GameRegistry.addRecipe(new ItemStack(ObsidianTNT, 1), new Object[] { + "***", "XXX", "***", Character.valueOf('*'), Block.obsidian, Character.valueOf('X'), Block.tnt + }); + GameRegistry.addRecipe(new ItemStack(ObsidianArrow, 8), new Object[] { + "A", "B", "C", Character.valueOf('A'), ObsidianIngot, Character.valueOf('B'), Item.stick, Character.valueOf('C'), Item.feather + }); + GameRegistry.addRecipe(new ItemStack(ObsidianBow, 1), new Object[] { + " AB", "A B", " AB", Character.valueOf('A'), ObsidianIngot, Character.valueOf('B'), Item.silk + }); + if(extrasEnabled) + { + GameRegistry.addRecipe(new ItemStack(LifeBlock, 1), new Object[] { + "DDD", "DOD", "DDD", Character.valueOf('D'), Block.blockDiamond, Character.valueOf('O'), RefinedObsidian + }); + } + GameRegistry.addRecipe(new ItemStack(PlatinumCompressor, 1), new Object[] { + "***", "*P*", "***", Character.valueOf('*'), Item.redstone, Character.valueOf('P'), PlatinumBlock + }); + GameRegistry.addRecipe(new ItemStack(EnrichmentChamber, 1), new Object[] { + "***", "*R*", "***", Character.valueOf('*'), PlatinumIngot, Character.valueOf('R'), Item.redstone + }); + GameRegistry.addRecipe(new ItemStack(Combiner, 1), new Object[] { + "***", "*P*", "***", Character.valueOf('*'), Block.cobblestone, Character.valueOf('P'), PlatinumBlock + }); + GameRegistry.addRecipe(new ItemStack(Crusher, 1), new Object[] { + "***", "*L*", "***", Character.valueOf('*'), PlatinumIngot, Character.valueOf('L'), Item.bucketLava + }); + + //Smelting + GameRegistry.addSmelting(platinumOreID, new ItemStack(PlatinumIngot), 1.0F); + } + /** + * Adds all item and block names. + */ + public void addNames() + { + //Base + ObsidianUtils.addName(WoodPaxel, "Wood Paxel"); + ObsidianUtils.addName(StonePaxel, "Stone Paxel"); + ObsidianUtils.addName(IronPaxel, "Iron Paxel"); + ObsidianUtils.addName(DiamondPaxel, "Diamond Paxel"); + ObsidianUtils.addName(GoldPaxel, "Gold Paxel"); + ObsidianUtils.addName(WoodKnife, "Wood Knife"); + ObsidianUtils.addName(StoneKnife, "Stone Knife"); + ObsidianUtils.addName(IronKnife, "Iron Knife"); + ObsidianUtils.addName(DiamondKnife, "Diamond Knife"); + ObsidianUtils.addName(GoldKnife, "Gold Knife"); + ObsidianUtils.addName(IronDust, "Iron Dust"); + ObsidianUtils.addName(GoldDust, "Gold Dust"); + + //Obsidian + ObsidianUtils.addName(RefinedObsidian, "Refined Obsidian"); + ObsidianUtils.addName(ObsidianDust, "Obsidian Dust"); + ObsidianUtils.addName(ObsidianHelmet, "Obsidian Helmet"); + ObsidianUtils.addName(ObsidianBody, "Obsidian Chestplate"); + ObsidianUtils.addName(ObsidianLegs, "Obsidian Leggings"); + ObsidianUtils.addName(ObsidianBoots, "Obsidian Boots"); + ObsidianUtils.addName(ObsidianIngot, "Obsidian Ingot"); + ObsidianUtils.addName(ObsidianPaxel, "Obsidian Paxel"); + ObsidianUtils.addName(ObsidianPickaxe, "Obsidian Pickaxe"); + ObsidianUtils.addName(ObsidianAxe, "Obsidian Axe"); + ObsidianUtils.addName(ObsidianSpade, "Obsidian Shovel"); + ObsidianUtils.addName(ObsidianHoe, "Obsidian Hoe"); + ObsidianUtils.addName(ObsidianSword, "Obsidian Sword"); + ObsidianUtils.addName(ObsidianKnife, "Obsidian Knife"); + + //Lazuli + ObsidianUtils.addName(LazuliHelmet, "Lapis Lazuli Helmet"); + ObsidianUtils.addName(LazuliBody, "Lapis Lazuli Chestplate"); + ObsidianUtils.addName(LazuliLegs, "Lapis Lazuli Leggings"); + ObsidianUtils.addName(LazuliBoots, "Lapis Lazuli Boots"); + ObsidianUtils.addName(LazuliPaxel, "Lapis Lazuli Paxel"); + ObsidianUtils.addName(LazuliPickaxe, "Lapis Lazuli Pickaxe"); + ObsidianUtils.addName(LazuliAxe, "Lapis Lazuli Axe"); + ObsidianUtils.addName(LazuliSpade, "Lapis Lazuli Shovel"); + ObsidianUtils.addName(LazuliHoe, "Lapis Lazuli Hoe"); + ObsidianUtils.addName(LazuliSword, "Lapis Lazuli Sword"); + ObsidianUtils.addName(LazuliKnife, "Lazuli Knife"); + + //Platinum + ObsidianUtils.addName(PlatinumOre, "Platinum Ore"); + ObsidianUtils.addName(PlatinumBlock, "Platinum Block"); + ObsidianUtils.addName(PlatinumDust, "Platinum Dust"); + ObsidianUtils.addName(PlatinumHelmet, "Platinum Helmet"); + ObsidianUtils.addName(PlatinumBody, "Platinum Chestplate"); + ObsidianUtils.addName(PlatinumLegs, "Platinum Leggings"); + ObsidianUtils.addName(PlatinumBoots, "Platinum Boots"); + ObsidianUtils.addName(PlatinumIngot, "Platinum Ingot"); + ObsidianUtils.addName(PlatinumPaxel, "Platinum Paxel"); + ObsidianUtils.addName(PlatinumPickaxe, "Platinum Pickaxe"); + ObsidianUtils.addName(PlatinumAxe, "Platinum Axe"); + ObsidianUtils.addName(PlatinumSpade, "Platinum Shovel"); + ObsidianUtils.addName(PlatinumHoe, "Platinum Hoe"); + ObsidianUtils.addName(PlatinumSword, "Platinum Sword"); + ObsidianUtils.addName(PlatinumKnife, "Platinum Knife"); + + //Redstone + ObsidianUtils.addName(RedstoneBlock, "Redstone Block"); + ObsidianUtils.addName(RedstoneBlock, "Redstone Block"); + ObsidianUtils.addName(RedstoneHelmet, "Redstone Helmet"); + ObsidianUtils.addName(RedstoneBody, "Redstone Chestplate"); + ObsidianUtils.addName(RedstoneLegs, "Redstone Leggings"); + ObsidianUtils.addName(RedstoneBoots, "Redstone Boots"); + ObsidianUtils.addName(RedstoneIngot, "Redstone Ingot"); + ObsidianUtils.addName(RedstonePaxel, "Redstone Paxel"); + ObsidianUtils.addName(RedstonePickaxe, "Redstone Pickaxe"); + ObsidianUtils.addName(RedstoneAxe, "Redstone Axe"); + ObsidianUtils.addName(RedstoneSpade, "Redstone Shovel"); + ObsidianUtils.addName(RedstoneHoe, "Redstone Hoe"); + ObsidianUtils.addName(RedstoneSword, "Redstone Sword"); + ObsidianUtils.addName(RedstoneBlock, "Redstone Block"); + ObsidianUtils.addName(RedstoneKnife, "Redstone Knife"); + + //Glowstone + ObsidianUtils.addName(RefinedGlowstone, "Refined Glowstone Block"); + ObsidianUtils.addName(GlowstoneIngot, "Glowstone Ingot"); + ObsidianUtils.addName(GlowstonePaxel, "Glowstone Paxel"); + ObsidianUtils.addName(GlowstonePickaxe, "Glowstone Pickaxe"); + ObsidianUtils.addName(GlowstoneAxe, "Glowstone Axe"); + ObsidianUtils.addName(GlowstoneSpade, "Glowstone Shovel"); + ObsidianUtils.addName(GlowstoneHoe, "Glowstone Hoe"); + ObsidianUtils.addName(GlowstoneSword, "Glowstone Sword"); + ObsidianUtils.addName(GlowstoneHelmet, "Glowstone Helmet"); + ObsidianUtils.addName(GlowstoneBody, "Glowstone Chestplate"); + ObsidianUtils.addName(GlowstoneLegs, "Glowstone Leggings"); + ObsidianUtils.addName(GlowstoneBoots, "Glowstone Boots"); + ObsidianUtils.addName(GlowstoneKnife, "Glowstone Knife"); + + //Extras + ObsidianUtils.addName(ObsidianArrow, "Obsidian Arrow"); + ObsidianUtils.addName(ObsidianBow, "Obsidian Bow"); + ObsidianUtils.addName(ObsidianTNT, "Obsidian TNT"); + if(extrasEnabled) + { + ObsidianUtils.addName(LightningRod, "Lightning Rod"); + ObsidianUtils.addName(Stopwatch, "Steve's Stopwatch"); + ObsidianUtils.addName(LifeBlock, "Block of Life"); + ObsidianUtils.addName(WeatherOrb, "Weather Orb"); + } + ObsidianUtils.addName(EnrichmentChamber, "Enrichment Chamber"); + ObsidianUtils.addName(PlatinumCompressor, "Platinum Compressor"); + ObsidianUtils.addName(Combiner, "Combiner"); + ObsidianUtils.addName(Crusher, "Crusher"); + ObsidianUtils.addName(CoalBlock, "Coal Block"); + } + /** + * Adds all item textures from the sprite sheet. + */ + public void addTextures() + { + //Base + WoodPaxel.setIconIndex(150); + StonePaxel.setIconIndex(151); + IronPaxel.setIconIndex(152); + DiamondPaxel.setIconIndex(153); + GoldPaxel.setIconIndex(154); + WoodKnife.setIconIndex(214); + StoneKnife.setIconIndex(215); + IronKnife.setIconIndex(216); + DiamondKnife.setIconIndex(217); + GoldKnife.setIconIndex(218); + IronDust.setIconIndex(248); + GoldDust.setIconIndex(250); + + //Glowstone + GlowstoneHelmet.setIconIndex(4); + GlowstoneBody.setIconIndex(20); + GlowstoneLegs.setIconIndex(36); + GlowstoneBoots.setIconIndex(52); + GlowstoneIngot.setIconIndex(164); + GlowstoneIngot.setIconIndex(164); + GlowstonePaxel.setIconIndex(148); + GlowstonePickaxe.setIconIndex(68); + GlowstoneAxe.setIconIndex(84); + GlowstoneSpade.setIconIndex(100); + GlowstoneHoe.setIconIndex(116); + GlowstoneSword.setIconIndex(132); + GlowstoneKnife.setIconIndex(212); + + //Redstone + RedstoneHelmet.setIconIndex(3); + RedstoneBody.setIconIndex(19); + RedstoneLegs.setIconIndex(35); + RedstoneBoots.setIconIndex(51); + RedstoneIngot.setIconIndex(163); + RedstonePaxel.setIconIndex(147); + RedstonePickaxe.setIconIndex(67); + RedstoneAxe.setIconIndex(83); + RedstoneSpade.setIconIndex(99); + RedstoneHoe.setIconIndex(115); + RedstoneSword.setIconIndex(131); + RedstoneKnife.setIconIndex(211); + + //Platinum + PlatinumDust.setIconIndex(242); + PlatinumHelmet.setIconIndex(2); + PlatinumBody.setIconIndex(18); + PlatinumLegs.setIconIndex(34); + PlatinumBoots.setIconIndex(50); + PlatinumIngot.setIconIndex(162); + PlatinumPaxel.setIconIndex(146); + PlatinumPickaxe.setIconIndex(66); + PlatinumAxe.setIconIndex(82); + PlatinumSpade.setIconIndex(98); + PlatinumHoe.setIconIndex(114); + PlatinumSword.setIconIndex(130); + PlatinumKnife.setIconIndex(210); + + //Obsidian + ObsidianDust.setIconIndex(241); + ObsidianHelmet.setIconIndex(1); + ObsidianBody.setIconIndex(17); + ObsidianLegs.setIconIndex(33); + ObsidianBoots.setIconIndex(49); + ObsidianIngot.setIconIndex(161); + ObsidianPaxel.setIconIndex(145); + ObsidianPickaxe.setIconIndex(65); + ObsidianAxe.setIconIndex(81); + ObsidianSpade.setIconIndex(97); + ObsidianHoe.setIconIndex(113); + ObsidianSword.setIconIndex(129); + ObsidianKnife.setIconIndex(209); + + //Lazuli + LazuliPaxel.setIconIndex(144); + LazuliPickaxe.setIconIndex(64); + LazuliAxe.setIconIndex(80); + LazuliSpade.setIconIndex(96); + LazuliHoe.setIconIndex(112); + LazuliSword.setIconIndex(128); + LazuliHelmet.setIconIndex(0); + LazuliBody.setIconIndex(16); + LazuliLegs.setIconIndex(32); + LazuliBoots.setIconIndex(48); + LazuliKnife.setIconIndex(208); + + //Extras + ObsidianArrow.setIconIndex(193); + ObsidianBow.setIconIndex(177); + if(extrasEnabled) + { + LightningRod.setIconIndex(225); + Stopwatch.setIconIndex(224); + WeatherOrb.setIconIndex(226); + } + } + /** + * Adds and registers all items. + */ + public void addItems() + { + RedstoneHelmet = (new ItemObsidianArmor(11235, armorREDSTONE, RenderingRegistry.addNewArmourRendererPrefix("redstone"), 0)).setItemName("RedstoneHelmet"); + RedstoneBody = (new ItemObsidianArmor(11236, armorREDSTONE, RenderingRegistry.addNewArmourRendererPrefix("redstone"), 1)).setItemName("RedstoneBody"); + RedstoneLegs = (new ItemObsidianArmor(11237, armorREDSTONE, RenderingRegistry.addNewArmourRendererPrefix("redstone"), 2)).setItemName("RedstoneLegs"); + RedstoneBoots = (new ItemObsidianArmor(11238, armorREDSTONE, RenderingRegistry.addNewArmourRendererPrefix("redstone"), 3)).setItemName("RedstoneBoots"); + RedstoneIngot = new ItemObsidian(11239).setItemName("RedstoneIngot"); + RedstonePaxel = new ItemObsidianPaxel(11240, toolREDSTONE2).setItemName("RedstonePaxel"); + RedstonePickaxe = new ItemObsidianPickaxe(11241, toolREDSTONE).setItemName("RedstonePickaxe"); + RedstoneAxe = new ItemObsidianAxe(11242, toolREDSTONE).setItemName("RedstoneAxe"); + RedstoneSpade = new ItemObsidianSpade(11243, toolREDSTONE).setItemName("RedstoneSpade"); + RedstoneHoe = new ItemObsidianHoe(11244, toolREDSTONE).setItemName("RedstoneHoe"); + RedstoneSword = new ItemObsidianSword(11245, toolREDSTONE).setItemName("RedstoneSword"); + PlatinumHelmet = (new ItemObsidianArmor(11246, EnumArmorMaterial.DIAMOND, RenderingRegistry.addNewArmourRendererPrefix("platinum"), 0)).setItemName("PlatinumHelmet"); + PlatinumBody = (new ItemObsidianArmor(11247, EnumArmorMaterial.DIAMOND, RenderingRegistry.addNewArmourRendererPrefix("platinum"), 1)).setItemName("PlatinumBody"); + PlatinumLegs = (new ItemObsidianArmor(11248, EnumArmorMaterial.DIAMOND, RenderingRegistry.addNewArmourRendererPrefix("platinum"), 2)).setItemName("PlatinumLegs"); + PlatinumBoots = (new ItemObsidianArmor(11249, EnumArmorMaterial.DIAMOND, RenderingRegistry.addNewArmourRendererPrefix("platinum"), 3)).setItemName("PlatinumBoots"); + PlatinumIngot = new ItemObsidian(11250).setItemName("PlatinumIngot"); + PlatinumPaxel = new ItemObsidianPaxel(11251, toolPLATINUM2).setItemName("PlatinumPaxel"); + PlatinumPickaxe = new ItemObsidianPickaxe(11252, toolPLATINUM).setItemName("PlatinumPickaxe"); + PlatinumAxe = new ItemObsidianAxe(11253, toolPLATINUM).setItemName("PlatinumAxe"); + PlatinumSpade = new ItemObsidianSpade(11254, toolPLATINUM).setItemName("PlatinumSpade"); + PlatinumHoe = new ItemObsidianHoe(11255, toolPLATINUM).setItemName("PlatinumHoe"); + PlatinumSword = new ItemObsidianSword(11256, toolPLATINUM).setItemName("PlatinumSword"); + ObsidianHelmet = (new ItemObsidianArmor(11257, armorOBSIDIAN, RenderingRegistry.addNewArmourRendererPrefix("obsidian"), 0)).setItemName("ObsidianHelmet"); + ObsidianBody = (new ItemObsidianArmor(11258, armorOBSIDIAN, RenderingRegistry.addNewArmourRendererPrefix("obsidian"), 1)).setItemName("ObsidianBody"); + ObsidianLegs = (new ItemObsidianArmor(11259, armorOBSIDIAN, RenderingRegistry.addNewArmourRendererPrefix("obsidian"), 2)).setItemName("ObsidianLegs"); + ObsidianBoots = (new ItemObsidianArmor(11260, armorOBSIDIAN, RenderingRegistry.addNewArmourRendererPrefix("obsidian"), 3)).setItemName("ObsidianBoots"); + ObsidianIngot = new ItemObsidian(11261).setItemName("ObsidianIngot"); + ObsidianPaxel = new ItemObsidianPaxel(11262, toolOBSIDIAN2).setItemName("ObsidianPaxel"); + ObsidianPickaxe = new ItemObsidianPickaxe(11263, toolOBSIDIAN).setItemName("ObsidianPickaxe"); + ObsidianAxe = new ItemObsidianAxe(11264, toolOBSIDIAN).setItemName("ObsidianAxe"); + ObsidianSpade = new ItemObsidianSpade(11265, toolOBSIDIAN).setItemName("ObsidianSpade"); + ObsidianHoe = new ItemObsidianHoe(11266, toolOBSIDIAN).setItemName("ObsidianHoe"); + ObsidianSword = new ItemObsidianSword(11267, toolOBSIDIAN).setItemName("ObsidianSword"); + LazuliPaxel = new ItemObsidianPaxel(11268, toolLAZULI2).setItemName("LazuliPaxel"); + LazuliPickaxe = new ItemObsidianPickaxe(11269, toolLAZULI).setItemName("LazuliPickaxe"); + LazuliAxe = new ItemObsidianAxe(11270, toolLAZULI).setItemName("LazuliAxe"); + LazuliSpade = new ItemObsidianSpade(11271, toolLAZULI).setItemName("LazuliSpade"); + LazuliHoe = new ItemObsidianHoe(11272, toolLAZULI).setItemName("LazuliHoe"); + LazuliSword = new ItemObsidianSword(11273, toolLAZULI).setItemName("LazuliSword"); + LazuliHelmet = (new ItemObsidianArmor(11274, armorLAZULI, RenderingRegistry.addNewArmourRendererPrefix("lazuli"), 0)).setItemName("LazuliHelmet"); + LazuliBody = (new ItemObsidianArmor(11275, armorLAZULI, RenderingRegistry.addNewArmourRendererPrefix("lazuli"), 1)).setItemName("LazuliBody"); + LazuliLegs = (new ItemObsidianArmor(11276, armorLAZULI, RenderingRegistry.addNewArmourRendererPrefix("lazuli"), 2)).setItemName("LazuliLegs"); + LazuliBoots = (new ItemObsidianArmor(11277, armorLAZULI, RenderingRegistry.addNewArmourRendererPrefix("lazuli"), 3)).setItemName("LazuliBoots"); + ObsidianArrow = new ItemObsidian(11278).setItemName("ObsidianArrow").setTabToDisplayOn(CreativeTabs.tabCombat); + ObsidianBow = new ItemObsidianBow(11279).setItemName("ObsidianBow"); + if(extrasEnabled) + { + LightningRod = new ItemLightningRod(11280).setItemName("LightningRod"); + Stopwatch = new ItemStopwatch(11281).setItemName("Stopwatch"); + WeatherOrb = new ItemWeatherOrb(11282).setItemName("WeatherOrb"); + } + WoodPaxel = new ItemObsidianPaxel(11283, EnumToolMaterial.WOOD).setItemName("WoodPaxel"); + StonePaxel = new ItemObsidianPaxel(11284, EnumToolMaterial.STONE).setItemName("StonePaxel"); + IronPaxel = new ItemObsidianPaxel(11285, EnumToolMaterial.IRON).setItemName("IronPaxel"); + DiamondPaxel = new ItemObsidianPaxel(11286, EnumToolMaterial.EMERALD).setItemName("DiamondPaxel"); + GoldPaxel = new ItemObsidianPaxel(11287, EnumToolMaterial.GOLD).setItemName("GoldPaxel"); + WoodKnife = new ItemObsidianKnife(11288, EnumToolMaterial.WOOD).setItemName("WoodKnife"); + StoneKnife = new ItemObsidianKnife(11289, EnumToolMaterial.STONE).setItemName("StoneKnife"); + IronKnife = new ItemObsidianKnife(11290, EnumToolMaterial.IRON).setItemName("IronKnife"); + DiamondKnife = new ItemObsidianKnife(11291, EnumToolMaterial.EMERALD).setItemName("DiamondKnife"); + GoldKnife = new ItemObsidianKnife(11292, EnumToolMaterial.GOLD).setItemName("GoldKnife"); + ObsidianKnife = new ItemObsidianKnife(11293, toolOBSIDIAN).setItemName("ObsidianKnife"); + LazuliKnife = new ItemObsidianKnife(11294, toolLAZULI).setItemName("LazuliKnife"); + PlatinumKnife = new ItemObsidianKnife(11295, toolPLATINUM).setItemName("PlatinumKnife"); + RedstoneKnife = new ItemObsidianKnife(11296, toolREDSTONE).setItemName("RedstoneKnife"); + ObsidianDust = new ItemObsidian(11297).setItemName("ObsidianDust"); + IronDust = new ItemObsidian(11298).setItemName("IronDust"); + GoldDust = new ItemObsidian(11299).setItemName("GoldDust"); + PlatinumDust = new ItemObsidian(11300).setItemName("PlatinumDust"); + GlowstoneIngot = new ItemObsidian(11301).setItemName("GlowstoneIngot"); + GlowstonePaxel = new ItemObsidianPaxel(11302, toolGLOWSTONE2).setItemName("GlowstonePaxel"); + GlowstonePickaxe = new ItemObsidianPickaxe(11303, toolGLOWSTONE).setItemName("GlowstonePickaxe"); + GlowstoneAxe = new ItemObsidianAxe(11304, toolGLOWSTONE).setItemName("GlowstoneAxe"); + GlowstoneSpade = new ItemObsidianSpade(11305, toolGLOWSTONE).setItemName("GlowstoneSpade"); + GlowstoneHoe = new ItemObsidianHoe(11306, toolGLOWSTONE).setItemName("GlowstoneHoe"); + GlowstoneSword = new ItemObsidianSword(11307, toolGLOWSTONE).setItemName("GlowstoneSword"); + GlowstoneHelmet = new ItemObsidianArmor(11308, armorGLOWSTONE, RenderingRegistry.addNewArmourRendererPrefix("glowstone"), 0).setItemName("GlowstoneHelmet"); + GlowstoneBody = new ItemObsidianArmor(11309, armorGLOWSTONE, RenderingRegistry.addNewArmourRendererPrefix("glowstone"), 1).setItemName("GlowstoneBody"); + GlowstoneLegs = new ItemObsidianArmor(11310, armorGLOWSTONE, RenderingRegistry.addNewArmourRendererPrefix("glowstone"), 2).setItemName("GlowstoneLegs"); + GlowstoneBoots = new ItemObsidianArmor(11311, armorGLOWSTONE, RenderingRegistry.addNewArmourRendererPrefix("glowstone"), 3).setItemName("GlowstoneBoots"); + GlowstoneKnife = new ItemObsidianKnife(11312, toolGLOWSTONE).setItemName("GlowstoneKnife"); + } + /** + * Adds and registers all blocks. + */ + public void addBlocks() + { + //Declarations + RedstoneBlock = new BlockBase(redstoneBlockID, 1).setBlockName("RedstoneBlock").setCreativeTab(CreativeTabs.tabBlock); + PlatinumOre = new BlockBase(platinumOreID, 3).setBlockName("PlatinumOre").setCreativeTab(CreativeTabs.tabBlock); + PlatinumBlock = new BlockBase(platinumBlockID, 2).setBlockName("PlatinumBlock").setCreativeTab(CreativeTabs.tabBlock); + RefinedObsidian = new BlockBase(refinedObsidianID, 0).setBlockName("RefinedObsidian").setCreativeTab(CreativeTabs.tabBlock); + ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setBlockName("ObsidianTNT").setCreativeTab(CreativeTabs.tabBlock); + if(extrasEnabled) + { + LifeBlock = new BlockLife(lifeBlockID, 4).setBlockName("LifeBlock").setCreativeTab(CreativeTabs.tabBlock); + } + EnrichmentChamber = new BlockEnrichmentChamber(enrichmentChamberID).setBlockName("EnrichmentChamberIdle").setCreativeTab(CreativeTabs.tabBlock); + PlatinumCompressor = new BlockPlatinumCompressor(platinumCompressorID).setBlockName("PlatinumCompressorIdle").setCreativeTab(CreativeTabs.tabBlock); + Combiner = new BlockCombiner(combinerID).setBlockName("CombinerIdle").setCreativeTab(CreativeTabs.tabBlock); + Crusher = new BlockCrusher(crusherID).setBlockName("CrusherIdle").setCreativeTab(CreativeTabs.tabBlock); + CoalBlock = new BlockBase(coalBlockID, 10).setBlockName("CoalBlock").setCreativeTab(CreativeTabs.tabBlock); + RefinedGlowstone = new BlockBase(refinedGlowstoneID, 11).setBlockName("RefinedGlowstone").setCreativeTab(CreativeTabs.tabBlock); + + //Registrations + GameRegistry.registerBlock(RedstoneBlock); + GameRegistry.registerBlock(PlatinumOre); + GameRegistry.registerBlock(PlatinumBlock); + GameRegistry.registerBlock(RefinedObsidian); + GameRegistry.registerBlock(ObsidianTNT); + if(extrasEnabled) + { + GameRegistry.registerBlock(LifeBlock); + } + GameRegistry.registerBlock(EnrichmentChamber); + GameRegistry.registerBlock(PlatinumCompressor); + GameRegistry.registerBlock(Combiner); + GameRegistry.registerBlock(Crusher); + GameRegistry.registerBlock(CoalBlock); + GameRegistry.registerBlock(RefinedGlowstone); + } + /** + * Adds and registers all entities and tile entities. + */ + public void addEntities() + { + //Entity IDs + EntityRegistry.registerGlobalEntityID(EntityObsidianArrow.class, "ObsidianArrow", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityObsidianTNT.class, "ObsidianTNT", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityKnife.class, "Knife", EntityRegistry.findGlobalUniqueEntityId()); + + //Registrations + EntityRegistry.registerModEntity(EntityObsidianArrow.class, "ObsidianArrow", 50, this, 40, 5, true); + EntityRegistry.registerModEntity(EntityObsidianTNT.class, "ObsidianTNT", 51, this, 40, 5, true); + EntityRegistry.registerModEntity(EntityKnife.class, "Knife", 52, this, 40, 5, true); + + //Tile entities + GameRegistry.registerTileEntity(TileEntityEnrichmentChamber.class, "EnrichmentChamber"); + GameRegistry.registerTileEntity(TileEntityPlatinumCompressor.class, "PlatinumCompressor"); + GameRegistry.registerTileEntity(TileEntityCombiner.class, "Combiner"); + GameRegistry.registerTileEntity(TileEntityCrusher.class, "Crusher"); + } + + @PreInit + public void load(FMLPreInitializationEvent event) + { + //Register the mod's ore handler + GameRegistry.registerWorldGenerator(new OreHandler()); + //Register the mod's GUI handler + NetworkRegistry.instance().registerGuiHandler(this, new CommonGuiHandler()); + //Set the mod's instance + instance = this; + System.out.println("[Obsidian Ingots] Version " + versionNumber + " initializing..."); + proxy.registerRenderInformation(); + proxy.setProperties(); + proxy.loadUtilities(); + proxy.loadTickHandler(); + + //Hook with mods Obsidian Ingots has implemented + hooks = new ObsidianHooks(); + hooks.hook(); + System.out.println("[ObsidianIngots] Hooking complete."); + + //Add all items + addItems(); + System.out.println("[ObsidianIngots] Items loaded."); + + //Add all blocks + addBlocks(); + System.out.println("[ObsidianIngots] Blocks loaded."); + + //Set item and block names + addNames(); + System.out.println("[ObsidianIngots] Names loaded."); + + //Set item and block textures + addTextures(); + System.out.println("[ObsidianIngots] Textures loaded."); + + //Set item and block recipes + addRecipes(); + System.out.println("[ObsidianIngots] Recipes loaded."); + + //Set up entities to run on SSP and SMP + addEntities(); + System.out.println("[ObsidianIngots] Entities loaded."); + + //Success message + logger.info("[ObsidianIngots] Mod loaded."); + } +} \ No newline at end of file diff --git a/src/common/net/uberkat/obsidian/common/ObsidianUtils.java b/src/common/net/uberkat/obsidian/common/ObsidianUtils.java new file mode 100644 index 000000000..37556da60 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ObsidianUtils.java @@ -0,0 +1,217 @@ +package net.uberkat.obsidian.common; + +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.Socket; +import java.net.URISyntaxException; +import java.net.URL; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.network.PacketDispatcher; +import cpw.mods.fml.common.registry.LanguageRegistry; +import cpw.mods.fml.server.FMLServerHandler; + +import net.minecraft.src.*; + +/** + * Official Obsidian Ingots utilities. All miscellaneous methods are located here. + * @author AidanBrady + * + */ +public class ObsidianUtils +{ + /** + * Registers a name for the specified object. + * @param obj - block/item to name + * @param name - name for the block/item + */ + public static void addName(Object obj, String name) + { + LanguageRegistry.instance().addNameForObject(obj, "en_US", name); + } + + /** + * Checks for a new version of Obsidian Ingots. + */ + public static void checkForUpdates(EntityPlayer entityplayer) + { + if(!(getLatestVersion().toString().equals("Error retrieving data.")) && !(getLatestVersion().toString().equals(ObsidianIngots.versionNumber.toString()))) + { + entityplayer.addChatMessage("Your version of ¤1Obsidian Ingots ¤7(¤8" + ObsidianIngots.versionNumber.toString() + "¤7) is outdated. Please update to version ¤8" + getLatestVersion().toString()); + } + else if(getLatestVersion().toString().equals("Error retrieving data.")) + { + System.out.println("[ObsidianIngots] Minecraft is in offline mode, could not check for updates."); + } + } + + /** + * Gets the latest version using getHTML and returns it as a string. + * @return latest version + */ + public static String getLatestVersion() + { + String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/ObsidianIngots.txt").split(":"); + return text[0]; + } + + /** + * Gets the recent news using getHTML and returns it as a string. + * @return recent news + */ + public static String getRecentNews() + { + String[] text = getHTML("http://dl.dropbox.com/u/90411166/Mod%20Versions/ObsidianIngots.txt").split(":"); + if(text.length > 1) return text[1]; + return "There is no news to show."; + } + + /** + * Sends Obsidian Ingots server information about this mod. + */ + public static void sendServerData() + { + new ThreadServerData(); + } + + /** + * Returns one line of HTML from the url. + * @param urlToRead - URL to read from. + * @return HTML text from the url. + */ + public static String getHTML(String urlToRead) + { + StringBuilder sb = new StringBuilder(); + URL url; + HttpURLConnection conn; + BufferedReader rd; + String line; + String result = ""; + try { + url = new URL(urlToRead); + conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); + while ((line = rd.readLine()) != null) { + result += line; + sb.append(line); + } + rd.close(); + } catch (Exception e) { + result = "Error retrieving data."; + System.err.println("[ObsidianIngots] An error occured while connecting to URL '" + urlToRead + ".'"); + } + return result; + } + + /** + * Sends a Packet3Chat packet to the defined player, with the defined message. + * @param player - Player to send packet to. + * @param msg - message sent to player. + */ + public static void sendChatMessageToPlayer(String playerUsername, String msg) + { + EntityPlayer player = FMLServerHandler.instance().getServer().getConfigurationManager().getPlayerForUsername(playerUsername); + Packet3Chat chatPacket = new Packet3Chat(msg); + if(player != null) + { + ((EntityPlayerMP)player).serverForThisPlayer.sendPacketToPlayer(chatPacket); + } + } + + /** + * Sends the server the defined packet int. + * @param i - int to send + */ + public static void sendPacketDataInt(int i) + { + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + DataOutputStream data = new DataOutputStream(bytes); + try { + data.writeInt(i); + } catch (IOException e) { + System.out.println("[ObsidianIngots] An error occured while writing packet data."); + e.printStackTrace(); + } + Packet250CustomPayload packet = new Packet250CustomPayload(); + packet.channel = "ObsidianIngots"; + packet.data = bytes.toByteArray(); + packet.length = packet.data.length; + PacketDispatcher.sendPacketToServer(packet); + System.out.println("[ObsidianIngots] Sent '" + i + "' packet to server"); + } + + /** + * Checks if the game is running on multiplayer. + * @return - if world is multiplayer + */ + public static boolean isMultiplayer() + { + if(!FMLServerHandler.instance().getServer().isSinglePlayer()) + { + return true; + } + else { + return false; + } + } + + /** + * Checks if the mod is running on the latest version. + * @return - if mod is latest version + */ + public static boolean isClientLatestVersion() + { + if(ObsidianIngots.versionNumber.toString().equals(ObsidianIngots.latestVersionNumber)) + { + return true; + } + else { + return false; + } + } + + /** + * Checks if Minecraft is running in offline mode. + * @return - if mod is running in offline mode. + */ + public static boolean isOffline() + { + try { + new URL("http://www.apple.com").openConnection().connect(); + return true; + } catch (IOException e) + { + return false; + } + } + + /** + * Sets the defined world's time to the defined time. + * @param world - world to set time + * @param paramInt - hour to set time to + */ + public static void setHourForward(World world, int paramInt) + { + long l1 = world.getWorldTime() / 24000L * 24000L; + long l2 = l1 + 24000L + paramInt * 1000; + world.setWorldTime(l2); + } + + /** + * Creates a fake explosion, with only sounds and effects. No damage is caused, to blocks or the player. + * @param entityplayer - player to explode + */ + public static void doExplosion(EntityPlayer entityplayer) + { + World world = entityplayer.worldObj; + world.spawnParticle("hugeexplosion", entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D); + world.playSoundAtEntity(entityplayer, "random.explode", 1.0F, 1.0F); + } +} diff --git a/src/common/net/uberkat/obsidian/common/OreHandler.java b/src/common/net/uberkat/obsidian/common/OreHandler.java new file mode 100644 index 000000000..68e07e972 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/OreHandler.java @@ -0,0 +1,26 @@ +package net.uberkat.obsidian.common; + +import java.util.Random; + +import net.minecraft.src.IChunkProvider; +import net.minecraft.src.World; +import net.minecraft.src.WorldGenMinable; +import cpw.mods.fml.common.IWorldGenerator; + +public class OreHandler implements IWorldGenerator +{ + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) + { + if(ObsidianIngots.oreGenerationEnabled) + { + for (int i=0;i<1;i++) + { + int randPosX = chunkX + random.nextInt(16); + int randPosY = random.nextInt(60); + int randPosZ = chunkZ + random.nextInt(16); + (new WorldGenMinable(ObsidianIngots.PlatinumOre.blockID, 8)).generate(world, random, randPosX, randPosY, randPosZ); + } + } + } + +} diff --git a/src/common/net/uberkat/obsidian/common/PacketHandler.java b/src/common/net/uberkat/obsidian/common/PacketHandler.java new file mode 100644 index 000000000..8996855d3 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/PacketHandler.java @@ -0,0 +1,83 @@ +package net.uberkat.obsidian.common; + +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; + +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.ModLoader; +import net.minecraft.src.NetworkManager; +import net.minecraft.src.Packet250CustomPayload; +import net.minecraft.src.World; +import cpw.mods.fml.common.network.IPacketHandler; +import cpw.mods.fml.common.network.Player; + +public class PacketHandler implements IPacketHandler +{ + public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player) + { + DataInputStream dataStream = new DataInputStream(new ByteArrayInputStream(packet.data)); + EntityPlayer entityplayer = (EntityPlayer)player; + + if(packet.channel.equals("ObsidianIngots")) + { + try { + int packetData = dataStream.readInt(); + + if(packetData == 0) + { + System.out.println("[ObsidianIngots] Received '0' packet from " + entityplayer.username + "."); + ObsidianUtils.setHourForward(ModLoader.getMinecraftServerInstance().worldServerForDimension(0), 0); + entityplayer.inventory.getCurrentItem().damageItem(4999, entityplayer); + } + + if(packetData == 1) + { + System.out.println("[ObsidianIngots] Received '1' packet from " + entityplayer.username + "."); + ObsidianUtils.setHourForward(ModLoader.getMinecraftServerInstance().worldServerForDimension(0), 1); + entityplayer.inventory.getCurrentItem().damageItem(4999, entityplayer); + } + + if(packetData == 2) + { + System.out.println("[ObsidianIngots] Received '2' packet from " + entityplayer.username + "."); + ObsidianUtils.setHourForward(ModLoader.getMinecraftServerInstance().worldServerForDimension(0), 2); + entityplayer.inventory.getCurrentItem().damageItem(4999, entityplayer); + } + + if(packetData == 3) + { + System.out.println("[ObsidianIngots] Received '3' packet from " + entityplayer.username + "."); + ObsidianUtils.setHourForward(ModLoader.getMinecraftServerInstance().worldServerForDimension(0), 3); + entityplayer.inventory.getCurrentItem().damageItem(4999, entityplayer); + } + if(packetData == 5) + { + System.out.println("[ObsidianIngots] Recieved '5' packet from " + entityplayer.username + "."); + entityplayer.worldObj.getWorldInfo().setRaining(false); + entityplayer.worldObj.getWorldInfo().setThundering(false); + } + if(packetData == 6) + { + System.out.println("[ObsidianIngots] Recieved '6' packet from " + entityplayer.username + "."); + entityplayer.worldObj.getWorldInfo().setRaining(true); + entityplayer.worldObj.getWorldInfo().setThundering(true); + } + if(packetData == 7) + { + System.out.println("[ObsidianIngots] Recieved '7' packet from " + entityplayer.username + "."); + entityplayer.worldObj.getWorldInfo().setThundering(true); + } + if(packetData == 8) + { + System.out.println("[ObsidianIngots] Recieved '8' packet from " + entityplayer.username + "."); + entityplayer.worldObj.getWorldInfo().setRaining(true); + } + } + catch (IOException e) + { + e.printStackTrace(); + } + } + } +} diff --git a/src/common/net/uberkat/obsidian/common/PhysicsHelper.java b/src/common/net/uberkat/obsidian/common/PhysicsHelper.java new file mode 100644 index 000000000..6708f1f61 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/PhysicsHelper.java @@ -0,0 +1,43 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public abstract class PhysicsHelper +{ + public PhysicsHelper() + { + } + + public static void knockBack(EntityLiving entityliving, EntityLiving entityliving1, float f) + { + entityliving.motionX = 0.0D; + entityliving.motionY = 0.0D; + entityliving.motionZ = 0.0D; + float f1 = 2.5F; + + if ((entityliving1 instanceof EntityPlayer) && entityliving1.isSprinting()) + { + entityliving.addVelocity(-Math.sin(Math.toRadians(entityliving1.rotationYaw)) * (double)f * (double)f1, 0.1F * f * f1, Math.cos(Math.toRadians(entityliving1.rotationYaw)) * (double)f * (double)f1); + } + + double d = entityliving1.posX - entityliving.posX; + double d1; + + for (d1 = entityliving1.posZ - entityliving.posZ; d * d + d1 * d1 < 0.0001D; d1 = (Math.random() - Math.random()) * 0.01D) + { + d = (Math.random() - Math.random()) * 0.01D; + } + + entityliving.attackedAtYaw = (float)((Math.atan2(d1, d) * 180D) / Math.PI) - entityliving.rotationYaw; + float f2 = MathHelper.sqrt_double(d * d + d1 * d1); + float f3 = f; + entityliving.motionX -= (d / (double)f2) * (double)f3; + entityliving.motionY += 0.40000000000000002D; + entityliving.motionZ -= (d1 / (double)f2) * (double)f3; + + if (entityliving.motionY > 0.40000000000000002D) + { + entityliving.motionY = 0.40000000000000002D; + } + } +} diff --git a/src/common/net/uberkat/obsidian/common/PlatinumCompressorRecipes.java b/src/common/net/uberkat/obsidian/common/PlatinumCompressorRecipes.java new file mode 100644 index 000000000..48efd2ba0 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/PlatinumCompressorRecipes.java @@ -0,0 +1,86 @@ +package net.uberkat.obsidian.common; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import net.minecraft.src.*; + +public class PlatinumCompressorRecipes +{ + private static final PlatinumCompressorRecipes smeltingBase = new PlatinumCompressorRecipes(); + + /** The list of smelting results. */ + private Map smeltingList = new HashMap(); + private Map metaSmeltingList = new HashMap(); + + /** + * Used to call methods addSmelting and getSmeltingResult. + */ + public static final PlatinumCompressorRecipes smelting() + { + return smeltingBase; + } + + private PlatinumCompressorRecipes() + { + addSmelting(Item.redstone.shiftedIndex, new ItemStack(ObsidianIngots.RedstoneIngot, 1)); + addSmelting(ObsidianIngots.ObsidianDust.shiftedIndex, new ItemStack(ObsidianIngots.ObsidianIngot, 1)); + addSmelting(ObsidianIngots.PlatinumDust.shiftedIndex, new ItemStack(ObsidianIngots.PlatinumIngot, 1)); + addSmelting(ObsidianIngots.IronDust.shiftedIndex, new ItemStack(Item.ingotIron, 1)); + addSmelting(ObsidianIngots.GoldDust.shiftedIndex, new ItemStack(Item.ingotGold, 1)); + addSmelting(Item.lightStoneDust.shiftedIndex, new ItemStack(ObsidianIngots.GlowstoneIngot, 1)); + } + + /** + * Adds a smelting recipe. + */ + public void addSmelting(int par1, ItemStack par2ItemStack) + { + this.smeltingList.put(Integer.valueOf(par1), par2ItemStack); + } + + /** + * Returns the smelting result of an item. + * Deprecated in favor of a metadata sensitive version + */ + @Deprecated + public ItemStack getSmeltingResult(int par1) + { + return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); + } + + public Map getSmeltingList() + { + return this.smeltingList; + } + + /** + * Add a metadata-sensitive furnace recipe + * @param itemID The Item ID + * @param metadata The Item Metadata + * @param itemstack The ItemStack for the result + */ + public void addSmelting(int itemID, int metadata, ItemStack itemstack) + { + metaSmeltingList.put(Arrays.asList(itemID, metadata), itemstack); + } + + /** + * Used to get the resulting ItemStack form a source ItemStack + * @param item The Source ItemStack + * @return The result ItemStack + */ + public ItemStack getSmeltingResult(ItemStack item) + { + if (item == null) + { + return null; + } + ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); + if (ret != null) + { + return ret; + } + return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); + } +} diff --git a/src/common/net/uberkat/obsidian/common/SlotObsidian.java b/src/common/net/uberkat/obsidian/common/SlotObsidian.java new file mode 100644 index 000000000..a9b4509a0 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/SlotObsidian.java @@ -0,0 +1,57 @@ +package net.uberkat.obsidian.common; + +import net.minecraft.src.*; + +public class SlotObsidian extends Slot +{ + /** The player that is using the GUI where this slot resides. */ + private EntityPlayer thePlayer; + private int field_75228_b; + + public SlotObsidian(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, int par5) + { + super(par2IInventory, par3, par4, par5); + this.thePlayer = par1EntityPlayer; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + public boolean isItemValid(ItemStack par1ItemStack) + { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int par1) + { + if (this.getHasStack()) + { + this.field_75228_b += Math.min(par1, this.getStack().stackSize); + } + + return super.decrStackSize(par1); + } + + /** + * Called when the player picks up an item from an inventory slot + */ + public void onPickupFromSlot(ItemStack par1ItemStack) + { + this.onCrafting(par1ItemStack); + super.onPickupFromSlot(par1ItemStack); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + protected void onCrafting(ItemStack par1ItemStack, int par2) + { + field_75228_b += par2; + onCrafting(par1ItemStack); + } +} diff --git a/src/common/net/uberkat/obsidian/common/ThreadServerData.java b/src/common/net/uberkat/obsidian/common/ThreadServerData.java new file mode 100644 index 000000000..f8ca88f6b --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/ThreadServerData.java @@ -0,0 +1,48 @@ +package net.uberkat.obsidian.common; + +import java.io.IOException; +import java.io.PrintWriter; +import java.net.InetAddress; +import java.net.Socket; + +import cpw.mods.fml.client.FMLClientHandler; + +import net.minecraft.src.ModLoader; + +public class ThreadServerData extends Thread +{ + /** + * Sends information about this mod to the Obsidian Ingots server. + */ + public ThreadServerData() + { + setDaemon(true); + start(); + } + + public void run() + { + System.out.println("[ObsidianIngots] Initiating server protocol..."); + try { + InetAddress address = InetAddress.getByName(ObsidianIngots.hostIP); + Socket socket = new Socket(address, ObsidianIngots.hostPort); + PrintWriter writer = new PrintWriter(socket.getOutputStream()); + if(ObsidianUtils.isMultiplayer()) + { + writer.println("USER:server"); + } + else { + if(FMLClientHandler.instance().getClient().thePlayer != null) + { + writer.println("USER:" + FMLClientHandler.instance().getClient().thePlayer.username); + } + } + writer.println("DONE"); + writer.close(); + socket.close(); + } catch (IOException e) + { + System.err.println("[ObsidianIngots] Could not connect to server, error was '" + e.getMessage() + ".'"); + } + } +} diff --git a/src/common/net/uberkat/obsidian/common/TileEntityCombiner.java b/src/common/net/uberkat/obsidian/common/TileEntityCombiner.java new file mode 100644 index 000000000..8da1cca43 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/TileEntityCombiner.java @@ -0,0 +1,378 @@ +package net.uberkat.obsidian.common; + +import cpw.mods.fml.common.FMLCommonHandler; + +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.ISidedInventory; +import net.minecraft.src.*; + +public class TileEntityCombiner extends TileEntity implements IInventory, ISidedInventory +{ + /** + * The ItemStacks that hold the items currently being used in the furnace + */ + private ItemStack[] combinerItemStacks = new ItemStack[3]; + + /** The number of ticks that the furnace will keep burning */ + public int combinerBurnTime = 0; + + /** + * The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for + */ + public int currentItemBurnTime = 0; + + /** The number of ticks that the current item has been cooking for */ + public int combinerCookTime = 0; + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.combinerItemStacks.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int par1) + { + return this.combinerItemStacks[par1]; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int par1, int par2) + { + if (this.combinerItemStacks[par1] != null) + { + ItemStack var3; + + if (this.combinerItemStacks[par1].stackSize <= par2) + { + var3 = this.combinerItemStacks[par1]; + this.combinerItemStacks[par1] = null; + return var3; + } + else + { + var3 = this.combinerItemStacks[par1].splitStack(par2); + + if (this.combinerItemStacks[par1].stackSize == 0) + { + this.combinerItemStacks[par1] = null; + } + + return var3; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int par1) + { + if (this.combinerItemStacks[par1] != null) + { + ItemStack var2 = this.combinerItemStacks[par1]; + this.combinerItemStacks[par1] = null; + return var2; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) + { + this.combinerItemStacks[par1] = par2ItemStack; + + if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) + { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory. + */ + public String getInvName() + { + return "container.combiner"; + } + + /** + * Reads a tile entity from NBT. + */ + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); + this.combinerItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) + { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + byte var5 = var4.getByte("Slot"); + + if (var5 >= 0 && var5 < this.combinerItemStacks.length) + { + this.combinerItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + + this.combinerBurnTime = par1NBTTagCompound.getShort("BurnTime"); + this.combinerCookTime = par1NBTTagCompound.getShort("CookTime"); + this.currentItemBurnTime = getItemBurnTime(this.combinerItemStacks[1]); + } + + /** + * Writes a tile entity to NBT. + */ + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setShort("BurnTime", (short)this.combinerBurnTime); + par1NBTTagCompound.setShort("CookTime", (short)this.combinerCookTime); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.combinerItemStacks.length; ++var3) + { + if (this.combinerItemStacks[var3] != null) + { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.combinerItemStacks[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + par1NBTTagCompound.setTag("Items", var2); + } + + /** + * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't + * this more of a set than a get?* + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Returns an integer between 0 and the passed value representing how close the current item is to being completely + * cooked + */ + public int getCookProgressScaled(int par1) + { + return this.combinerCookTime * par1 / 200; + } + + /** + * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel + * item, where 0 means that the item is exhausted and the passed value means that the item is fresh + */ + public int getBurnTimeRemainingScaled(int par1) + { + if (this.currentItemBurnTime == 0) + { + this.currentItemBurnTime = 200; + } + + return this.combinerBurnTime * par1 / this.currentItemBurnTime; + } + + /** + * Returns true if the furnace is currently burning + */ + public boolean isBurning() + { + return this.combinerBurnTime > 0; + } + + /** + * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count + * ticks and creates a new spawn inside its implementation. + */ + public void updateEntity() + { + boolean var1 = this.combinerBurnTime > 0; + boolean var2 = false; + + if (this.combinerBurnTime > 0) + { + --this.combinerBurnTime; + } + + if (!this.worldObj.isRemote) + { + if (this.combinerBurnTime == 0 && this.canSmelt()) + { + this.currentItemBurnTime = this.combinerBurnTime = getItemBurnTime(this.combinerItemStacks[1]); + + if (this.combinerBurnTime > 0) + { + var2 = true; + + if (this.combinerItemStacks[1] != null) + { + --this.combinerItemStacks[1].stackSize; + + if (this.combinerItemStacks[1].stackSize == 0) + { + this.combinerItemStacks[1] = null; + } + } + } + } + + if (this.isBurning() && this.canSmelt()) + { + ++this.combinerCookTime; + + if (this.combinerCookTime == 200) + { + this.combinerCookTime = 0; + this.smeltItem(); + var2 = true; + } + } + else + { + this.combinerCookTime = 0; + } + + if (var1 != this.combinerBurnTime > 0) + { + var2 = true; + BlockCombiner.updateCombinerBlockState(this.combinerBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); + } + } + + if (var2) + { + this.onInventoryChanged(); + } + } + + /** + * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc. + */ + private boolean canSmelt() + { + if (this.combinerItemStacks[0] == null) + { + return false; + } + else + { + ItemStack var1 = CombinerRecipes.smelting().getSmeltingResult(this.combinerItemStacks[0]); + if (var1 == null) return false; + if (this.combinerItemStacks[2] == null) return true; + if (!this.combinerItemStacks[2].isItemEqual(var1)) return false; + int result = combinerItemStacks[2].stackSize + var1.stackSize; + return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize()); + } + } + + /** + * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack + */ + public void smeltItem() + { + if (this.canSmelt()) + { + ItemStack var1 = CombinerRecipes.smelting().getSmeltingResult(this.combinerItemStacks[0]); + + if (this.combinerItemStacks[2] == null) + { + this.combinerItemStacks[2] = var1.copy(); + } + else if (this.combinerItemStacks[2].isItemEqual(var1)) + { + //========================================================== + //Adding extra importance here, so this really small bug + //fix stops slipping through the cracks. + // + //Makes it so that items that result in multiple items are + //smelted correctly each time. + // + // + // + this.combinerItemStacks[2].stackSize += var1.stackSize; + //========================================================== + } + + --this.combinerItemStacks[0].stackSize; + + if (this.combinerItemStacks[0].stackSize <= 0) + { + this.combinerItemStacks[0] = null; + } + } + } + + /** + * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't + * fuel + */ + public static int getItemBurnTime(ItemStack par1ItemStack) + { + if (par1ItemStack == null) + { + return 0; + } + else + { + int var1 = par1ItemStack.getItem().shiftedIndex; + if (par1ItemStack.getItem() instanceof ItemBlock && var1 == Block.cobblestone.blockID) return 200; + } + return 0; + } + + /** + * Return true if item is a fuel source (getItemBurnTime() > 0). + */ + public static boolean isItemFuel(ItemStack par0ItemStack) + { + return getItemBurnTime(par0ItemStack) > 0; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) + { + return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openChest() {} + + public void closeChest() {} + + @Override + public int getStartInventorySide(ForgeDirection side) + { + if (side == ForgeDirection.DOWN) return 1; + if (side == ForgeDirection.UP) return 0; + return 2; + } + + @Override + public int getSizeInventorySide(ForgeDirection side) + { + return 1; + } +} diff --git a/src/common/net/uberkat/obsidian/common/TileEntityCrusher.java b/src/common/net/uberkat/obsidian/common/TileEntityCrusher.java new file mode 100644 index 000000000..9f89e3739 --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/TileEntityCrusher.java @@ -0,0 +1,380 @@ +package net.uberkat.obsidian.common; + +import cpw.mods.fml.common.FMLCommonHandler; + +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.common.ISidedInventory; +import net.minecraft.src.*; + +public class TileEntityCrusher extends TileEntity implements IInventory, ISidedInventory +{ + /** + * The ItemStacks that hold the items currently being used in the furnace + */ + private ItemStack[] crusherItemStacks = new ItemStack[3]; + + /** The number of ticks that the furnace will keep burning */ + public int crusherBurnTime = 0; + + /** + * The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for + */ + public int currentItemBurnTime = 0; + + /** The number of ticks that the current item has been cooking for */ + public int crusherCookTime = 0; + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.crusherItemStacks.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int par1) + { + return this.crusherItemStacks[par1]; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int par1, int par2) + { + if (this.crusherItemStacks[par1] != null) + { + ItemStack var3; + + if (this.crusherItemStacks[par1].stackSize <= par2) + { + var3 = this.crusherItemStacks[par1]; + this.crusherItemStacks[par1] = null; + return var3; + } + else + { + var3 = this.crusherItemStacks[par1].splitStack(par2); + + if (this.crusherItemStacks[par1].stackSize == 0) + { + this.crusherItemStacks[par1] = null; + } + + return var3; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int par1) + { + if (this.crusherItemStacks[par1] != null) + { + ItemStack var2 = this.crusherItemStacks[par1]; + this.crusherItemStacks[par1] = null; + return var2; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) + { + this.crusherItemStacks[par1] = par2ItemStack; + + if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) + { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory. + */ + public String getInvName() + { + return "container.crusher"; + } + + /** + * Reads a tile entity from NBT. + */ + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); + this.crusherItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) + { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + byte var5 = var4.getByte("Slot"); + + if (var5 >= 0 && var5 < this.crusherItemStacks.length) + { + this.crusherItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + + this.crusherBurnTime = par1NBTTagCompound.getShort("BurnTime"); + this.crusherCookTime = par1NBTTagCompound.getShort("CookTime"); + this.currentItemBurnTime = getItemBurnTime(this.crusherItemStacks[1]); + } + + /** + * Writes a tile entity to NBT. + */ + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setShort("BurnTime", (short)this.crusherBurnTime); + par1NBTTagCompound.setShort("CookTime", (short)this.crusherCookTime); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.crusherItemStacks.length; ++var3) + { + if (this.crusherItemStacks[var3] != null) + { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.crusherItemStacks[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + par1NBTTagCompound.setTag("Items", var2); + } + + /** + * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't + * this more of a set than a get?* + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Returns an integer between 0 and the passed value representing how close the current item is to being completely + * cooked + */ + public int getCookProgressScaled(int par1) + { + return this.crusherCookTime * par1 / 200; + } + + /** + * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel + * item, where 0 means that the item is exhausted and the passed value means that the item is fresh + */ + public int getBurnTimeRemainingScaled(int par1) + { + if (this.currentItemBurnTime == 0) + { + this.currentItemBurnTime = 200; + } + + return this.crusherBurnTime * par1 / this.currentItemBurnTime; + } + + /** + * Returns true if the furnace is currently burning + */ + public boolean isBurning() + { + return this.crusherBurnTime > 0; + } + + /** + * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count + * ticks and creates a new spawn inside its implementation. + */ + public void updateEntity() + { + boolean var1 = this.crusherBurnTime > 0; + boolean var2 = false; + + if (this.crusherBurnTime > 0) + { + --this.crusherBurnTime; + } + + if (!this.worldObj.isRemote) + { + if (this.crusherBurnTime == 0 && this.canSmelt()) + { + this.currentItemBurnTime = this.crusherBurnTime = getItemBurnTime(this.crusherItemStacks[1]); + + if (this.crusherBurnTime > 0) + { + var2 = true; + + if (this.crusherItemStacks[1] != null) + { + --this.crusherItemStacks[1].stackSize; + + if (this.crusherItemStacks[1].stackSize == 0) + { + this.crusherItemStacks[1] = null; + } + } + } + } + + if (this.isBurning() && this.canSmelt()) + { + ++this.crusherCookTime; + + if (this.crusherCookTime == 200) + { + this.crusherCookTime = 0; + this.smeltItem(); + var2 = true; + } + } + else + { + this.crusherCookTime = 0; + } + + if (var1 != this.crusherBurnTime > 0) + { + var2 = true; + BlockCrusher.updateCrusherBlockState(this.crusherBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); + } + } + + if (var2) + { + this.onInventoryChanged(); + } + } + + /** + * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc. + */ + private boolean canSmelt() + { + if (this.crusherItemStacks[0] == null) + { + return false; + } + else + { + ItemStack var1 = CrusherRecipes.smelting().getSmeltingResult(this.crusherItemStacks[0]); + if (var1 == null) return false; + if (this.crusherItemStacks[2] == null) return true; + if (!this.crusherItemStacks[2].isItemEqual(var1)) return false; + int result = crusherItemStacks[2].stackSize + var1.stackSize; + return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize()); + } + } + + /** + * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack + */ + public void smeltItem() + { + if (this.canSmelt()) + { + ItemStack var1 = CrusherRecipes.smelting().getSmeltingResult(this.crusherItemStacks[0]); + + if (this.crusherItemStacks[2] == null) + { + this.crusherItemStacks[2] = var1.copy(); + } + else if (this.crusherItemStacks[2].isItemEqual(var1)) + { + //========================================================== + //Adding extra importance here, so this really small bug + //fix stops slipping through the cracks. + // + //Makes it so that items that result in multiple items are + //smelted correctly each time. + // + // + // + this.crusherItemStacks[2].stackSize += var1.stackSize; + //========================================================== + } + + --this.crusherItemStacks[0].stackSize; + + if (this.crusherItemStacks[0].stackSize <= 0) + { + this.crusherItemStacks[0] = null; + } + } + } + + /** + * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't + * fuel + */ + public static int getItemBurnTime(ItemStack par1ItemStack) + { + if (par1ItemStack == null) + { + return 0; + } + else + { + int var1 = par1ItemStack.getItem().shiftedIndex; + if (var1 == Item.redstone.shiftedIndex) return 600; + if (var1 == ObsidianIngots.RedstoneIngot.shiftedIndex) + if (par1ItemStack.getItem() instanceof ItemBlock && var1 == ObsidianIngots.RedstoneBlock.blockID) return 5400; + } + return 0; + } + + /** + * Return true if item is a fuel source (getItemBurnTime() > 0). + */ + public static boolean isItemFuel(ItemStack par0ItemStack) + { + return getItemBurnTime(par0ItemStack) > 0; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) + { + return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openChest() {} + + public void closeChest() {} + + @Override + public int getStartInventorySide(ForgeDirection side) + { + if (side == ForgeDirection.DOWN) return 1; + if (side == ForgeDirection.UP) return 0; + return 2; + } + + @Override + public int getSizeInventorySide(ForgeDirection side) + { + return 1; + } +} diff --git a/src/common/net/uberkat/obsidian/common/TileEntityEnrichmentChamber.java b/src/common/net/uberkat/obsidian/common/TileEntityEnrichmentChamber.java new file mode 100644 index 000000000..1e1a756ae --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/TileEntityEnrichmentChamber.java @@ -0,0 +1,378 @@ +package net.uberkat.obsidian.common; + +import cpw.mods.fml.common.FMLCommonHandler; + +import net.minecraftforge.common.ISidedInventory; +import net.minecraftforge.common.ForgeDirection; +import net.minecraft.src.*; + +public class TileEntityEnrichmentChamber extends TileEntity implements IInventory, ISidedInventory +{ + /** + * The ItemStacks that hold the items currently being used in the furnace + */ + private ItemStack[] chamberItemStacks = new ItemStack[3]; + + /** The number of ticks that the furnace will keep burning */ + public int chamberBurnTime = 0; + + /** + * The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for + */ + public int currentItemBurnTime = 0; + + /** The number of ticks that the current item has been cooking for */ + public int chamberCookTime = 0; + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.chamberItemStacks.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int par1) + { + return this.chamberItemStacks[par1]; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int par1, int par2) + { + if (this.chamberItemStacks[par1] != null) + { + ItemStack var3; + + if (this.chamberItemStacks[par1].stackSize <= par2) + { + var3 = this.chamberItemStacks[par1]; + this.chamberItemStacks[par1] = null; + return var3; + } + else + { + var3 = this.chamberItemStacks[par1].splitStack(par2); + + if (this.chamberItemStacks[par1].stackSize == 0) + { + this.chamberItemStacks[par1] = null; + } + + return var3; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int par1) + { + if (this.chamberItemStacks[par1] != null) + { + ItemStack var2 = this.chamberItemStacks[par1]; + this.chamberItemStacks[par1] = null; + return var2; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) + { + this.chamberItemStacks[par1] = par2ItemStack; + + if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) + { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory. + */ + public String getInvName() + { + return "container.chamber"; + } + + /** + * Reads a tile entity from NBT. + */ + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); + this.chamberItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) + { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + byte var5 = var4.getByte("Slot"); + + if (var5 >= 0 && var5 < this.chamberItemStacks.length) + { + this.chamberItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + + this.chamberBurnTime = par1NBTTagCompound.getShort("BurnTime"); + this.chamberCookTime = par1NBTTagCompound.getShort("CookTime"); + this.currentItemBurnTime = getItemBurnTime(this.chamberItemStacks[1]); + } + + /** + * Writes a tile entity to NBT. + */ + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setShort("BurnTime", (short)this.chamberBurnTime); + par1NBTTagCompound.setShort("CookTime", (short)this.chamberCookTime); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.chamberItemStacks.length; ++var3) + { + if (this.chamberItemStacks[var3] != null) + { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.chamberItemStacks[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + par1NBTTagCompound.setTag("Items", var2); + } + + /** + * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't + * this more of a set than a get?* + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Returns an integer between 0 and the passed value representing how close the current item is to being completely + * cooked + */ + public int getCookProgressScaled(int par1) + { + return this.chamberCookTime * par1 / 200; + } + + /** + * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel + * item, where 0 means that the item is exhausted and the passed value means that the item is fresh + */ + public int getBurnTimeRemainingScaled(int par1) + { + if (this.currentItemBurnTime == 0) + { + this.currentItemBurnTime = 200; + } + + return this.chamberBurnTime * par1 / this.currentItemBurnTime; + } + + /** + * Returns true if the furnace is currently burning + */ + public boolean isBurning() + { + return this.chamberBurnTime > 0; + } + + /** + * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count + * ticks and creates a new spawn inside its implementation. + */ + public void updateEntity() + { + boolean var1 = this.chamberBurnTime > 0; + boolean var2 = false; + + if (this.chamberBurnTime > 0) + { + --this.chamberBurnTime; + } + + if (!this.worldObj.isRemote) + { + if (this.chamberBurnTime == 0 && this.canSmelt()) + { + this.currentItemBurnTime = this.chamberBurnTime = getItemBurnTime(this.chamberItemStacks[1]); + + if (this.chamberBurnTime > 0) + { + var2 = true; + + if (this.chamberItemStacks[1] != null) + { + --this.chamberItemStacks[1].stackSize; + + if (this.chamberItemStacks[1].stackSize == 0) + { + this.chamberItemStacks[1] = null; + } + } + } + } + + if (this.isBurning() && this.canSmelt()) + { + ++this.chamberCookTime; + + if (this.chamberCookTime == 200) + { + this.chamberCookTime = 0; + this.smeltItem(); + var2 = true; + } + } + else + { + this.chamberCookTime = 0; + } + + if (var1 != this.chamberBurnTime > 0) + { + var2 = true; + BlockEnrichmentChamber.updateChamberBlockState(this.chamberBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); + } + } + + if (var2) + { + this.onInventoryChanged(); + } + } + + /** + * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc. + */ + private boolean canSmelt() + { + if (this.chamberItemStacks[0] == null) + { + return false; + } + else + { + ItemStack var1 = EnrichmentChamberRecipes.smelting().getSmeltingResult(this.chamberItemStacks[0]); + if (var1 == null) return false; + if (this.chamberItemStacks[2] == null) return true; + if (!this.chamberItemStacks[2].isItemEqual(var1)) return false; + int result = chamberItemStacks[2].stackSize + var1.stackSize; + return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize()); + } + } + + /** + * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack + */ + public void smeltItem() + { + if (this.canSmelt()) + { + ItemStack var1 = EnrichmentChamberRecipes.smelting().getSmeltingResult(this.chamberItemStacks[0]); + + if (this.chamberItemStacks[2] == null) + { + this.chamberItemStacks[2] = var1.copy(); + } + else if (this.chamberItemStacks[2].isItemEqual(var1)) + { + //========================================================== + //Adding extra importance here, so this really small bug + //fix stops slipping through the cracks. + // + //Makes it so that items that result in multiple items are + //smelted correctly each time. + // + // + // + this.chamberItemStacks[2].stackSize += var1.stackSize; + //========================================================== + } + + --this.chamberItemStacks[0].stackSize; + + if (this.chamberItemStacks[0].stackSize <= 0) + { + this.chamberItemStacks[0] = null; + } + } + } + + /** + * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't + * fuel + */ + public static int getItemBurnTime(ItemStack par1ItemStack) + { + if (par1ItemStack == null) + { + return 0; + } + else + { + int var1 = par1ItemStack.getItem().shiftedIndex; + if (var1 == Item.redstone.shiftedIndex) return 600; + } + return 0; + } + + /** + * Return true if item is a fuel source (getItemBurnTime() > 0). + */ + public static boolean isItemFuel(ItemStack par0ItemStack) + { + return getItemBurnTime(par0ItemStack) > 0; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) + { + return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openChest() {} + + public void closeChest() {} + + @Override + public int getStartInventorySide(ForgeDirection side) + { + if (side == ForgeDirection.DOWN) return 1; + if (side == ForgeDirection.UP) return 0; + return 2; + } + + @Override + public int getSizeInventorySide(ForgeDirection side) + { + return 1; + } +} diff --git a/src/common/net/uberkat/obsidian/common/TileEntityPlatinumCompressor.java b/src/common/net/uberkat/obsidian/common/TileEntityPlatinumCompressor.java new file mode 100644 index 000000000..a49cf461a --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/TileEntityPlatinumCompressor.java @@ -0,0 +1,379 @@ +package net.uberkat.obsidian.common; + +import cpw.mods.fml.common.FMLCommonHandler; + +import net.minecraft.src.*; +import net.minecraftforge.common.ISidedInventory; +import net.minecraftforge.common.ForgeDirection; + +public class TileEntityPlatinumCompressor extends TileEntity implements IInventory, ISidedInventory +{ + /** + * The ItemStacks that hold the items currently being used in the furnace + */ + private ItemStack[] compressorItemStacks = new ItemStack[3]; + + /** The number of ticks that the furnace will keep burning */ + public int compressorBurnTime = 0; + + /** + * The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for + */ + public int currentItemBurnTime = 0; + + /** The number of ticks that the current item has been cooking for */ + public int compressorCookTime = 0; + + /** + * Returns the number of slots in the inventory. + */ + public int getSizeInventory() + { + return this.compressorItemStacks.length; + } + + /** + * Returns the stack in slot i + */ + public ItemStack getStackInSlot(int par1) + { + return this.compressorItemStacks[par1]; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + public ItemStack decrStackSize(int par1, int par2) + { + if (this.compressorItemStacks[par1] != null) + { + ItemStack var3; + + if (this.compressorItemStacks[par1].stackSize <= par2) + { + var3 = this.compressorItemStacks[par1]; + this.compressorItemStacks[par1] = null; + return var3; + } + else + { + var3 = this.compressorItemStacks[par1].splitStack(par2); + + if (this.compressorItemStacks[par1].stackSize == 0) + { + this.compressorItemStacks[par1] = null; + } + + return var3; + } + } + else + { + return null; + } + } + + /** + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. + */ + public ItemStack getStackInSlotOnClosing(int par1) + { + if (this.compressorItemStacks[par1] != null) + { + ItemStack var2 = this.compressorItemStacks[par1]; + this.compressorItemStacks[par1] = null; + return var2; + } + else + { + return null; + } + } + + /** + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). + */ + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) + { + this.compressorItemStacks[par1] = par2ItemStack; + + if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) + { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } + + /** + * Returns the name of the inventory. + */ + public String getInvName() + { + return "container.compressor"; + } + + /** + * Reads a tile entity from NBT. + */ + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); + this.compressorItemStacks = new ItemStack[this.getSizeInventory()]; + + for (int var3 = 0; var3 < var2.tagCount(); ++var3) + { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + byte var5 = var4.getByte("Slot"); + + if (var5 >= 0 && var5 < this.compressorItemStacks.length) + { + this.compressorItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } + + this.compressorBurnTime = par1NBTTagCompound.getShort("BurnTime"); + this.compressorCookTime = par1NBTTagCompound.getShort("CookTime"); + this.currentItemBurnTime = getItemBurnTime(this.compressorItemStacks[1]); + } + + /** + * Writes a tile entity to NBT. + */ + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setShort("BurnTime", (short)this.compressorBurnTime); + par1NBTTagCompound.setShort("CookTime", (short)this.compressorCookTime); + NBTTagList var2 = new NBTTagList(); + + for (int var3 = 0; var3 < this.compressorItemStacks.length; ++var3) + { + if (this.compressorItemStacks[var3] != null) + { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.compressorItemStacks[var3].writeToNBT(var4); + var2.appendTag(var4); + } + } + + par1NBTTagCompound.setTag("Items", var2); + } + + /** + * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't + * this more of a set than a get?* + */ + public int getInventoryStackLimit() + { + return 64; + } + + /** + * Returns an integer between 0 and the passed value representing how close the current item is to being completely + * cooked + */ + public int getCookProgressScaled(int par1) + { + return this.compressorCookTime * par1 / 200; + } + + /** + * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel + * item, where 0 means that the item is exhausted and the passed value means that the item is fresh + */ + public int getBurnTimeRemainingScaled(int par1) + { + if (this.currentItemBurnTime == 0) + { + this.currentItemBurnTime = 200; + } + + return this.compressorBurnTime * par1 / this.currentItemBurnTime; + } + + /** + * Returns true if the furnace is currently burning + */ + public boolean isBurning() + { + return this.compressorBurnTime > 0; + } + + /** + * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count + * ticks and creates a new spawn inside its implementation. + */ + public void updateEntity() + { + boolean var1 = this.compressorBurnTime > 0; + boolean var2 = false; + + if (this.compressorBurnTime > 0) + { + --this.compressorBurnTime; + } + + if (!this.worldObj.isRemote) + { + if (this.compressorBurnTime == 0 && this.canSmelt()) + { + this.currentItemBurnTime = this.compressorBurnTime = getItemBurnTime(this.compressorItemStacks[1]); + + if (this.compressorBurnTime > 0) + { + var2 = true; + + if (this.compressorItemStacks[1] != null) + { + --this.compressorItemStacks[1].stackSize; + + if (this.compressorItemStacks[1].stackSize == 0) + { + this.compressorItemStacks[1] = null; + } + } + } + } + + if (this.isBurning() && this.canSmelt()) + { + ++this.compressorCookTime; + + if (this.compressorCookTime == 200) + { + this.compressorCookTime = 0; + this.smeltItem(); + var2 = true; + } + } + else + { + this.compressorCookTime = 0; + } + + if (var1 != this.compressorBurnTime > 0) + { + var2 = true; + BlockPlatinumCompressor.updateCompressorBlockState(this.compressorBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); + } + } + + if (var2) + { + this.onInventoryChanged(); + } + } + + /** + * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc. + */ + private boolean canSmelt() + { + if (this.compressorItemStacks[0] == null) + { + return false; + } + else + { + ItemStack var1 = PlatinumCompressorRecipes.smelting().getSmeltingResult(this.compressorItemStacks[0]); + if (var1 == null) return false; + if (this.compressorItemStacks[2] == null) return true; + if (!this.compressorItemStacks[2].isItemEqual(var1)) return false; + int result = compressorItemStacks[2].stackSize + var1.stackSize; + return (result <= getInventoryStackLimit() && result <= var1.getMaxStackSize()); + } + } + + /** + * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack + */ + public void smeltItem() + { + if (this.canSmelt()) + { + ItemStack var1 = PlatinumCompressorRecipes.smelting().getSmeltingResult(this.compressorItemStacks[0]); + + if (this.compressorItemStacks[2] == null) + { + this.compressorItemStacks[2] = var1.copy(); + } + else if (this.compressorItemStacks[2].isItemEqual(var1)) + { + //========================================================== + //Adding extra importance here, so this really small bug + //fix stops slipping through the cracks. + // + //Makes it so that items that result in multiple items are + //smelted correctly each time. + // + // + // + this.compressorItemStacks[2].stackSize += var1.stackSize; + //========================================================== + } + + --this.compressorItemStacks[0].stackSize; + + if (this.compressorItemStacks[0].stackSize <= 0) + { + this.compressorItemStacks[0] = null; + } + } + } + + /** + * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't + * fuel + */ + public static int getItemBurnTime(ItemStack par1ItemStack) + { + if (par1ItemStack == null) + { + return 0; + } + else + { + int var1 = par1ItemStack.getItem().shiftedIndex; + if (var1 == ObsidianIngots.PlatinumIngot.shiftedIndex) return 200; + if (par1ItemStack.getItem() instanceof ItemBlock && var1 == ObsidianIngots.PlatinumBlock.blockID) return 1800; + } + return 0; + } + + /** + * Return true if item is a fuel source (getItemBurnTime() > 0). + */ + public static boolean isItemFuel(ItemStack par0ItemStack) + { + return getItemBurnTime(par0ItemStack) > 0; + } + + /** + * Do not make give this method the name canInteractWith because it clashes with Container + */ + public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) + { + return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; + } + + public void openChest() {} + + public void closeChest() {} + + @Override + public int getStartInventorySide(ForgeDirection side) + { + if (side == ForgeDirection.DOWN) return 1; + if (side == ForgeDirection.UP) return 0; + return 2; + } + + @Override + public int getSizeInventorySide(ForgeDirection side) + { + return 1; + } +} diff --git a/src/common/net/uberkat/obsidian/common/Version.java b/src/common/net/uberkat/obsidian/common/Version.java new file mode 100644 index 000000000..f905f6d9e --- /dev/null +++ b/src/common/net/uberkat/obsidian/common/Version.java @@ -0,0 +1,41 @@ +package net.uberkat.obsidian.common; + +public class Version { + + public int major; + public int minor; + public int build; + + public Version(int majorNum, int minorNum, int buildNum) + { + major = majorNum; + minor = minorNum; + build = buildNum; + } + + public void reset() + { + major = 0; + minor = 0; + build = 0; + } + + public String toString() + { + if(major == 0 && minor == 0 && build == 0) + { + return ""; + } + else if(major != 0 && minor != 0 && build == 0) + { + return major + "." + minor; + } + else if(major != 0 && minor == 0 && build == 0) + { + return major + "." + minor; + } + else { + return major + "." + minor + "." + build; + } + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/ClientProxy.java b/src/minecraft/net/uberkat/obsidian/client/ClientProxy.java new file mode 100644 index 000000000..477b0e667 --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/ClientProxy.java @@ -0,0 +1,152 @@ +package net.uberkat.obsidian.client; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Properties; + +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.Side; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.registry.TickRegistry; +import net.minecraft.client.Minecraft; +import net.minecraft.src.Block; +import net.minecraft.src.EntityPlayer; +import net.minecraft.src.GuiScreen; +import net.minecraft.src.IBlockAccess; +import net.minecraft.src.ModLoader; +import net.minecraft.src.RenderBlocks; +import net.minecraft.src.World; +import net.minecraftforge.client.MinecraftForgeClient; +import net.uberkat.obsidian.common.CommonProxy; +import net.uberkat.obsidian.common.EntityKnife; +import net.uberkat.obsidian.common.EntityObsidianArrow; +import net.uberkat.obsidian.common.EntityObsidianTNT; +import net.uberkat.obsidian.common.ObsidianIngots; +import net.uberkat.obsidian.common.ObsidianUtils; +import net.uberkat.obsidian.common.TileEntityCombiner; +import net.uberkat.obsidian.common.TileEntityCrusher; +import net.uberkat.obsidian.common.TileEntityEnrichmentChamber; +import net.uberkat.obsidian.common.TileEntityPlatinumCompressor; + +/** + * Client proxy for Obsidian Ingots mod. + * @author AidanBrady + * + */ +public class ClientProxy extends CommonProxy +{ + @Override + public void registerRenderInformation() + { + System.out.println("[ObsidianIngots] Beginning render initiative..."); + //Preload block/item textures + MinecraftForgeClient.preloadTexture("/obsidian/items.png"); + MinecraftForgeClient.preloadTexture("/obsidian/terrain.png"); + MinecraftForgeClient.preloadTexture("/obsidian/Compressor.png"); + MinecraftForgeClient.preloadTexture("/obsidian/Combiner.png"); + + //Register entity rendering handlers + RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new RenderObsidianTNT()); + RenderingRegistry.registerEntityRenderingHandler(EntityObsidianArrow.class, new RenderObsidianArrow()); + RenderingRegistry.registerEntityRenderingHandler(EntityKnife.class, new RenderKnife()); + System.out.println("[ObsidianIngots] Render initiative complete."); + } + + public void setProperties() + { + Properties properties = new Properties(); + try + { + File config = new File(new StringBuilder().append(Minecraft.getMinecraftDir()).append("/config/ObsidianIngots.txt").toString()); + if(config.exists()) + { + properties.load(new FileInputStream(config)); + ObsidianIngots.platinumOreID = Integer.parseInt(properties.getProperty("platinumOreID")); + ObsidianIngots.platinumBlockID = Integer.parseInt(properties.getProperty("platinumBlockID")); + ObsidianIngots.redstoneBlockID = Integer.parseInt(properties.getProperty("redstoneBlockID")); + ObsidianIngots.obsidianTNTID = Integer.parseInt(properties.getProperty("obsidianTNTID")); + ObsidianIngots.refinedObsidianID = Integer.parseInt(properties.getProperty("refinedObsidianID")); + ObsidianIngots.lifeBlockID = Integer.parseInt(properties.getProperty("lifeBlockID")); + ObsidianIngots.enrichmentChamberID = Integer.parseInt(properties.getProperty("enrichmentChamberID")); + ObsidianIngots.platinumCompressorID = Integer.parseInt(properties.getProperty("platinumCompressorID")); + ObsidianIngots.combinerID = Integer.parseInt(properties.getProperty("combinerID")); + ObsidianIngots.crusherID = Integer.parseInt(properties.getProperty("crusherID")); + ObsidianIngots.coalBlockID = Integer.parseInt(properties.getProperty("coalBlockID")); + ObsidianIngots.refinedGlowstoneID = Integer.parseInt(properties.getProperty("refinedGlowstoneID")); + ObsidianIngots.extrasEnabled = Boolean.parseBoolean(properties.getProperty("extrasEnabled")); + ObsidianIngots.oreGenerationEnabled = Boolean.parseBoolean(properties.getProperty("oreGenerationEnabled")); + ObsidianIngots.logger.info("[ObsidianIngots] Data loaded."); + } + else { + config.createNewFile(); + ObsidianIngots.logger.info("[ObsidianIngots] Created 'ObsidianIngots.txt' configuration file."); + FileOutputStream fileoutputstream = new FileOutputStream(config); + properties.setProperty("platinumOreID", Integer.toString(200)); + properties.setProperty("platinumBlockID", Integer.toString(201)); + properties.setProperty("redstoneBlockID", Integer.toString(202)); + properties.setProperty("obsidianTNTID", Integer.toString(203)); + properties.setProperty("refinedObsidianID", Integer.toString(204)); + properties.setProperty("lifeBlockID", Integer.toString(205)); + properties.setProperty("enrichmentChamberID", Integer.toString(206)); + properties.setProperty("platinumCompressorID", Integer.toString(207)); + properties.setProperty("combinerID", Integer.toString(208)); + properties.setProperty("crusherID", Integer.toString(209)); + properties.setProperty("coalBlockID", Integer.toString(210)); + properties.setProperty("refinedGlowstoneID", Integer.toString(211)); + properties.setProperty("extrasEnabled", Boolean.toString(true)); + properties.setProperty("oreGenerationEnabled", Boolean.toString(true)); + properties.store(fileoutputstream, "Official Obsidian Ingots Configuration."); + fileoutputstream.close(); + } + + } catch (IOException ioexception) + { + System.err.println("[ObsidianIngots] An error occured while reading from configuration file."); + ioexception.printStackTrace(); + } + } + + public void loadUtilities() + { + System.out.println("[ObsidianIngots] Beginning utility initiative..."); + ObsidianIngots.latestVersionNumber = ObsidianUtils.getLatestVersion(); + ObsidianIngots.recentNews = ObsidianUtils.getRecentNews(); + ObsidianUtils.sendServerData(); + System.out.println("[ObsidianIngots] Utility initiative complete."); + } + + @Override + public GuiScreen getClientGui(int ID, EntityPlayer player, World world, int x, int y, int z) + { + switch(ID) + { + case 18: + return new GuiStopwatch(player); + case 19: + return new GuiCredits(); + case 20: + return new GuiWeatherOrb(player); + case 21: + TileEntityEnrichmentChamber tileentity = (TileEntityEnrichmentChamber)world.getBlockTileEntity(x, y, z); + return new GuiEnrichmentChamber(player.inventory, tileentity); + case 22: + TileEntityPlatinumCompressor tileentity1 = (TileEntityPlatinumCompressor)world.getBlockTileEntity(x, y, z); + return new GuiPlatinumCompressor(player.inventory, tileentity1); + case 23: + TileEntityCombiner tileentity2 = (TileEntityCombiner)world.getBlockTileEntity(x, y, z); + return new GuiCombiner(player.inventory, tileentity2); + case 24: + TileEntityCrusher tileentity3 = (TileEntityCrusher)world.getBlockTileEntity(x, y, z); + return new GuiCrusher(player.inventory, tileentity3); + } + return null; + } + + public void loadTickHandler() + { + TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT); + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/ClientTickHandler.java b/src/minecraft/net/uberkat/obsidian/client/ClientTickHandler.java new file mode 100644 index 000000000..1ac924ea2 --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/ClientTickHandler.java @@ -0,0 +1,38 @@ +package net.uberkat.obsidian.client; + +import java.util.EnumSet; + +import net.minecraft.src.ModLoader; +import net.minecraftforge.common.MinecraftForge; +import net.uberkat.obsidian.common.ObsidianIngots; +import net.uberkat.obsidian.common.ObsidianUtils; + +import cpw.mods.fml.common.ITickHandler; +import cpw.mods.fml.common.TickType; + +public class ClientTickHandler implements ITickHandler +{ + public void tickStart(EnumSet type, Object... tickData) + { + if(ObsidianIngots.ticksPassed == 0 && ModLoader.getMinecraftInstance().theWorld != null && ModLoader.getMinecraftInstance().thePlayer != null) + { + ObsidianUtils.checkForUpdates(ModLoader.getMinecraftInstance().thePlayer); + ObsidianIngots.ticksPassed++; + } + } + + public void tickEnd(EnumSet type, Object... tickData) + { + + } + + public EnumSet ticks() + { + return EnumSet.of(TickType.CLIENT, TickType.WORLDLOAD); + } + + public String getLabel() + { + return "ObsidianIngots"; + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/GuiCombiner.java b/src/minecraft/net/uberkat/obsidian/client/GuiCombiner.java new file mode 100644 index 000000000..970d5c717 --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/GuiCombiner.java @@ -0,0 +1,49 @@ +package net.uberkat.obsidian.client; + +import org.lwjgl.opengl.GL11; +import net.minecraft.src.*; +import net.uberkat.obsidian.common.ContainerCombiner; +import net.uberkat.obsidian.common.TileEntityCombiner; + +public class GuiCombiner extends GuiContainer +{ + private TileEntityCombiner combinerInventory; + + public GuiCombiner(InventoryPlayer par1InventoryPlayer, TileEntityCombiner par2TileEntityCombiner) + { + super(new ContainerCombiner(par1InventoryPlayer, par2TileEntityCombiner)); + combinerInventory = par2TileEntityCombiner; + } + + /** + * Draw the foreground layer for the GuiContainer (everythin in front of the items) + */ + protected void drawGuiContainerForegroundLayer() + { + fontRenderer.drawString("Combiner", 49, 6, 0x404040); + fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040); + } + + /** + * Draw the background layer for the GuiContainer (everything behind the items) + */ + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + int var4 = this.mc.renderEngine.getTexture("/gui/GuiCombiner.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.bindTexture(var4); + int var5 = (this.width - this.xSize) / 2; + int var6 = (this.height - this.ySize) / 2; + drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); + int var7; + + if (this.combinerInventory.isBurning()) + { + var7 = this.combinerInventory.getBurnTimeRemainingScaled(12); + this.drawTexturedModalRect(var5 + 56, var6 + 36 + 12 - var7, 176, 12 - var7, 14, var7 + 2); + } + + var7 = this.combinerInventory.getCookProgressScaled(24); + this.drawTexturedModalRect(var5 + 79, var6 + 34, 176, 14, var7 + 1, 16); + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/GuiCredits.java b/src/minecraft/net/uberkat/obsidian/client/GuiCredits.java new file mode 100644 index 000000000..8914ee476 --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/GuiCredits.java @@ -0,0 +1,76 @@ +package net.uberkat.obsidian.client; + +import java.io.IOException; +import java.net.URL; + +import org.lwjgl.Sys; + +import net.minecraft.src.*; +import net.uberkat.obsidian.common.ObsidianIngots; +import net.uberkat.obsidian.common.ObsidianUtils; + +public class GuiCredits extends GuiScreen { + + private static String updateProgress = ""; + + public void initGui() + { + controlList.clear(); + controlList.add(new GuiButton(2, width / 2 - 100, height / 4 + 72 + 12, "Update")); + controlList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Cancel")); + } + + public void onGuiClosed() + { + updateProgress = ""; + } + + public static void onFinishedDownloading() + { + updateProgress = "Successfully updated. Restart Minecraft to load."; + } + + public static void onErrorDownloading() + { + updateProgress = "Error updating."; + } + + protected void actionPerformed(GuiButton guibutton) + { + if(!guibutton.enabled) + { + return; + } + if(guibutton.id == 2) + { + if(!ObsidianUtils.isClientLatestVersion()) + { + updateProgress = "Downloading latest version..."; + guibutton.enabled = false; + new ThreadUpdate("http://dl.dropbox.com/u/90411166/Obsidian%20Ingots.zip"); + } + } + if(guibutton.id == 1) + { + mc.displayGuiScreen(null); + } + } + + public void writeText(String text, int yAxis) + { + drawString(fontRenderer, text, width / 2 - 140, (height / 4 - 60) + 20 + yAxis, 0xa0a0a0); + } + + public void drawScreen(int i, int j, float f) + { + drawDefaultBackground(); + drawCenteredString(fontRenderer, "Obsidian Ingots by aidancbrady", width / 2, (height / 4 - 60) + 20, 0xffffff); + drawString(fontRenderer, (new StringBuilder()).append("Your version: ").append(ObsidianUtils.isClientLatestVersion() ? ObsidianIngots.versionNumber.toString() : (ObsidianIngots.versionNumber.toString() + " -- OUTDATED")).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 36, 0xa0a0a0); + drawString(fontRenderer, (new StringBuilder()).append("Newest version: ").append(ObsidianIngots.latestVersionNumber).toString(), width / 2 - 140, (height / 4 - 60) + 20 + 45, 0xa0a0a0); + writeText("*Developed on Mac OS X 10.8 Mountain Lion", 63); + writeText("*Code, textures, and ideas by aidancbrady", 72); + writeText("Recent news: " + ObsidianIngots.recentNews, 81); + writeText(updateProgress, 99); + super.drawScreen(i, j, f); + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/GuiCrusher.java b/src/minecraft/net/uberkat/obsidian/client/GuiCrusher.java new file mode 100644 index 000000000..4994dda24 --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/GuiCrusher.java @@ -0,0 +1,49 @@ +package net.uberkat.obsidian.client; + +import org.lwjgl.opengl.GL11; +import net.minecraft.src.*; +import net.uberkat.obsidian.common.ContainerCrusher; +import net.uberkat.obsidian.common.TileEntityCrusher; + +public class GuiCrusher extends GuiContainer +{ + private TileEntityCrusher crusherInventory; + + public GuiCrusher(InventoryPlayer par1InventoryPlayer, TileEntityCrusher par2TileEntityCrusher) + { + super(new ContainerCrusher(par1InventoryPlayer, par2TileEntityCrusher)); + crusherInventory = par2TileEntityCrusher; + } + + /** + * Draw the foreground layer for the GuiContainer (everythin in front of the items) + */ + protected void drawGuiContainerForegroundLayer() + { + fontRenderer.drawString("Crusher", 50, 6, 0x404040); + fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040); + } + + /** + * Draw the background layer for the GuiContainer (everything behind the items) + */ + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + int var4 = this.mc.renderEngine.getTexture("/gui/GuiCrusher.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.bindTexture(var4); + int var5 = (this.width - this.xSize) / 2; + int var6 = (this.height - this.ySize) / 2; + drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); + int var7; + + if (this.crusherInventory.isBurning()) + { + var7 = this.crusherInventory.getBurnTimeRemainingScaled(12); + this.drawTexturedModalRect(var5 + 56, var6 + 36 + 12 - var7, 176, 12 - var7, 14, var7 + 2); + } + + var7 = this.crusherInventory.getCookProgressScaled(24); + this.drawTexturedModalRect(var5 + 79, var6 + 34, 176, 14, var7 + 1, 16); + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/GuiEnrichmentChamber.java b/src/minecraft/net/uberkat/obsidian/client/GuiEnrichmentChamber.java new file mode 100644 index 000000000..58c44e94f --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/GuiEnrichmentChamber.java @@ -0,0 +1,49 @@ +package net.uberkat.obsidian.client; + +import org.lwjgl.opengl.GL11; +import net.minecraft.src.*; +import net.uberkat.obsidian.common.ContainerEnrichmentChamber; +import net.uberkat.obsidian.common.TileEntityEnrichmentChamber; + +public class GuiEnrichmentChamber extends GuiContainer +{ + private TileEntityEnrichmentChamber chamberInventory; + + public GuiEnrichmentChamber(InventoryPlayer par1InventoryPlayer, TileEntityEnrichmentChamber par2TileEntityEnrichmentChamber) + { + super(new ContainerEnrichmentChamber(par1InventoryPlayer, par2TileEntityEnrichmentChamber)); + chamberInventory = par2TileEntityEnrichmentChamber; + } + + /** + * Draw the foreground layer for the GuiContainer (everythin in front of the items) + */ + protected void drawGuiContainerForegroundLayer() + { + fontRenderer.drawString("Enrichment Chamber", 45, 6, 0x404040); + fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040); + } + + /** + * Draw the background layer for the GuiContainer (everything behind the items) + */ + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + int var4 = this.mc.renderEngine.getTexture("/gui/GuiChamber.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.bindTexture(var4); + int var5 = (this.width - this.xSize) / 2; + int var6 = (this.height - this.ySize) / 2; + drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); + int var7; + + if (this.chamberInventory.isBurning()) + { + var7 = this.chamberInventory.getBurnTimeRemainingScaled(12); + this.drawTexturedModalRect(var5 + 56, var6 + 36 + 12 - var7, 176, 12 - var7, 14, var7 + 2); + } + + var7 = this.chamberInventory.getCookProgressScaled(24); + this.drawTexturedModalRect(var5 + 79, var6 + 34, 176, 14, var7 + 1, 16); + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/GuiPlatinumCompressor.java b/src/minecraft/net/uberkat/obsidian/client/GuiPlatinumCompressor.java new file mode 100644 index 000000000..4d3dea6fb --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/GuiPlatinumCompressor.java @@ -0,0 +1,49 @@ +package net.uberkat.obsidian.client; + +import org.lwjgl.opengl.GL11; +import net.minecraft.src.*; +import net.uberkat.obsidian.common.ContainerPlatinumCompressor; +import net.uberkat.obsidian.common.TileEntityPlatinumCompressor; + +public class GuiPlatinumCompressor extends GuiContainer +{ + private TileEntityPlatinumCompressor compressorInventory; + + public GuiPlatinumCompressor(InventoryPlayer par1InventoryPlayer, TileEntityPlatinumCompressor par2TileEntityPlatinumCompressor) + { + super(new ContainerPlatinumCompressor(par1InventoryPlayer, par2TileEntityPlatinumCompressor)); + compressorInventory = par2TileEntityPlatinumCompressor; + } + + /** + * Draw the foreground layer for the GuiContainer (everythin in front of the items) + */ + protected void drawGuiContainerForegroundLayer() + { + fontRenderer.drawString("Platinum Compressor", 45, 6, 0x404040); + fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040); + } + + /** + * Draw the background layer for the GuiContainer (everything behind the items) + */ + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + int var4 = this.mc.renderEngine.getTexture("/gui/GuiCompressor.png"); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.renderEngine.bindTexture(var4); + int var5 = (this.width - this.xSize) / 2; + int var6 = (this.height - this.ySize) / 2; + drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); + int var7; + + if (this.compressorInventory.isBurning()) + { + var7 = this.compressorInventory.getBurnTimeRemainingScaled(12); + this.drawTexturedModalRect(var5 + 56, var6 + 36 + 12 - var7, 176, 12 - var7, 14, var7 + 2); + } + + var7 = this.compressorInventory.getCookProgressScaled(24); + this.drawTexturedModalRect(var5 + 79, var6 + 34, 176, 14, var7 + 1, 16); + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/GuiStopwatch.java b/src/minecraft/net/uberkat/obsidian/client/GuiStopwatch.java new file mode 100644 index 000000000..fbab1e762 --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/GuiStopwatch.java @@ -0,0 +1,140 @@ +package net.uberkat.obsidian.client; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.src.*; +import net.uberkat.obsidian.common.ObsidianUtils; + +public class GuiStopwatch extends GuiScreen { + + private static EntityPlayer player; + private int xSize = 176; + private int ySize = 166; + + public GuiStopwatch(EntityPlayer entityplayer) + { + player = entityplayer; + } + + public void initGui() + { + controlList.clear(); + controlList.add(new GuiButton(1, width / 2 - 80, height / 2 - 65, 50, 20, "Sunrise")); + controlList.add(new GuiButton(2, width / 2 - 80, height / 2 - 35, 50, 20, "Noon")); + controlList.add(new GuiButton(3, width / 2 + 5, height / 2 - 65, 50, 20, "Sunset")); + controlList.add(new GuiButton(4, width / 2 + 5, height / 2 - 35, 50, 20, "Midnight")); + controlList.add(new GuiButton(5, width / 2 - 94, height / 2 + 30, 80, 20, "Credits")); + controlList.add(new GuiButton(6, width / 2 - 10, height / 2 + 30, 80, 20, "Close")); + } + + public void drawScreen(int i, int j, float f) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int k = mc.renderEngine.getTexture("/gui/GuiStopwatch.png"); + mc.renderEngine.bindTexture(k); + drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166); + drawString(fontRenderer, "Steve's Stopwatch", width / 2 - 60, height / 2 - 95, 0xffffff); + super.drawScreen(i, j, f); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + + public void keyTyped(char c, int i) + { + if (i == 1) + { + mc.displayGuiScreen(null); + } + } + + public boolean doesGuiPauseGame() + { + return false; + } + + public void actionPerformed(GuiButton guibutton) + { + if(guibutton.id == 1) + { + if(mc.isSingleplayer()) + { + ObsidianUtils.setHourForward(player.worldObj, 0); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(0); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 2) + { + if(mc.isSingleplayer()) + { + ObsidianUtils.setHourForward(player.worldObj, 6); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(1); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 3) + { + if(mc.isSingleplayer()) + { + ObsidianUtils.setHourForward(player.worldObj, 12); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(2); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 4) + { + if(mc.isSingleplayer()) + { + ObsidianUtils.setHourForward(player.worldObj, 18); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(3); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 5) + { + mc.displayGuiScreen(new GuiCredits()); + } + if(guibutton.id == 6) + { + mc.displayGuiScreen(null); + } + } + + protected void mouseClicked(int i, int j, int k) + { + super.mouseClicked(i, j, k); + int x = i - (width - xSize) / 2; + int y = j - (height - ySize) / 2; + + if(x > 4 && x < 14 && y > 4 && y < 14) + { + mc.displayGuiScreen(null); + } + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/GuiWeatherOrb.java b/src/minecraft/net/uberkat/obsidian/client/GuiWeatherOrb.java new file mode 100644 index 000000000..5f21a4c64 --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/GuiWeatherOrb.java @@ -0,0 +1,145 @@ +package net.uberkat.obsidian.client; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.src.*; +import net.uberkat.obsidian.common.ObsidianUtils; + +public class GuiWeatherOrb extends GuiScreen { + + private static EntityPlayer player; + private int xSize = 176; + private int ySize = 166; + + public GuiWeatherOrb(EntityPlayer entityplayer) + { + player = entityplayer; + } + + public void initGui() + { + controlList.clear(); + controlList.add(new GuiButton(1, width / 2 - 80, height / 2 - 65, 50, 20, "Clear")); + controlList.add(new GuiButton(2, width / 2 - 80, height / 2 - 35, 50, 20, "Storm/Rain")); + controlList.add(new GuiButton(3, width / 2 + 5, height / 2 - 65, 50, 20, "Storm")); + controlList.add(new GuiButton(4, width / 2 + 5, height / 2 - 35, 50, 20, "Rain")); + controlList.add(new GuiButton(5, width / 2 - 94, height / 2 + 30, 80, 20, "Credits")); + controlList.add(new GuiButton(6, width / 2 - 10, height / 2 + 30, 80, 20, "Close")); + } + + public void drawScreen(int i, int j, float f) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int k = mc.renderEngine.getTexture("/gui/GuiWeatherOrb.png"); + mc.renderEngine.bindTexture(k); + drawTexturedModalRect(width / 2 - 100, height / 2 - 100, 0, 0, 176, 166); + drawString(fontRenderer, "Weather Orb", width / 2 - 60, height / 2 - 95, 0xffffff); + super.drawScreen(i, j, f); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + + public void keyTyped(char c, int i) + { + if (i == 1) + { + mc.displayGuiScreen(null); + } + } + + public boolean doesGuiPauseGame() + { + return false; + } + + public void actionPerformed(GuiButton guibutton) + { + if(guibutton.id == 1) + { + if(mc.isSingleplayer()) + { + player.worldObj.getWorldInfo().setRaining(false); + player.worldObj.getWorldInfo().setThundering(false); + player.worldObj.setRainStrength(0.0F); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(5); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 2) + { + if(mc.isSingleplayer()) + { + player.worldObj.getWorldInfo().setRaining(true); + player.worldObj.getWorldInfo().setThundering(true); + player.worldObj.setRainStrength(1.0F); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(6); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 3) + { + if(mc.isSingleplayer()) + { + player.worldObj.getWorldInfo().setThundering(true); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(7); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 4) + { + if(mc.isSingleplayer()) + { + player.worldObj.getWorldInfo().setRaining(true); + player.worldObj.setRainStrength(1.0F); + player.inventory.getCurrentItem().damageItem(4999, player); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + else { + ObsidianUtils.sendPacketDataInt(8); + ObsidianUtils.doExplosion(player); + mc.displayGuiScreen(null); + } + } + if(guibutton.id == 5) + { + mc.displayGuiScreen(new GuiCredits()); + } + if(guibutton.id == 6) + { + mc.displayGuiScreen(null); + } + } + + protected void mouseClicked(int i, int j, int k) + { + super.mouseClicked(i, j, k); + int x = i - (width - xSize) / 2; + int y = j - (height - ySize) / 2; + + if(x > 4 && x < 14 && y > 4 && y < 14) + { + mc.displayGuiScreen(null); + } + } +} diff --git a/src/minecraft/net/uberkat/obsidian/client/RenderKnife.java b/src/minecraft/net/uberkat/obsidian/client/RenderKnife.java new file mode 100644 index 000000000..d2c73350a --- /dev/null +++ b/src/minecraft/net/uberkat/obsidian/client/RenderKnife.java @@ -0,0 +1,99 @@ +package net.uberkat.obsidian.client; + +import org.lwjgl.opengl.GL11; +import net.minecraft.src.*; +import net.uberkat.obsidian.common.EntityKnife; + +import org.lwjgl.opengl.GL12; + +public class RenderKnife extends Render +{ + private float pitch; + + public RenderKnife() + { + pitch = 40F; + } + + public void renderKnife(EntityKnife entityknife, double d, double d1, double d2, float f, float f1) + { + this.setRenderManager(RenderManager.instance); + loadTexture("/obsidian/Knife.png"); + if (entityknife.prevRotationYaw == 0.0F && entityknife.prevRotationPitch == 0.0F) + { + return; + } + GL11.glPushMatrix(); + GL11.glTranslatef((float)d, (float)d1, (float)d2); + GL11.glRotatef((entityknife.prevRotationYaw + (entityknife.rotationYaw - entityknife.prevRotationYaw) * f1) - 90F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(entityknife.prevRotationPitch + (entityknife.rotationPitch - entityknife.prevRotationPitch) * f1, 0.0F, 0.0F, 1.0F); + Tessellator tessellator = Tessellator.instance; + int i = 0; + float f2 = 0.0F; + float f3 = 0.5F; + float f4 = (float)(0 + i * 10) / 32F; + float f5 = (float)(5 + i * 10) / 32F; + float f6 = 0.0F; + float f7 = 0.15625F; + float f8 = (float)(5 + i * 10) / 32F; + float f9 = (float)(10 + i * 10) / 32F; + float f10 = 0.05625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float f11 = (float)entityknife.arrowShake - f1; + + if (f11 > 0.0F) + { + float f12 = -MathHelper.sin(f11 * 3F) * f11; + GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F); + } + + GL11.glRotatef(45F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(f10, f10, f10); + GL11.glTranslatef(-4F, 0.0F, 0.0F); + GL11.glNormal3f(f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7D, -2D, -2D, f6, f8); + tessellator.addVertexWithUV(-7D, -2D, 2D, f7, f8); + tessellator.addVertexWithUV(-7D, 2D, 2D, f7, f9); + tessellator.addVertexWithUV(-7D, 2D, -2D, f6, f9); + tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + tessellator.addVertexWithUV(-7D, -2D, -2D, f6, f8); + tessellator.addVertexWithUV(-7D, -2D, 2D, f7, f8); + tessellator.addVertexWithUV(-7D, 2D, 2D, f7, f9); + tessellator.addVertexWithUV(-7D, 2D, -2D, f6, f9); + tessellator.draw(); + GL11.glNormal3f(-f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7D, 2D, -2D, f6, f8); + tessellator.addVertexWithUV(-7D, 2D, 2D, f7, f8); + tessellator.addVertexWithUV(-7D, -2D, 2D, f7, f9); + tessellator.addVertexWithUV(-7D, -2D, -2D, f6, f9); + tessellator.draw(); + + for (int j = 0; j < 4; j++) + { + GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, f10); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-8D, -2D, 0.0D, f2, f4); + tessellator.addVertexWithUV(8D, -2D, 0.0D, f3, f4); + tessellator.addVertexWithUV(8D, 2D, 0.0D, f3, f5); + tessellator.addVertexWithUV(-8D, 2D, 0.0D, f2, f5); + tessellator.draw(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) + { + float var22 = -MathHelper.sin(var21 * 3.0F) * var21; + GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F); + } + + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(var20, var20, var20); + GL11.glTranslatef(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(var20, 0.0F, 0.0F); + var10.startDrawingQuads(); + var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var18); + var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var18); + var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var19); + var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var19); + var10.draw(); + GL11.glNormal3f(-var20, 0.0F, 0.0F); + var10.startDrawingQuads(); + var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var18); + var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var18); + var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var19); + var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19); + var10.draw(); + + for (int var23 = 0; var23 < 4; ++var23) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, var20); + var10.startDrawingQuads(); + var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)var12, (double)var14); + var10.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)var13, (double)var14); + var10.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)var13, (double)var15); + var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)var12, (double)var15); + var10.draw(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 1.0F) + { + f2 = 1.0F; + } + + f2 *= f2; + f2 *= f2; + float f4 = 1.0F + f2 * 0.3F; + GL11.glScalef(f4, f4, f4); + } + + float f3 = (1.0F - (((float)entityobsidiantnt.fuse - f1) + 1.0F) / 100F) * 0.8F; + loadTexture("/obsidian/terrain.png"); + blockRenderer.renderBlockAsItem(ObsidianIngots.ObsidianTNT, 0, entityobsidiantnt.getBrightness(f1)); + + if ((entityobsidiantnt.fuse / 5) % 2 == 0) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, f3); + blockRenderer.renderBlockAsItem(ObsidianIngots.ObsidianTNT, 0, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glPopMatrix(); + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0) + { + outputStream.write(buffer, 0, lastBytesDownloaded); + buffer = new byte[10240]; + bytesDownloaded += lastBytesDownloaded; + } + + outputStream.close(); + stream.close(); + GuiCredits.onFinishedDownloading(); + System.out.println("[ObsidianIngots] Successfully updated to latest version (" + ObsidianIngots.latestVersionNumber + ")."); + finalize(); + + } catch(Throwable e) + { + GuiCredits.onErrorDownloading(); + System.err.println("[ObsidianIngots] Error while finishing update thread: " + e.getMessage()); + try { + finalize(); + } catch (Throwable e1) { + System.err.println("[ObsidianIngots] Error while finalizing update thread: " + e1.getMessage()); + } + } + } + + public void prepareForDownload() + { + File download = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/mods/ObsidianIngots.jar").toString()); + File config = new File(new StringBuilder().append(ModLoader.getMinecraftInstance().getMinecraftDir()).append("/config/mod_ObsidianIngots.txt").toString()); + if(download.exists()) + { + download.delete(); + } + if(config.exists()) + { + config.delete(); + } + System.out.println("[ObsidianIngots] Preparing to update..."); + } +}