From 8d0eabb998ffb13b80962a5f73e9968565cc2d2b Mon Sep 17 00:00:00 2001 From: HbmMods Date: Sat, 11 Apr 2020 19:46:07 +0200 Subject: [PATCH] cellular dungeon generator --- .../hbm/textures/blocks/crate_ammo_bottom.png | Bin 0 -> 602 bytes .../hbm/textures/blocks/crate_ammo_side.png | Bin 0 -> 730 bytes assets/hbm/textures/blocks/crate_ammo_top.png | Bin 0 -> 618 bytes assets/hbm/textures/blocks/meteor.png | Bin 0 -> 514 bytes assets/hbm/textures/blocks/meteor_brick.png | Bin 0 -> 518 bytes .../textures/blocks/meteor_brick_chiseled.png | Bin 0 -> 553 bytes .../textures/blocks/meteor_brick_cracked.png | Bin 0 -> 547 bytes .../textures/blocks/meteor_brick_mossy.png | Bin 0 -> 678 bytes assets/hbm/textures/blocks/meteor_cobble.png | Bin 0 -> 542 bytes assets/hbm/textures/blocks/meteor_crushed.png | Bin 0 -> 454 bytes assets/hbm/textures/blocks/meteor_pillar.png | Bin 0 -> 435 bytes .../hbm/textures/blocks/meteor_pillar_top.png | Bin 0 -> 472 bytes .../hbm/textures/blocks/meteor_polished.png | Bin 0 -> 501 bytes .../hbm/textures/blocks/meteor_treasure.png | Bin 0 -> 528 bytes com/hbm/blocks/ModBlocks.java | 29 +++- com/hbm/blocks/generic/BlockAmmoCrate.java | 76 +++++++++ .../blocks/generic/BlockGenericPillar.java | 33 ++++ com/hbm/blocks/generic/BlockMush.java | 2 +- com/hbm/entity/projectile/EntityMeteor.java | 2 +- com/hbm/items/ModItems.java | 26 ++-- com/hbm/items/tool/ItemWandD.java | 57 ++----- com/hbm/items/tool/ItemWandS.java | 12 +- com/hbm/lib/HbmWorldGen.java | 38 ++--- com/hbm/main/MainRegistry.java | 2 + com/hbm/packet/NBTPacket.java | 3 + .../tileentity/RenderStructureMaker.java | 10 +- .../machine/TileEntityFWatzCore.java | 2 +- com/hbm/world/{ => dungeon}/Antenna.java | 2 +- com/hbm/world/{ => dungeon}/Barrel.java | 2 +- com/hbm/world/{ => dungeon}/Bunker.java | 2 +- .../world/{ => dungeon}/CrashedVertibird.java | 2 +- .../world/{ => dungeon}/DesertAtom001.java | 2 +- .../world/{ => dungeon}/DesertAtom002.java | 2 +- .../world/{ => dungeon}/DesertAtom003.java | 2 +- com/hbm/world/{ => dungeon}/Factory.java | 2 +- .../world/{ => dungeon}/LibraryDungeon.java | 2 +- com/hbm/world/{ => dungeon}/Radio01.java | 2 +- com/hbm/world/{ => dungeon}/Radio02.java | 2 +- com/hbm/world/{ => dungeon}/Relay.java | 2 +- com/hbm/world/{ => dungeon}/Satellite.java | 2 +- com/hbm/world/{ => dungeon}/Silo.java | 2 +- com/hbm/world/{ => dungeon}/Spaceship.java | 2 +- com/hbm/world/{ => dungeon}/Spaceship2.java | 2 +- com/hbm/world/{ => dungeon}/Vertibird.java | 2 +- com/hbm/world/{ => feature}/Dud.java | 2 +- com/hbm/world/{ => feature}/Geyser.java | 2 +- com/hbm/world/{ => feature}/GeyserLarge.java | 2 +- com/hbm/world/{ => feature}/HugeMush.java | 2 +- com/hbm/world/{ => feature}/Meteorite.java | 2 +- com/hbm/world/{ => feature}/OilBubble.java | 2 +- .../world/{ => feature}/OilSandBubble.java | 2 +- com/hbm/world/{ => feature}/Sellafield.java | 2 +- com/hbm/world/generator/CellularDungeon.java | 145 ++++++++++++++++++ .../generator/CellularDungeonFactory.java | 20 +++ .../world/generator/CellularDungeonRoom.java | 67 ++++++++ com/hbm/world/generator/DungeonToolbox.java | 59 +++++++ com/hbm/world/generator/TestDungeon.java | 18 +++ .../generator/room/TestDungeonRoom1.java | 31 ++++ .../generator/room/TestDungeonRoom2.java | 34 ++++ .../generator/room/TestDungeonRoom3.java | 33 ++++ .../generator/room/TestDungeonRoom4.java | 32 ++++ .../generator/room/TestDungeonRoom5.java | 30 ++++ com/hbm/world/{ => machine}/FWatz.java | 2 +- .../world/{ => machine}/FactoryAdvanced.java | 2 +- .../world/{ => machine}/FactoryTitanium.java | 2 +- .../world/{ => machine}/FusionReactor.java | 2 +- .../world/{ => machine}/NuclearReactor.java | 2 +- com/hbm/world/{ => machine}/Watz.java | 2 +- 68 files changed, 701 insertions(+), 122 deletions(-) create mode 100644 assets/hbm/textures/blocks/crate_ammo_bottom.png create mode 100644 assets/hbm/textures/blocks/crate_ammo_side.png create mode 100644 assets/hbm/textures/blocks/crate_ammo_top.png create mode 100644 assets/hbm/textures/blocks/meteor.png create mode 100644 assets/hbm/textures/blocks/meteor_brick.png create mode 100644 assets/hbm/textures/blocks/meteor_brick_chiseled.png create mode 100644 assets/hbm/textures/blocks/meteor_brick_cracked.png create mode 100644 assets/hbm/textures/blocks/meteor_brick_mossy.png create mode 100644 assets/hbm/textures/blocks/meteor_cobble.png create mode 100644 assets/hbm/textures/blocks/meteor_crushed.png create mode 100644 assets/hbm/textures/blocks/meteor_pillar.png create mode 100644 assets/hbm/textures/blocks/meteor_pillar_top.png create mode 100644 assets/hbm/textures/blocks/meteor_polished.png create mode 100644 assets/hbm/textures/blocks/meteor_treasure.png create mode 100644 com/hbm/blocks/generic/BlockAmmoCrate.java create mode 100644 com/hbm/blocks/generic/BlockGenericPillar.java rename com/hbm/world/{ => dungeon}/Antenna.java (97%) rename com/hbm/world/{ => dungeon}/Barrel.java (97%) rename com/hbm/world/{ => dungeon}/Bunker.java (98%) rename com/hbm/world/{ => dungeon}/CrashedVertibird.java (98%) rename com/hbm/world/{ => dungeon}/DesertAtom001.java (98%) rename com/hbm/world/{ => dungeon}/DesertAtom002.java (98%) rename com/hbm/world/{ => dungeon}/DesertAtom003.java (98%) rename com/hbm/world/{ => dungeon}/Factory.java (98%) rename com/hbm/world/{ => dungeon}/LibraryDungeon.java (98%) rename com/hbm/world/{ => dungeon}/Radio01.java (98%) rename com/hbm/world/{ => dungeon}/Radio02.java (98%) rename com/hbm/world/{ => dungeon}/Relay.java (98%) rename com/hbm/world/{ => dungeon}/Satellite.java (98%) rename com/hbm/world/{ => dungeon}/Silo.java (98%) rename com/hbm/world/{ => dungeon}/Spaceship.java (98%) rename com/hbm/world/{ => dungeon}/Spaceship2.java (98%) rename com/hbm/world/{ => dungeon}/Vertibird.java (98%) rename com/hbm/world/{ => feature}/Dud.java (94%) rename com/hbm/world/{ => feature}/Geyser.java (97%) rename com/hbm/world/{ => feature}/GeyserLarge.java (98%) rename com/hbm/world/{ => feature}/HugeMush.java (93%) rename com/hbm/world/{ => feature}/Meteorite.java (99%) rename com/hbm/world/{ => feature}/OilBubble.java (95%) rename com/hbm/world/{ => feature}/OilSandBubble.java (96%) rename com/hbm/world/{ => feature}/Sellafield.java (98%) create mode 100644 com/hbm/world/generator/CellularDungeon.java create mode 100644 com/hbm/world/generator/CellularDungeonFactory.java create mode 100644 com/hbm/world/generator/CellularDungeonRoom.java create mode 100644 com/hbm/world/generator/DungeonToolbox.java create mode 100644 com/hbm/world/generator/TestDungeon.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom1.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom2.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom3.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom4.java create mode 100644 com/hbm/world/generator/room/TestDungeonRoom5.java rename com/hbm/world/{ => machine}/FWatz.java (95%) rename com/hbm/world/{ => machine}/FactoryAdvanced.java (95%) rename com/hbm/world/{ => machine}/FactoryTitanium.java (95%) rename com/hbm/world/{ => machine}/FusionReactor.java (98%) rename com/hbm/world/{ => machine}/NuclearReactor.java (97%) rename com/hbm/world/{ => machine}/Watz.java (98%) diff --git a/assets/hbm/textures/blocks/crate_ammo_bottom.png b/assets/hbm/textures/blocks/crate_ammo_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..f1d85c7eba2a98f20d1ed5142e7a51bdf930a06a GIT binary patch literal 602 zcmV-g0;T8qv5QIN1Nl83ehz%o6ioh^j7%<=>Z;;lH>()<^#!%rD z!L=@=f;yh~qZ9`cNERSiaCSI5yW70J{@OzblrYAy?>pM%R)+td7inx zzGj|hj>jW9guvU|8!07}QUK(fNhwvr5(V@5`H8g_tu@*hLrRI4mnWuaB7|>PYw_MA zB6M9x2!X!u@!s?JXql#o(`jT`79^!aN{MNjcz=KA>gtLZBf~JDlp>`>*LAGx%DS!< z*Y`b5)1Z}7D5Y4}uiW4N#5qTdk!{=1T9Z;D#)$VGt#!qXrw62v}i#GFbp{7===VX7h?pd#+5cIrN}wcwkiC=V+`JVthLoQU22Rm z(zb0?5@W1N%6kZbwrwjRfXwp@!1MDL;12-9Fkr2%Ej7l}`{BV5<8MUdqOi<=nJ}eP zRZ}`qhRHcsaawDD%Q77f2aLJn>FJKPZL!wUGz~X5H+b)fG1leT_wU@^{-}$mkH;hD o^O=v25B`soQk{*GP@-(?UnGlN>&Xc9pa1{>07*qoM6N<$f}%d z5KyX83hmea0|I;dPFL1@T3O=u_P;ESV-Bz^i!93s!;ma zgb+MFKBD6|=KlVk$z(!4p9dgKQ;ac3!UK#kD5daypTS^&)*5YD7VUPMG)$k_6B5P)cEp z!M1I}Fy!Lmf_}eGzu%|TY9WL`Dy2|L(d+f-bUIWj6~^N+-{0RDW7uxDY&IJ%FE1Gm zhsb zAIgzZ;y4a3FE6xOEq1#di^bwdHl0qXR;z5cTRhJr%QAq!1X^p-G(}3u^Yb&;*VkyR ziQ|~Jw>Ny>M@mUPpJ%;ZQ!17Adr6W29E&@gF_+7cWf_)b;d$QC<$AqFYmE?MFBk*? zz;PIcA+=hKUa!Y=I%Tm~P%fAG`uajCh39$u_NClM2*dD50MO}lm`o-tmrKsh&JaRS ztJO%;l=*y4rBeCjNak|6V}yFW&R{U$_4Sq0)6=8PZnsOL(V$!|GaL@t?RIQ7o4xRA zwF1EReV(44n9XKfU0vb2E@_(LI1ZL&F&GSJHk%X*1s)zAkWwOqK>Yc0n{BsSf*@eI zT;luwKAYAALGbH3X_`{4RvC>(e0+QmMbZA5K0iNMtycKHPcE0kbzOuI6pKZoC?ZJ` zT-QZwO_pVpN+qO}j7B5$`};dTKR+m?7!HU03uDYtT`BczcKF!;0lj)&*4sakWB>pF M07*qoM6N<$f@9lH(EtDd literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/crate_ammo_top.png b/assets/hbm/textures/blocks/crate_ammo_top.png new file mode 100644 index 0000000000000000000000000000000000000000..0f4a99c0081cae1f059871cd542e46bf735ac92a GIT binary patch literal 618 zcmV-w0+s!VP)nnX$qejnK4$KW#b#a>5&4Xu8 zT;oUgJ@P!qBuV0ub5FltIRk+DgvGPh!Seu6>hI9PU@!pS?C6NOX7frL>uYOtx+z8a z%jHBYN-2!*`$P6-ld-X}OU1oj?@9&7$3KTkN||MG6h%Z)M6cH)iXzvjR8X89P@Em0 zl)89Gqil^v!|g}cPQf{h`3-=#vhu#z-`{6)a*`~|@O__ZwTkC?SZg^sIU&n3_j!t< zKtu?FfSsKkOuOCY^z@Xyy}e8RMT9)hQA#nY6fS=3KNyY#KR2Tjn*aa+07*qoM6N<$ Ef_V5F1poj5 literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor.png b/assets/hbm/textures/blocks/meteor.png new file mode 100644 index 0000000000000000000000000000000000000000..e0b9eadb4d248a9ea6ebc24eaacd7681c708c6bc GIT binary patch literal 514 zcmV+d0{#7oP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0hdWcK~y+TCDKW& z!axuNV3Uc)-Jl0S1ikzJ|Bv8B6vchtzBqI6)$~+VSNBUY9*^twdZkjiUax+g9Qc|0C4 zfU2@sETsK6{=8nVWHy_TwcG9eelO+aa#8K~`?_Noz(_1;V5x$^#Z@w{BMd!uT$Jci z#WlcWL3BFas@_hg6TpR7H!^`ax_Z?)kYX_QU;%8f4d9tTE6rgvow+BI$;2OV4~K(R zWM(B}smRC`l~^7@0y9%;Vs6iPFjpg5(R4Z`<5H#%p%jRLs)?o!C-%{WOr0!7P$_$k zMkAJn(^pn{R}9!Q{dT(rRMzWtxd8tMZ*2U|=W`2*JJAhLj3-7deT8$BR;!hv<>4m` z?-)-Ju)5)J=o)-QzGq*rfmmY4<*J)o67v`r)+EcaA8_4tQ2^gKN&o-=07*qoM6N<$ Eg5Hkf5C8xG literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_brick.png b/assets/hbm/textures/blocks/meteor_brick.png new file mode 100644 index 0000000000000000000000000000000000000000..5d68cd622093a20c2cf81871d1495b24bb20d78c GIT binary patch literal 518 zcmV+h0{Q)kP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TugK~y+TCDKO{ z0x=8(K-MPbf-1rl4!nSG@c##JBj>!(lzrH>q?yrJb~c~Shr?l(WvA1r)9K`SzTIxS z-LA~>cx<=Z-|zQ)KEL1Z>-D-`uOoD!P}uMH5WC&3*=&A3pWE$rI2_{3YE?)GhiIHmr}z6EN48upGv-^X)!=ABz&)Q& zW_Ys?pvo+XFPBS>7<-=8^!@K&B*<`e^HmoI<5+u~-;Zuh#>05@(QIE|(;sU5Euu zE8S0YH4qjw1bc?-LP#hHmGnojH;lk>GB6&GeK{6dYEI=I+od(o6#^nmc*JE zxe%W#Hj;Z|&_^aP4eG=m0)mEV8j>b%Zjug3G;w0T-~az&{LeT9PlKK-ljkZe93^j2 z=}!QaO2;Bej64Z6==AbZ=Kp0&42>;DPUit-GHo0z@$)?Y0rm&CukTIQQ~&?~07*qo IM6N<$f&_`&hX4Qo literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_brick_chiseled.png b/assets/hbm/textures/blocks/meteor_brick_chiseled.png new file mode 100644 index 0000000000000000000000000000000000000000..419db8411ddb0d5fb7de13b28fdffd0e2819c42f GIT binary patch literal 553 zcmV+^0@nSBP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0lrB@K~y+TCDKWc zDPa@_U{z?enP7p4L~QsC{{PNOVkH(r520h8y19>AU!rpAJMVOk3Pz(*EEWrb;B-2@ zzrU;h{{F%+d^{fN`2VwBuhpeeX*Qe1yWQ?$u>e80#SS-@JTrS_=-?>~4LZLmGOw0qsN*9!<%%OJz^s?D3G!s3!^;kvnky|uXsNq%x z>efz&!y#t1S{;wa?wx3@d|n&!vq!gtqZL^qauk3SKsuc^szS&YfuqWn%xbwf&?J~l zr&DCwl}bfs)4uiqO^lCOKR-Ve_6-C|%l87{a0ZT-%VnzoGQCJ}(Nk#A)t)>XjRwMN zj9#yoOeW=VOUB=1(dKca6`ct=8~^(HvhkqRYMG2Y+S}V3VN3%M!%=$@k{SPeJ_kNN rAgK(>UCLk00000NkvXXu0mjfl=c5p literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_brick_cracked.png b/assets/hbm/textures/blocks/meteor_brick_cracked.png new file mode 100644 index 0000000000000000000000000000000000000000..d8231ce06dddfcad6dd5226ad968ef09cbb29c87 GIT binary patch literal 547 zcmV+;0^I$HP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0k}y-K~y+TEz-$O zYC#YNU^xvkDv&S)LcoQA6=B2sKL#(L5QrL?XW@RNZ!b=&YxsxilNyaijYcDtN=+t{ z;c%GAWWK+@UteEOr_*Aw=yW=Ne}DV^{(ip;WP+5-YPHgFyU^Le3>htr{ zPMKj&nHb#y88H;NVK5j(eHfTC85ba5tycXDs_c3nc?(FG`}+EdtEf~eek8vM55VH{ z2|hkP3`3dE=b>J&+ns3)cq!ynE$){#2Y-~ncYqo%@VFOS7rAOtq#Yn6ENTlDr|cpt lfE{CFzUJc_N6_o_`VS17lK3JF9l8Jj002ovPDHLkV1gms=~Ms! literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_brick_mossy.png b/assets/hbm/textures/blocks/meteor_brick_mossy.png new file mode 100644 index 0000000000000000000000000000000000000000..64883bb48168b3f46a6604c48a7abce5d234d8e0 GIT binary patch literal 678 zcmV;X0$KfuP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TFR$RQLq68 zmjzduv(o@ol8GNICZANs*spKl?024JnQSw*S_?!Xl2mGVp7&oEH{R>@I?wYbFLpFd zvksEwpv?dMG@zYMCyrwn;h!Q?*!YZi``Y+S0S{V#r(&9>^UK8d{idrf#wh`{R;w8Y z^P(vHflMhy5=d+|8}DS(eN6F4k_5ELmjXGduIn%qott}n_#?u5<7)`M{V2m25L`1w zYgbN|3Xa>(i71ND054`jyIEPWSB6{nte*TuT znFKZ%C{I<@AP6kWG7JMI;*md#^kIM1bVVw~4#o$n<2V=&*hq~4fY=xIgI+ON#MsB- z#d}Un)2#Xq!w>;C28i#c_p$|WKA)qo z@#h?QNEAib3zEXoeOk5!v|JFS=<>sxGA#}`C;?<@+cpNj`+zh(A}PYfJ81DLAeB~i zn=eLN$W=&rqpZDSC5tos;xM}!GV}@uRCPlD*sz3XA%MMmNDPPk1A*g%fQBC~iU0rr M07*qoM6N<$f(W4~F8}}l literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_cobble.png b/assets/hbm/textures/blocks/meteor_cobble.png new file mode 100644 index 0000000000000000000000000000000000000000..950c46ee2213829a4ab0c2b36a48af4d09d1d34b GIT binary patch literal 542 zcmV+(0^$9MP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0kcU&K~y+THPP43 z>Oc%dVUp0xp^7FzfW-Sh6-e|RI{Y6(Cl`|$kG;INC;0dO`+Pp@^}1Lr9*@UXt985G z9*;*DhWUJcv)N=anNq1FCu+CbLf7l{^?JSE@BMynAIGtbD2kHFBptCfvNFqur|^LaX*ZZ?}V2;n(e8;wRPmBLyq7Mh<< zr}20kQLnZ2a5&_0Ibd3K5TU{Ge!pW=QLR={LNFQ_MfzDJR58l)`OIds*n%SV5+Vl- z7Oen8!&3r}MWOile5TeF36Tk6xZsSLUau!oE|-l<6RE}^j|#$AkFfRH?RMlEF|ZHS z^tj|3juJEE?Mrb%v<}KJeu`Z$mrJfRq0p^3OC}MFMk89?>8>w^$I_5CtqhbrAfHM- zBjZv|_hXsVM$FKfDiqFc>(K%YYTd3PB;$)9KVyNDBQ#ne!Bq zjIZDCQ)sfZIkMpqy4|ja!;KVB#xabuVoC(ncor1df;6-7bxSS=-9KlvN;PkK>}AYm gGn3THpyD|G0}M8K)73-w)Bpeg07*qoM6N<$g5tF8%K!iX literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_crushed.png b/assets/hbm/textures/blocks/meteor_crushed.png new file mode 100644 index 0000000000000000000000000000000000000000..96040b9d549a1fdc7c006709b08d010a9078b72a GIT binary patch literal 454 zcmV;%0XhDOP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0b5B#K~y+TJ<-Xo zgD?yQ(2_t$x~SN7!~cIC0<{!6ypv~%EG);qgPl};-|zSPs;XYESI$}fe!o*nu613n z>v}jGcDvp2c%0`MEL|>_@As?m`FtcI!Zc0LlBQ{pf4|=*mzHHwqTvw31kwNsbkJx? zU{c77KqBGi^C^-n?SHL}%(>W^4ElUNiwvX34c`@jHc>En);OI`O5!jKmLspB9yB=9 zV@k^WRIv>}F9uLy5|WOJ_n{&Y^ZkC;rr~`g#WZJ32j}s4sDx)MS$5FaIAm1q?Zmp6 zd~C=^CAV#>s$>mSG<>sKNenj*+k|BYJ@@PNio+xxG@c+SN@Bjb+ literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_pillar.png b/assets/hbm/textures/blocks/meteor_pillar.png new file mode 100644 index 0000000000000000000000000000000000000000..5d177d55fb5e3a95d17aff6979a3ec2270581504 GIT binary patch literal 435 zcmV;k0ZjghP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0Z2(iK~y+TMbg`j z!axiI&|aWio{;$ekE95-&;omc5u1nLabhPkr9GWa`~CiQy8+WQozLfS9O3Kry4`N) zc|IPGm&*md-|uqwdcB^{XWO=Y-@o7Q$K%m74M42C*=&^b$l*)iu-omNl?6s%Sej5x zU8lM%i(H74A%G#W?sZ*(!{H!DAZi~GOF%7t!!W@7@GP=qEF4Q?B^w)3hpwYhOTenS z@s8Dl^20TLj=}{5pa~C<{of&!-3S!u#cxlKZhPRn52OhtdzP3*sl)~28sQmr_Ja~+ zzs2z00GZ)hvr7%pp&SocLDr$qV_5y;R`!_crV|;ZH8w7dA@&{s5*GDJrTaW?x;f=R zTvtX~l`PgZ0re5r*CFFg?*WtqoCc*jdV%Z^4Od4sVU(ONjU+R<{(Nbr5t?Lu%5EGU d#*3zD{s1prM?@JdB)R|q002ovPDHLkV1m;=y4U~! literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_pillar_top.png b/assets/hbm/textures/blocks/meteor_pillar_top.png new file mode 100644 index 0000000000000000000000000000000000000000..d1ac8ed70e4eec635bb22278fb283dfad200be0f GIT binary patch literal 472 zcmV;}0Vn>6P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0c}Y{K~y+TJ<{8b zf?x~;VBvQ~JVCgV_kTTOjDjb0_xowGy&!FwnNADE@pybZ9^38qcaFtkQI_TR``z#N z!!YQdPAB>Ke3p;nn7Xc8E|;L6&qq=eg?yT(=kuw&-|x!T>s8k^t@rz#e&*06yjrc+ z>$QBh+f`L%jwB=kLn8HkPe2zMh)j^Z6On7052h>-6kO7{UawjK3WuIb?kQR+rBoUk zdQ4M7(}D10&rAep0mfu`yWQY~!cMvtbq#u6A&?-ak0~!>9H_!XPd4C~Bw?&Ff>2f@ zh7kJ+Ab}ZY74m$|IjH1Q&JMFhEogbTf|G|~AJ^E+<&v)vs6B7fsJi-oid<6Oar^_ER%DmM4CcrH O0000Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0g6dPK~y+TJ<>_8 z0x=8(P&&=j%(ReT$%0!TasQ*RVxF4uzm}z+MU>c8<+77(v)SZ%e!X71-R|%A%d*V5 z*Xy-ft;6Ba@AqZD-|zi?PbuwoyKKE)pH8Q$s@mu+)&&QR-csv#%A>x`8g+^6c!g{~oMNtd}16d$sMI0=m2~L85 z1o;5nZnx-17N3jf^XV`g4)f)5x!rC@qmf1-^s1TvE}f;swPB}{&t@})Oa_QvXq#9x z%1l%U3nUUA$3S)nP?pZ;b4*r+z;O#BUb_!TQSzY|mT0k#AAU4YTUsm@a6q8$)9Dlw zUxZIMb?V`ydOU*lSY67plvB+kdN?l=?q!kHfmVv`MAe;`-5HK=9-?nr$SU|02mmR{ z#YK*iI(o2+^B`!~K#=PS(2N?3AqZ(##EQxK2Qcvqsps?goIt!lj5t05CX>i$QB52n rTdh_Spy4fyDJT*_MeG*cqA30V2M2Farh2)D00000NkvXXu0mjfBdyz3 literal 0 HcmV?d00001 diff --git a/assets/hbm/textures/blocks/meteor_treasure.png b/assets/hbm/textures/blocks/meteor_treasure.png new file mode 100644 index 0000000000000000000000000000000000000000..250eb974ad4356be026473c61b763d2ec9ebc516 GIT binary patch literal 528 zcmV+r0`L8aP)AeHsZudDSAq0BwhzRfZ8#CiL z4#pUm8FS9H&pG!=Xl95AA%rFHdc6Q>t*ywdwbg}l4(~l?hC7a9{Q&s+`2k>zK`8|@ zV~l}_d?Guy`s%%-F-BTzlu}43t*G~gTI-4oaGvLyhN`0bz9S-t2iY}@uPp{nAX3JEauP^CaiI@ZPrVQ=*wsYhCn-2xdmkd5Qdm=Qs|& zzP>(FxFg@|U0w)biH$L+wJzb_JEfG*@or!qj|blSRp8$;%?wptmulbl#l|lf6 getDrops(World world, int x, int y, int z, int metadata, int fortune) { + + ArrayList ret = new ArrayList(); + + ret.add(new ItemStack(ModItems.cap_nuka, 12 + rand.nextInt(21))); + ret.add(new ItemStack(ModItems.syringe_metal_stimpak, 1 + rand.nextInt(3))); + + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_22lr, 16 + rand.nextInt(17))); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_9mm, 6 + rand.nextInt(13))); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_12gauge, 6 + rand.nextInt(4))); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_20gauge, 3 + rand.nextInt(4))); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.gun_revolver_ammo, 10 + rand.nextInt(11))); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.gun_revolver_iron_ammo, 12 + rand.nextInt(15))); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_50bmg, 2 + rand.nextInt(7))); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_rocket, 1)); + if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_grenade, 1 + rand.nextInt(2))); + + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_12gauge_incendiary, 3)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_incendiary, 3)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_caustic, 3)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_flechette, 3)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_9mm_ap, 7)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket_incendiary, 1)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket_sleek, 1)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_he, 1)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_incendiary, 1)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_sleek, 1)); + if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.syringe_metal_super, 2)); + + return ret; + } +} diff --git a/com/hbm/blocks/generic/BlockGenericPillar.java b/com/hbm/blocks/generic/BlockGenericPillar.java new file mode 100644 index 000000000..05d1647ae --- /dev/null +++ b/com/hbm/blocks/generic/BlockGenericPillar.java @@ -0,0 +1,33 @@ +package com.hbm.blocks.generic; + +import com.hbm.lib.RefStrings; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.BlockRotatedPillar; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + +public class BlockGenericPillar extends BlockRotatedPillar { + + @SideOnly(Side.CLIENT) + protected IIcon iconSide; + + public BlockGenericPillar(Material p_i45425_1_) { + super(p_i45425_1_); + } + + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister reg) + { + this.field_150164_N = reg.registerIcon(RefStrings.MODID + ":meteor_pillar_top"); + this.iconSide = reg.registerIcon(RefStrings.MODID + ":meteor_pillar"); + } + + @Override + protected IIcon getSideIcon(int p_150163_1_) { + return iconSide; + } + +} diff --git a/com/hbm/blocks/generic/BlockMush.java b/com/hbm/blocks/generic/BlockMush.java index 4092accaf..6fb3a00ff 100644 --- a/com/hbm/blocks/generic/BlockMush.java +++ b/com/hbm/blocks/generic/BlockMush.java @@ -3,7 +3,7 @@ package com.hbm.blocks.generic; import java.util.Random; import com.hbm.blocks.ModBlocks; -import com.hbm.world.HugeMush; +import com.hbm.world.feature.HugeMush; import net.minecraft.block.Block; import net.minecraft.block.IGrowable; diff --git a/com/hbm/entity/projectile/EntityMeteor.java b/com/hbm/entity/projectile/EntityMeteor.java index c0e3d5879..27040987e 100644 --- a/com/hbm/entity/projectile/EntityMeteor.java +++ b/com/hbm/entity/projectile/EntityMeteor.java @@ -4,7 +4,7 @@ import com.hbm.entity.particle.EntityGasFlameFX; import com.hbm.entity.particle.EntitySmokeFX; import com.hbm.explosion.ExplosionLarge; import com.hbm.main.MainRegistry; -import com.hbm.world.Meteorite; +import com.hbm.world.feature.Meteorite; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/com/hbm/items/ModItems.java b/com/hbm/items/ModItems.java index 8cf716af4..b9f18d75a 100644 --- a/com/hbm/items/ModItems.java +++ b/com/hbm/items/ModItems.java @@ -2916,19 +2916,19 @@ public class ModItems { grenade_pink_cloud = new ItemGrenade(-1).setUnlocalizedName("grenade_pink_cloud").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_pink_cloud"); ullapool_caber = new WeaponSpecial(MainRegistry.enumToolMaterialSteel).setUnlocalizedName("ullapool_caber").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ullapool_caber"); - grenade_if_generic = new ItemGrenade(4).setUnlocalizedName("grenade_if_generic").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_generic"); - grenade_if_he = new ItemGrenade(5).setUnlocalizedName("grenade_if_he").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_he"); - grenade_if_bouncy = new ItemGrenade(4).setUnlocalizedName("grenade_if_bouncy").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_bouncy"); - grenade_if_sticky = new ItemGrenade(4).setUnlocalizedName("grenade_if_sticky").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_sticky"); - grenade_if_impact = new ItemGrenade(-1).setUnlocalizedName("grenade_if_impact").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_impact"); - grenade_if_incendiary = new ItemGrenade(4).setUnlocalizedName("grenade_if_incendiary").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_incendiary"); - grenade_if_toxic = new ItemGrenade(4).setUnlocalizedName("grenade_if_toxic").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_toxic"); - grenade_if_concussion = new ItemGrenade(4).setUnlocalizedName("grenade_if_concussion").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_concussion"); - grenade_if_brimstone = new ItemGrenade(5).setUnlocalizedName("grenade_if_brimstone").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_brimstone"); - grenade_if_mystery = new ItemGrenade(5).setUnlocalizedName("grenade_if_mystery").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_mystery"); - grenade_if_spark = new ItemGrenade(7).setUnlocalizedName("grenade_if_spark").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_spark"); - grenade_if_hopwire = new ItemGrenade(7).setUnlocalizedName("grenade_if_hopwire").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_hopwire"); - grenade_if_null = new ItemGrenade(7).setUnlocalizedName("grenade_if_null").setCreativeTab(null).setTextureName(RefStrings.MODID + ":grenade_if_null"); + grenade_if_generic = new ItemGrenade(4).setUnlocalizedName("grenade_if_generic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_generic"); + grenade_if_he = new ItemGrenade(5).setUnlocalizedName("grenade_if_he").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_he"); + grenade_if_bouncy = new ItemGrenade(4).setUnlocalizedName("grenade_if_bouncy").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_bouncy"); + grenade_if_sticky = new ItemGrenade(4).setUnlocalizedName("grenade_if_sticky").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_sticky"); + grenade_if_impact = new ItemGrenade(-1).setUnlocalizedName("grenade_if_impact").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_impact"); + grenade_if_incendiary = new ItemGrenade(4).setUnlocalizedName("grenade_if_incendiary").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_incendiary"); + grenade_if_toxic = new ItemGrenade(4).setUnlocalizedName("grenade_if_toxic").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_toxic"); + grenade_if_concussion = new ItemGrenade(4).setUnlocalizedName("grenade_if_concussion").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_concussion"); + grenade_if_brimstone = new ItemGrenade(5).setUnlocalizedName("grenade_if_brimstone").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_brimstone"); + grenade_if_mystery = new ItemGrenade(5).setUnlocalizedName("grenade_if_mystery").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_mystery"); + grenade_if_spark = new ItemGrenade(7).setUnlocalizedName("grenade_if_spark").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_spark"); + grenade_if_hopwire = new ItemGrenade(7).setUnlocalizedName("grenade_if_hopwire").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_hopwire"); + grenade_if_null = new ItemGrenade(7).setUnlocalizedName("grenade_if_null").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_if_null"); grenade_smart = new ItemGrenade(-1).setUnlocalizedName("grenade_smart").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_smart"); grenade_mirv = new ItemGrenade(1).setUnlocalizedName("grenade_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mirv"); diff --git a/com/hbm/items/tool/ItemWandD.java b/com/hbm/items/tool/ItemWandD.java index 6d2f7be4b..67d35de6c 100644 --- a/com/hbm/items/tool/ItemWandD.java +++ b/com/hbm/items/tool/ItemWandD.java @@ -2,57 +2,32 @@ package com.hbm.items.tool; import java.util.List; -import com.hbm.blocks.ModBlocks; -import com.hbm.main.MainRegistry; -import com.hbm.tileentity.conductor.TileEntityPylonRedWire; +import com.hbm.lib.Library; +import com.hbm.world.generator.CellularDungeonFactory; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class ItemWandD extends Item { - - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) - { - Block b = world.getBlock(x, y, z); - - if(!world.isRemote) - { - if (b == ModBlocks.ore_aluminium) - MainRegistry.x++; - if (b == ModBlocks.block_aluminium) - MainRegistry.x--; - if (b == ModBlocks.ore_beryllium) - MainRegistry.y++; - if (b == ModBlocks.block_beryllium) - MainRegistry.y--; - if (b == ModBlocks.ore_copper) - MainRegistry.z++; - if (b == ModBlocks.block_copper) - MainRegistry.z--; - if (b == ModBlocks.red_pylon) { - TileEntityPylonRedWire te = (TileEntityPylonRedWire) world.getTileEntity(x, y, z); - for(int i = 0; i < te.connected.size(); i++) - if(world.isRemote) - player.addChatMessage(new ChatComponentText(te.connected.get(i).xCoord + " " + te.connected.get(i).yCoord + " " + te.connected.get(i).zCoord)); - } - } - - MainRegistry.time = System.currentTimeMillis(); - - return true; - } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if(player.isSneaking()) - { - if(world.isRemote) - player.addChatMessage(new ChatComponentText(MainRegistry.x + " " + MainRegistry.y + " " + MainRegistry.z)); + + if(world.isRemote) + return stack; + + MovingObjectPosition pos = Library.rayTrace(player, 500, 1); + + if(pos != null) { + + int x = pos.blockX; + int y = pos.blockY; + int z = pos.blockZ; + + CellularDungeonFactory.test.generate(world, x, y, z, world.rand); } return stack; diff --git a/com/hbm/items/tool/ItemWandS.java b/com/hbm/items/tool/ItemWandS.java index 3a6a01418..9db318929 100644 --- a/com/hbm/items/tool/ItemWandS.java +++ b/com/hbm/items/tool/ItemWandS.java @@ -3,12 +3,12 @@ package com.hbm.items.tool; import java.util.List; import java.util.Random; -import com.hbm.world.FWatz; -import com.hbm.world.FactoryAdvanced; -import com.hbm.world.FactoryTitanium; -import com.hbm.world.FusionReactor; -import com.hbm.world.NuclearReactor; -import com.hbm.world.Watz; +import com.hbm.world.machine.FWatz; +import com.hbm.world.machine.FactoryAdvanced; +import com.hbm.world.machine.FactoryTitanium; +import com.hbm.world.machine.FusionReactor; +import com.hbm.world.machine.NuclearReactor; +import com.hbm.world.machine.Watz; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; diff --git a/com/hbm/lib/HbmWorldGen.java b/com/hbm/lib/HbmWorldGen.java index 850c7d07c..d01245808 100644 --- a/com/hbm/lib/HbmWorldGen.java +++ b/com/hbm/lib/HbmWorldGen.java @@ -5,25 +5,25 @@ import java.util.Random; import com.hbm.blocks.ModBlocks; import com.hbm.main.MainRegistry; import com.hbm.tileentity.machine.TileEntitySafe; -import com.hbm.world.Antenna; -import com.hbm.world.Barrel; -import com.hbm.world.Bunker; -import com.hbm.world.CrashedVertibird; -import com.hbm.world.DesertAtom001; -import com.hbm.world.Dud; -import com.hbm.world.Factory; -import com.hbm.world.Geyser; -import com.hbm.world.GeyserLarge; -import com.hbm.world.LibraryDungeon; -import com.hbm.world.OilBubble; -import com.hbm.world.OilSandBubble; -import com.hbm.world.Radio01; -import com.hbm.world.Relay; -import com.hbm.world.Satellite; -import com.hbm.world.Sellafield; -import com.hbm.world.Silo; -import com.hbm.world.Spaceship; -import com.hbm.world.Vertibird; +import com.hbm.world.dungeon.Antenna; +import com.hbm.world.dungeon.Barrel; +import com.hbm.world.dungeon.Bunker; +import com.hbm.world.dungeon.CrashedVertibird; +import com.hbm.world.dungeon.DesertAtom001; +import com.hbm.world.dungeon.Factory; +import com.hbm.world.dungeon.LibraryDungeon; +import com.hbm.world.dungeon.Radio01; +import com.hbm.world.dungeon.Relay; +import com.hbm.world.dungeon.Satellite; +import com.hbm.world.dungeon.Silo; +import com.hbm.world.dungeon.Spaceship; +import com.hbm.world.dungeon.Vertibird; +import com.hbm.world.feature.Dud; +import com.hbm.world.feature.Geyser; +import com.hbm.world.feature.GeyserLarge; +import com.hbm.world.feature.OilBubble; +import com.hbm.world.feature.OilSandBubble; +import com.hbm.world.feature.Sellafield; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityChest; diff --git a/com/hbm/main/MainRegistry.java b/com/hbm/main/MainRegistry.java index 46bb49c67..a837d84b9 100644 --- a/com/hbm/main/MainRegistry.java +++ b/com/hbm/main/MainRegistry.java @@ -62,6 +62,7 @@ import com.hbm.tileentity.conductor.*; import com.hbm.tileentity.deco.*; import com.hbm.tileentity.machine.*; import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType; +import com.hbm.world.generator.CellularDungeonFactory; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -353,6 +354,7 @@ public class MainRegistry GameRegistry.registerFuelHandler(new FuelHandler()); HbmPotion.init(); BulletConfigSyncingUtil.loadConfigsForSync(); + CellularDungeonFactory.init(); Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8"); Library.superuser.add("5aee1e3d-3767-4987-a222-e7ce1fbdf88e"); diff --git a/com/hbm/packet/NBTPacket.java b/com/hbm/packet/NBTPacket.java index 93ae772cd..bf80ddcfa 100644 --- a/com/hbm/packet/NBTPacket.java +++ b/com/hbm/packet/NBTPacket.java @@ -69,6 +69,9 @@ public class NBTPacket implements IMessage { @Override public IMessage onMessage(NBTPacket m, MessageContext ctx) { + if(Minecraft.getMinecraft().theWorld == null) + return null; + TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z); if(!(te instanceof TileEntityMachineBase)) diff --git a/com/hbm/render/tileentity/RenderStructureMaker.java b/com/hbm/render/tileentity/RenderStructureMaker.java index 73ad4c1a3..edb145f2f 100644 --- a/com/hbm/render/tileentity/RenderStructureMaker.java +++ b/com/hbm/render/tileentity/RenderStructureMaker.java @@ -6,11 +6,11 @@ import org.lwjgl.opengl.GL14; import com.hbm.blocks.ModBlocks; import com.hbm.lib.RefStrings; import com.hbm.tileentity.machine.TileEntityStructureMarker; -import com.hbm.world.FWatz; -import com.hbm.world.FactoryTitanium; -import com.hbm.world.FusionReactor; -import com.hbm.world.NuclearReactor; -import com.hbm.world.Watz; +import com.hbm.world.machine.FWatz; +import com.hbm.world.machine.FactoryTitanium; +import com.hbm.world.machine.FusionReactor; +import com.hbm.world.machine.NuclearReactor; +import com.hbm.world.machine.Watz; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; diff --git a/com/hbm/tileentity/machine/TileEntityFWatzCore.java b/com/hbm/tileentity/machine/TileEntityFWatzCore.java index 054bf268a..36360d596 100644 --- a/com/hbm/tileentity/machine/TileEntityFWatzCore.java +++ b/com/hbm/tileentity/machine/TileEntityFWatzCore.java @@ -15,7 +15,7 @@ import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.packet.AuxElectricityPacket; import com.hbm.packet.PacketDispatcher; -import com.hbm.world.FWatz; +import com.hbm.world.machine.FWatz; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; diff --git a/com/hbm/world/Antenna.java b/com/hbm/world/dungeon/Antenna.java similarity index 97% rename from com/hbm/world/Antenna.java rename to com/hbm/world/dungeon/Antenna.java index 39b2fbf68..bbcd7a94e 100644 --- a/com/hbm/world/Antenna.java +++ b/com/hbm/world/dungeon/Antenna.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Barrel.java b/com/hbm/world/dungeon/Barrel.java similarity index 97% rename from com/hbm/world/Barrel.java rename to com/hbm/world/dungeon/Barrel.java index f0ffe7307..f3a1ec389 100644 --- a/com/hbm/world/Barrel.java +++ b/com/hbm/world/dungeon/Barrel.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Bunker.java b/com/hbm/world/dungeon/Bunker.java similarity index 98% rename from com/hbm/world/Bunker.java rename to com/hbm/world/dungeon/Bunker.java index a9d03d276..76bd369db 100644 --- a/com/hbm/world/Bunker.java +++ b/com/hbm/world/dungeon/Bunker.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/CrashedVertibird.java b/com/hbm/world/dungeon/CrashedVertibird.java similarity index 98% rename from com/hbm/world/CrashedVertibird.java rename to com/hbm/world/dungeon/CrashedVertibird.java index c88b4e3e4..0a80a5084 100644 --- a/com/hbm/world/CrashedVertibird.java +++ b/com/hbm/world/dungeon/CrashedVertibird.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/DesertAtom001.java b/com/hbm/world/dungeon/DesertAtom001.java similarity index 98% rename from com/hbm/world/DesertAtom001.java rename to com/hbm/world/dungeon/DesertAtom001.java index a4ac76069..34abf8c05 100644 --- a/com/hbm/world/DesertAtom001.java +++ b/com/hbm/world/dungeon/DesertAtom001.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/DesertAtom002.java b/com/hbm/world/dungeon/DesertAtom002.java similarity index 98% rename from com/hbm/world/DesertAtom002.java rename to com/hbm/world/dungeon/DesertAtom002.java index 80b50fe68..9358544c4 100644 --- a/com/hbm/world/DesertAtom002.java +++ b/com/hbm/world/dungeon/DesertAtom002.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/DesertAtom003.java b/com/hbm/world/dungeon/DesertAtom003.java similarity index 98% rename from com/hbm/world/DesertAtom003.java rename to com/hbm/world/dungeon/DesertAtom003.java index 018069e68..d53a8729a 100644 --- a/com/hbm/world/DesertAtom003.java +++ b/com/hbm/world/dungeon/DesertAtom003.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Factory.java b/com/hbm/world/dungeon/Factory.java similarity index 98% rename from com/hbm/world/Factory.java rename to com/hbm/world/dungeon/Factory.java index 7cc70b099..2e24d93b4 100644 --- a/com/hbm/world/Factory.java +++ b/com/hbm/world/dungeon/Factory.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/LibraryDungeon.java b/com/hbm/world/dungeon/LibraryDungeon.java similarity index 98% rename from com/hbm/world/LibraryDungeon.java rename to com/hbm/world/dungeon/LibraryDungeon.java index 7d0aab21c..9f768f35e 100644 --- a/com/hbm/world/LibraryDungeon.java +++ b/com/hbm/world/dungeon/LibraryDungeon.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; diff --git a/com/hbm/world/Radio01.java b/com/hbm/world/dungeon/Radio01.java similarity index 98% rename from com/hbm/world/Radio01.java rename to com/hbm/world/dungeon/Radio01.java index db58ff193..b6bb38130 100644 --- a/com/hbm/world/Radio01.java +++ b/com/hbm/world/dungeon/Radio01.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Radio02.java b/com/hbm/world/dungeon/Radio02.java similarity index 98% rename from com/hbm/world/Radio02.java rename to com/hbm/world/dungeon/Radio02.java index e006e2159..e4ab5eb4f 100644 --- a/com/hbm/world/Radio02.java +++ b/com/hbm/world/dungeon/Radio02.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Relay.java b/com/hbm/world/dungeon/Relay.java similarity index 98% rename from com/hbm/world/Relay.java rename to com/hbm/world/dungeon/Relay.java index 24e66c195..af4d9196f 100644 --- a/com/hbm/world/Relay.java +++ b/com/hbm/world/dungeon/Relay.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Satellite.java b/com/hbm/world/dungeon/Satellite.java similarity index 98% rename from com/hbm/world/Satellite.java rename to com/hbm/world/dungeon/Satellite.java index 4ae52acb6..5b378fd4a 100644 --- a/com/hbm/world/Satellite.java +++ b/com/hbm/world/dungeon/Satellite.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Silo.java b/com/hbm/world/dungeon/Silo.java similarity index 98% rename from com/hbm/world/Silo.java rename to com/hbm/world/dungeon/Silo.java index 739d4d3a8..4a9f8f583 100644 --- a/com/hbm/world/Silo.java +++ b/com/hbm/world/dungeon/Silo.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Spaceship.java b/com/hbm/world/dungeon/Spaceship.java similarity index 98% rename from com/hbm/world/Spaceship.java rename to com/hbm/world/dungeon/Spaceship.java index ddb985ecf..97472aa0f 100644 --- a/com/hbm/world/Spaceship.java +++ b/com/hbm/world/dungeon/Spaceship.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Spaceship2.java b/com/hbm/world/dungeon/Spaceship2.java similarity index 98% rename from com/hbm/world/Spaceship2.java rename to com/hbm/world/dungeon/Spaceship2.java index 4ff4a6d78..34d695691 100644 --- a/com/hbm/world/Spaceship2.java +++ b/com/hbm/world/dungeon/Spaceship2.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S.SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Vertibird.java b/com/hbm/world/dungeon/Vertibird.java similarity index 98% rename from com/hbm/world/Vertibird.java rename to com/hbm/world/dungeon/Vertibird.java index e763f54f4..bc153eb61 100644 --- a/com/hbm/world/Vertibird.java +++ b/com/hbm/world/dungeon/Vertibird.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.dungeon; import java.util.Random; diff --git a/com/hbm/world/Dud.java b/com/hbm/world/feature/Dud.java similarity index 94% rename from com/hbm/world/Dud.java rename to com/hbm/world/feature/Dud.java index 8333ae0fa..9ded3ccf8 100644 --- a/com/hbm/world/Dud.java +++ b/com/hbm/world/feature/Dud.java @@ -1,4 +1,4 @@ -package com.hbm.world; +package com.hbm.world.feature; import java.util.Random; diff --git a/com/hbm/world/Geyser.java b/com/hbm/world/feature/Geyser.java similarity index 97% rename from com/hbm/world/Geyser.java rename to com/hbm/world/feature/Geyser.java index 9e702f058..440616ccb 100755 --- a/com/hbm/world/Geyser.java +++ b/com/hbm/world/feature/Geyser.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.feature; import java.util.Random; diff --git a/com/hbm/world/GeyserLarge.java b/com/hbm/world/feature/GeyserLarge.java similarity index 98% rename from com/hbm/world/GeyserLarge.java rename to com/hbm/world/feature/GeyserLarge.java index be5d5b1c8..4b0976f69 100755 --- a/com/hbm/world/GeyserLarge.java +++ b/com/hbm/world/feature/GeyserLarge.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.feature; import java.util.Random; diff --git a/com/hbm/world/HugeMush.java b/com/hbm/world/feature/HugeMush.java similarity index 93% rename from com/hbm/world/HugeMush.java rename to com/hbm/world/feature/HugeMush.java index f924697b1..1f97974fe 100644 --- a/com/hbm/world/HugeMush.java +++ b/com/hbm/world/feature/HugeMush.java @@ -1,4 +1,4 @@ -package com.hbm.world; +package com.hbm.world.feature; import java.util.Random; diff --git a/com/hbm/world/Meteorite.java b/com/hbm/world/feature/Meteorite.java similarity index 99% rename from com/hbm/world/Meteorite.java rename to com/hbm/world/feature/Meteorite.java index 828f4341b..392638396 100644 --- a/com/hbm/world/Meteorite.java +++ b/com/hbm/world/feature/Meteorite.java @@ -1,4 +1,4 @@ -package com.hbm.world; +package com.hbm.world.feature; import java.util.ArrayList; import java.util.List; diff --git a/com/hbm/world/OilBubble.java b/com/hbm/world/feature/OilBubble.java similarity index 95% rename from com/hbm/world/OilBubble.java rename to com/hbm/world/feature/OilBubble.java index 102b9f8e7..e122d9d98 100644 --- a/com/hbm/world/OilBubble.java +++ b/com/hbm/world/feature/OilBubble.java @@ -1,4 +1,4 @@ -package com.hbm.world; +package com.hbm.world.feature; import com.hbm.blocks.ModBlocks; diff --git a/com/hbm/world/OilSandBubble.java b/com/hbm/world/feature/OilSandBubble.java similarity index 96% rename from com/hbm/world/OilSandBubble.java rename to com/hbm/world/feature/OilSandBubble.java index 15d8c3e08..45e5c804f 100644 --- a/com/hbm/world/OilSandBubble.java +++ b/com/hbm/world/feature/OilSandBubble.java @@ -1,4 +1,4 @@ -package com.hbm.world; +package com.hbm.world.feature; import java.util.Random; diff --git a/com/hbm/world/Sellafield.java b/com/hbm/world/feature/Sellafield.java similarity index 98% rename from com/hbm/world/Sellafield.java rename to com/hbm/world/feature/Sellafield.java index 556737816..1fc606032 100644 --- a/com/hbm/world/Sellafield.java +++ b/com/hbm/world/feature/Sellafield.java @@ -1,4 +1,4 @@ -package com.hbm.world; +package com.hbm.world.feature; import java.util.Random; diff --git a/com/hbm/world/generator/CellularDungeon.java b/com/hbm/world/generator/CellularDungeon.java new file mode 100644 index 000000000..e8c6adf7a --- /dev/null +++ b/com/hbm/world/generator/CellularDungeon.java @@ -0,0 +1,145 @@ +package com.hbm.world.generator; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class CellularDungeon { + + //a buffer "map" of the rooms being generated before being spawned in + CellularDungeonRoom[][] cells; + ForgeDirection[][] doors; + //the order in which the buffer should be processed + List order = new ArrayList(); + + //the size of the cell array x + int dimX; + //the size of the cell array z + int dimZ; + //the base width (and length) of a room + public int width; + //the height of a room + public int height; + //list of random floor blocks with equal weight + public List floor = new ArrayList(); + //list of random ceiling blocks with equal weight + public List ceiling = new ArrayList(); + //list of random wall blocks with equal weight + public List wall = new ArrayList(); + //the rooms that the dungeon can use + public List rooms = new ArrayList(); + int tries; + + public CellularDungeon(int width, int height, int dimX, int dimZ, int tries) { + + this.dimX = dimX; + this.dimZ = dimZ; + this.width = width; + this.height = height; + this.tries = tries; + } + + public CellularDungeon(int width, int height, int dimX, int dimZ, int tries, Block floor, Block ceiling, Block wall) { + + this.dimX = dimX; + this.dimZ = dimZ; + this.width = width; + this.height = height; + this.tries = tries; + this.floor.add(floor); + this.ceiling.add(ceiling); + this.wall.add(wall); + } + + public void generate(World world, int x, int y, int z, Random rand) { + + compose(rand); + + for(int[] coord : order) { + + if(coord == null || coord.length != 2) + continue; + + int dx = coord[0]; + int dz = coord[1]; + + if(cells[dx][dz] != null) { + + if(doors[dx][dz] == null) + doors[dx][dz] = ForgeDirection.UNKNOWN; + + cells[dx][dz].generate(world, x + dx * (width - 1), y, z + dz * (width - 1), doors[dx][dz]); + } + } + } + + int rec = 0; + public void compose(Random rand) { + + cells = new CellularDungeonRoom[dimX][dimZ]; + doors = new ForgeDirection[dimX][dimZ]; + order.clear(); + + int startX = dimX / 2; + int startZ = dimZ / 2; + + cells[startX][startZ] = DungeonToolbox.getRandom(rooms, rand); + doors[startX][startZ] = ForgeDirection.UNKNOWN; + order.add(new int[] { startX, startZ }); + + rec = 0; + addRoom(startX, startZ, rand, ForgeDirection.UNKNOWN, DungeonToolbox.getRandom(rooms, rand)); + } + + //if x and z are occupied, it will just use the next nearby random space + private boolean addRoom(int x, int z, Random rand, ForgeDirection door, CellularDungeonRoom room) { + + rec++; + if(rec > tries) + return false; + + if(x < 0 || z < 0 || x >= dimX || z >= dimZ) + return false; + + if(cells[x][z] != null) { + + ForgeDirection dir = getRandomDir(rand); + addRoom(x + dir.offsetX, z + dir.offsetZ, rand, dir.getOpposite(), DungeonToolbox.getRandom(rooms, rand)); + return false; + } + + //CellularDungeonRoom next = DungeonToolbox.getRandom(rooms, rand); + + if(room.daisyChain == null || addRoom(x + room.daisyDirection.offsetX, z + room.daisyDirection.offsetZ, rand, ForgeDirection.UNKNOWN, room.daisyChain)) { + cells[x][z] = room; + doors[x][z] = door; + order.add(new int[] { x, z }); + } + + //if(room.daisyChain == null) + for(int i = 0; i < 3; i++) { + ForgeDirection dir = getRandomDir(rand); + addRoom(x + dir.offsetX, z + dir.offsetZ, rand, dir.getOpposite(), DungeonToolbox.getRandom(rooms, rand)); + } + + return true; + } + + /*public boolean addDaisychain(int x, int z, Random rand, ForgeDirection door, CellularDungeonRoom room) { + + if(x < 0 || z < 0 || x >= dimX || z >= dimZ) + return false; + + if(cells[x][z] != null) + return false; + }*/ + + public static ForgeDirection getRandomDir(Random rand) { + + return ForgeDirection.getOrientation(rand.nextInt(4) + 2); + } +} diff --git a/com/hbm/world/generator/CellularDungeonFactory.java b/com/hbm/world/generator/CellularDungeonFactory.java new file mode 100644 index 000000000..bf7a2fd3a --- /dev/null +++ b/com/hbm/world/generator/CellularDungeonFactory.java @@ -0,0 +1,20 @@ +package com.hbm.world.generator; + +import com.hbm.world.generator.room.*; + +import net.minecraftforge.common.util.ForgeDirection; + +public class CellularDungeonFactory { + + public static CellularDungeon test; + + public static void init() { + + test = new TestDungeon(11, 7, 11, 11, 150); + test.rooms.add(new TestDungeonRoom1(test)); + test.rooms.add(new TestDungeonRoom2(test)); + test.rooms.add(new TestDungeonRoom3(test)); + test.rooms.add(new TestDungeonRoom4(test, new TestDungeonRoom5(test), ForgeDirection.NORTH)); + } + +} diff --git a/com/hbm/world/generator/CellularDungeonRoom.java b/com/hbm/world/generator/CellularDungeonRoom.java new file mode 100644 index 000000000..9af880dde --- /dev/null +++ b/com/hbm/world/generator/CellularDungeonRoom.java @@ -0,0 +1,67 @@ +package com.hbm.world.generator; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class CellularDungeonRoom { + + protected CellularDungeon parent; + protected CellularDungeonRoom daisyChain = null; + protected ForgeDirection daisyDirection = ForgeDirection.UNKNOWN; + + public CellularDungeonRoom(CellularDungeon parent) { + this.parent = parent; + } + + //per generation, only one door can be made. rooms having multiple doors will be the consequence of daisychaining. + //the initial room will use an invalid type to not spawn any doors. + public void generate(World world, int x, int y, int z, ForgeDirection door) { + + generateMain(world, x, y, z); + + for(int i = 2; i < 6; i++) { + ForgeDirection dir = ForgeDirection.getOrientation(i); + generateWall(world, x, y, z, dir, dir == door); + } + } + + public void generateMain(World world, int x, int y, int z) { + + DungeonToolbox.generateBox(world, x, y, z, parent.width, 1, parent.width, parent.floor); + DungeonToolbox.generateBox(world, x, y + 1, z, parent.width, parent.height - 1, parent.width, Blocks.air); + DungeonToolbox.generateBox(world, x, y + parent.height - 1, z, parent.width, 1, parent.width, parent.ceiling); + } + + public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) { + + if(wall == ForgeDirection.NORTH) { + DungeonToolbox.generateBox(world, x, y + 1, z, parent.width, parent.height - 2, 1, parent.wall); + + if(door) + DungeonToolbox.generateBox(world, x + parent.width / 2, y + 1, z, 1, 2, 1, Blocks.air); + } + + if(wall == ForgeDirection.SOUTH) { + DungeonToolbox.generateBox(world, x, y + 1, z + parent.width - 1, parent.width, parent.height - 2, 1, parent.wall); + + if(door) + DungeonToolbox.generateBox(world, x + parent.width / 2, y + 1, z + parent.width - 1, 1, 2, 1, Blocks.air); + } + + if(wall == ForgeDirection.WEST) { + DungeonToolbox.generateBox(world, x, y + 1, z, 1, parent.height - 2, parent.width, parent.wall); + + if(door) + DungeonToolbox.generateBox(world, x, y + 1, z + parent.width / 2, 1, 2, 1, Blocks.air); + } + + if(wall == ForgeDirection.EAST) { + DungeonToolbox.generateBox(world, x + parent.width - 1, y + 1, z, 1, parent.height - 2, parent.width, parent.wall); + + if(door) + DungeonToolbox.generateBox(world, x + parent.width - 1, y + 1, z + parent.width / 2, 1, 2, 1, Blocks.air); + } + } + +} diff --git a/com/hbm/world/generator/DungeonToolbox.java b/com/hbm/world/generator/DungeonToolbox.java new file mode 100644 index 000000000..58883f0b5 --- /dev/null +++ b/com/hbm/world/generator/DungeonToolbox.java @@ -0,0 +1,59 @@ +package com.hbm.world.generator; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class DungeonToolbox { + + + public static void generateBox(World world, int x, int y, int z, int sx, int sy, int sz, List blocks) { + + if(blocks.isEmpty()) + return; + + for(int i = x; i < x + sx; i++) { + + for(int j = y; j < y + sy; j++) { + + for(int k = z; k < z + sz; k++) { + + Block b = getRandom(blocks, world.rand); + world.setBlock(i, j, k, b, 0, 2); + } + } + } + } + + //i know it's copy paste, but it's a better strat than using a wrapper and generating single-entry lists for no good reason + public static void generateBox(World world, int x, int y, int z, int sx, int sy, int sz, Block block) { + + for(int i = x; i < x + sx; i++) { + + for(int j = y; j < y + sy; j++) { + + for(int k = z; k < z + sz; k++) { + + world.setBlock(i, j, k, block, 0, 2); + } + } + } + } + + //now with vectors to provide handy rotations + public static void generateBox(World world, int x, int y, int z, Vec3 size, List blocks) { + + generateBox(world, x, y, z, (int)size.xCoord, (int)size.yCoord, (int)size.zCoord, blocks); + } + + public static T getRandom(List list, Random rand) { + + if(list.isEmpty()) + return null; + + return list.get(rand.nextInt(list.size())); + } +} diff --git a/com/hbm/world/generator/TestDungeon.java b/com/hbm/world/generator/TestDungeon.java new file mode 100644 index 000000000..48eee2ae0 --- /dev/null +++ b/com/hbm/world/generator/TestDungeon.java @@ -0,0 +1,18 @@ +package com.hbm.world.generator; + +import com.hbm.blocks.ModBlocks; + +public class TestDungeon extends CellularDungeon { + + public TestDungeon(int width, int height, int dimX, int dimZ, int tries) { + super(width, height, dimX, dimZ, tries); + + this.floor.add(ModBlocks.meteor_polished); + this.wall.add(ModBlocks.meteor_brick); + this.wall.add(ModBlocks.meteor_brick); + this.wall.add(ModBlocks.meteor_brick_mossy); + this.wall.add(ModBlocks.meteor_brick_cracked); + this.ceiling.add(ModBlocks.block_meteor_broken); + } + +} diff --git a/com/hbm/world/generator/room/TestDungeonRoom1.java b/com/hbm/world/generator/room/TestDungeonRoom1.java new file mode 100644 index 000000000..905cfd9bc --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom1.java @@ -0,0 +1,31 @@ +package com.hbm.world.generator.room; + +import com.hbm.blocks.ModBlocks; +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; +import com.hbm.world.generator.DungeonToolbox; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +public class TestDungeonRoom1 extends CellularDungeonRoom { + + public TestDungeonRoom1(CellularDungeon parent) { + super(parent); + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 3, y + 1, z + parent.width / 2 - 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + DungeonToolbox.generateBox(world, x + parent.width / 2 + 3, y + 1, z + parent.width / 2 - 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + DungeonToolbox.generateBox(world, x + parent.width / 2 + 3, y + 1, z + parent.width / 2 + 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 3, y + 1, z + parent.width / 2 + 3, 1, parent.height - 2, 1, ModBlocks.meteor_pillar); + world.setBlock(x + parent.width / 2 - 3, y + 3, z + parent.width / 2 - 3, ModBlocks.meteor_brick_chiseled, 0, 2); + world.setBlock(x + parent.width / 2 + 3, y + 3, z + parent.width / 2 - 3, ModBlocks.meteor_brick_chiseled, 0, 2); + world.setBlock(x + parent.width / 2 + 3, y + 3, z + parent.width / 2 + 3, ModBlocks.meteor_brick_chiseled, 0, 2); + world.setBlock(x + parent.width / 2 - 3, y + 3, z + parent.width / 2 + 3, ModBlocks.meteor_brick_chiseled, 0, 2); + world.setBlock(x + parent.width / 2, y + 1, z + parent.width / 2, ModBlocks.meteor_pillar, 0, 2); + world.setBlock(x + parent.width / 2, y + 2, z + parent.width / 2, Blocks.glowstone, 0, 3); + } +} diff --git a/com/hbm/world/generator/room/TestDungeonRoom2.java b/com/hbm/world/generator/room/TestDungeonRoom2.java new file mode 100644 index 000000000..60c15b6e3 --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom2.java @@ -0,0 +1,34 @@ +package com.hbm.world.generator.room; + +import com.hbm.blocks.ModBlocks; +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; + +import net.minecraft.world.World; + +public class TestDungeonRoom2 extends CellularDungeonRoom { + + public TestDungeonRoom2(CellularDungeon parent) { + super(parent); + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + + int j = world.rand.nextInt(2) + 2; + int k = world.rand.nextInt(3) + 2; + + for(int i = 0; i < j; i++) { + int dx = world.rand.nextInt(parent.width - 6) + 3; + int dz = world.rand.nextInt(parent.width - 6) + 3; + world.setBlock(x + dx, y + 1, z + dz, ModBlocks.crate_ammo, 0, 2); + } + + for(int i = 0; i < k; i++) { + int dx = world.rand.nextInt(parent.width - 6) + 3; + int dz = world.rand.nextInt(parent.width - 6) + 3; + world.setBlock(x + dx, y + 1, z + dz, ModBlocks.crate_can, 0, 2); + } + } +} diff --git a/com/hbm/world/generator/room/TestDungeonRoom3.java b/com/hbm/world/generator/room/TestDungeonRoom3.java new file mode 100644 index 000000000..fd4242416 --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom3.java @@ -0,0 +1,33 @@ +package com.hbm.world.generator.room; + +import com.hbm.blocks.ModBlocks; +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; +import com.hbm.world.generator.DungeonToolbox; + +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntityMobSpawner; +import net.minecraft.world.World; + +public class TestDungeonRoom3 extends CellularDungeonRoom { + + public TestDungeonRoom3(CellularDungeon parent) { + super(parent); + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 2, y + 1, z + parent.width / 2 - 2, 5, 4, 5, ModBlocks.deco_lead); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y + 1, z + parent.width / 2 - 1, 3, 3, 3, ModBlocks.toxic_block); + DungeonToolbox.generateBox(world, x + parent.width / 2 - 1, y + 4, z + parent.width / 2 - 1, 3, 1, 3, Blocks.air); + + world.setBlock(x + parent.width / 2, y + 1, z + parent.width / 2, Blocks.mob_spawner, 0, 2); + TileEntityMobSpawner tileentitymobspawner2 = (TileEntityMobSpawner)world.getTileEntity(x + parent.width / 2, y + 1, z + parent.width / 2); + + if (tileentitymobspawner2 != null) + { + tileentitymobspawner2.func_145881_a().setEntityName("Creeper"); + } + } +} diff --git a/com/hbm/world/generator/room/TestDungeonRoom4.java b/com/hbm/world/generator/room/TestDungeonRoom4.java new file mode 100644 index 000000000..76eaba58c --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom4.java @@ -0,0 +1,32 @@ +package com.hbm.world.generator.room; + +import java.util.ArrayList; + +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; +import com.hbm.world.generator.DungeonToolbox; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class TestDungeonRoom4 extends CellularDungeonRoom { + + public TestDungeonRoom4(CellularDungeon parent, CellularDungeonRoom daisyChain, ForgeDirection dir) { + super(parent); + this.daisyChain = daisyChain; + this.daisyDirection = dir; + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + DungeonToolbox.generateBox(world, x, y + parent.height - 2, z, parent.width, 1, parent.width, new ArrayList() {{ add(Blocks.air); add(Blocks.web); }}); + } + + public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) { + + if(wall != ForgeDirection.NORTH) + super.generateWall(world, x, y, z, wall, door); + } +} \ No newline at end of file diff --git a/com/hbm/world/generator/room/TestDungeonRoom5.java b/com/hbm/world/generator/room/TestDungeonRoom5.java new file mode 100644 index 000000000..6843dae01 --- /dev/null +++ b/com/hbm/world/generator/room/TestDungeonRoom5.java @@ -0,0 +1,30 @@ +package com.hbm.world.generator.room; + +import java.util.ArrayList; + +import com.hbm.world.generator.CellularDungeon; +import com.hbm.world.generator.CellularDungeonRoom; +import com.hbm.world.generator.DungeonToolbox; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class TestDungeonRoom5 extends CellularDungeonRoom { + + public TestDungeonRoom5(CellularDungeon parent) { + super(parent); + } + + public void generateMain(World world, int x, int y, int z) { + + super.generateMain(world, x, y, z); + DungeonToolbox.generateBox(world, x, y + parent.height - 2, z, parent.width, 1, parent.width, new ArrayList() {{ add(Blocks.air); add(Blocks.web); }}); + } + + public void generateWall(World world, int x, int y, int z, ForgeDirection wall, boolean door) { + + if(wall != ForgeDirection.SOUTH) + super.generateWall(world, x, y, z, wall, door); + } +} \ No newline at end of file diff --git a/com/hbm/world/FWatz.java b/com/hbm/world/machine/FWatz.java similarity index 95% rename from com/hbm/world/FWatz.java rename to com/hbm/world/machine/FWatz.java index 138145ff5..4b500c311 100644 --- a/com/hbm/world/FWatz.java +++ b/com/hbm/world/machine/FWatz.java @@ -1,4 +1,4 @@ -package com.hbm.world; +package com.hbm.world.machine; import java.util.Random; diff --git a/com/hbm/world/FactoryAdvanced.java b/com/hbm/world/machine/FactoryAdvanced.java similarity index 95% rename from com/hbm/world/FactoryAdvanced.java rename to com/hbm/world/machine/FactoryAdvanced.java index 6eeb283f9..2c09d06c9 100644 --- a/com/hbm/world/FactoryAdvanced.java +++ b/com/hbm/world/machine/FactoryAdvanced.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.machine; import java.util.Random; diff --git a/com/hbm/world/FactoryTitanium.java b/com/hbm/world/machine/FactoryTitanium.java similarity index 95% rename from com/hbm/world/FactoryTitanium.java rename to com/hbm/world/machine/FactoryTitanium.java index 080f26e71..6d7eb00dd 100644 --- a/com/hbm/world/FactoryTitanium.java +++ b/com/hbm/world/machine/FactoryTitanium.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.machine; import java.util.Random; diff --git a/com/hbm/world/FusionReactor.java b/com/hbm/world/machine/FusionReactor.java similarity index 98% rename from com/hbm/world/FusionReactor.java rename to com/hbm/world/machine/FusionReactor.java index d944455f1..b293fe8cf 100644 --- a/com/hbm/world/FusionReactor.java +++ b/com/hbm/world/machine/FusionReactor.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.machine; import java.util.Random; diff --git a/com/hbm/world/NuclearReactor.java b/com/hbm/world/machine/NuclearReactor.java similarity index 97% rename from com/hbm/world/NuclearReactor.java rename to com/hbm/world/machine/NuclearReactor.java index bfc3107c7..c9117a619 100644 --- a/com/hbm/world/NuclearReactor.java +++ b/com/hbm/world/machine/NuclearReactor.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.machine; import java.util.Random; diff --git a/com/hbm/world/Watz.java b/com/hbm/world/machine/Watz.java similarity index 98% rename from com/hbm/world/Watz.java rename to com/hbm/world/machine/Watz.java index 158ef39c3..1fcfdafb3 100644 --- a/com/hbm/world/Watz.java +++ b/com/hbm/world/machine/Watz.java @@ -1,6 +1,6 @@ //Schematic to java Structure by jajo_11 | inspired by "MITHION'S .SCHEMATIC TO JAVA CONVERTINGTOOL" -package com.hbm.world; +package com.hbm.world.machine; import java.util.Random;