From a2d01c65688c9c52bce4c7f906b2ad374f5c4ab3 Mon Sep 17 00:00:00 2001 From: LudoCrypt <60561627+LudoCrypt@users.noreply.github.com> Date: Tue, 15 Sep 2020 14:56:30 -0500 Subject: [PATCH] 1.3.0 Update --- bin/main/assets/backrooms/lang/en_us.json | 13 +- bin/main/assets/backrooms/sounds.json | 75 +- bin/main/backrooms.mixins.json | 3 +- bin/main/fabric.mod.json | 2 +- .../ludocrypt/backrooms/BackroomsClient.class | Bin 3638 -> 4852 bytes .../backrooms/config/BackroomsConfig.class | Bin 1611 -> 1709 bytes .../backrooms/features/Level0DottedRoom.class | Bin 20535 -> 11186 bytes .../backrooms/features/Level0RedRoom.class | Bin 17488 -> 11171 bytes .../backrooms/features/Level0Room.class | Bin 10951 -> 11142 bytes .../backrooms/features/Level1Room.class | Bin 19621 -> 10103 bytes .../backrooms/features/Level3Room.class | Bin 9696 -> 9934 bytes .../features/LevelsFeatureInit.class | Bin 4216 -> 4062 bytes .../backrooms/misc/BackroomsSoundEvents.class | Bin 2606 -> 2736 bytes build.gradle | 18 +- gradle.properties | 10 +- .../ludocrypt/backrooms/BackroomsClient.java | 18 +- .../ludocrypt/backrooms/biome/BkBiomes.java | 47 +- .../backrooms/config/BackroomsConfig.java | 5 +- .../backrooms/features/Level01Roof.java | 138 ---- .../features/Level0DecrepitRoom.java | 506 +++++------- .../features/Level0DottedRedRoom.java | 507 +++++------- .../backrooms/features/Level0DottedRoom.java | 507 +++++------- .../backrooms/features/Level0RedRoom.java | 512 +++++------- .../backrooms/features/Level0Room.java | 753 ++++-------------- .../backrooms/features/Level1OffRoom.java | 499 ++++-------- .../backrooms/features/Level1Room.java | 500 ++++-------- .../backrooms/features/Level3Room.java | 12 +- .../backrooms/features/LevelsFeatureInit.java | 4 +- .../backrooms/features/RoomArchives.java | 325 ++++++++ .../backrooms/misc/BackroomsSoundEvents.java | 6 +- .../ludocrypt/backrooms/misc/BuzzHandler.java | 79 ++ .../backrooms/misc/PreInitialize.java | 12 +- .../backrooms/mixin/WorldAccessor.java | 18 + .../net/ludocrypt/imagereader/Layout.java | 252 ++++-- .../assets/backrooms/lang/en_us.json | 2 + .../resources/assets/backrooms/sounds.json | 75 +- src/main/resources/backrooms.mixins.json | 3 +- .../advancements/dottedredrooms.json | 7 +- .../backrooms/advancements/dottedrooms.json | 7 +- .../backrooms/advancements/level1off.json | 7 +- .../backrooms/advancements/level2long.json | 7 +- .../backrooms/advancements/level2messy.json | 7 +- .../data/backrooms/advancements/redrooms.json | 7 +- .../data/backrooms/dimension/level_0.json | 280 +++++++ .../layouts/{allcolors.png => guide.png} | Bin .../data/backrooms/layouts/level01_0.png | Bin 0 -> 145 bytes .../data/backrooms/layouts/level01_1.png | Bin 0 -> 146 bytes .../data/backrooms/layouts/level01_10.png | Bin 0 -> 161 bytes .../data/backrooms/layouts/level01_11.png | Bin 0 -> 162 bytes .../data/backrooms/layouts/level01_12.png | Bin 0 -> 152 bytes .../data/backrooms/layouts/level01_13.png | Bin 0 -> 152 bytes .../data/backrooms/layouts/level01_14.png | Bin 0 -> 154 bytes .../data/backrooms/layouts/level01_15.png | Bin 0 -> 154 bytes .../data/backrooms/layouts/level01_16.png | Bin 0 -> 163 bytes .../data/backrooms/layouts/level01_17.png | Bin 0 -> 162 bytes .../data/backrooms/layouts/level01_18.png | Bin 0 -> 160 bytes .../data/backrooms/layouts/level01_19.png | Bin 0 -> 160 bytes .../data/backrooms/layouts/level01_2.png | Bin 0 -> 146 bytes .../data/backrooms/layouts/level01_20.png | Bin 0 -> 160 bytes .../data/backrooms/layouts/level01_21.png | Bin 0 -> 159 bytes .../data/backrooms/layouts/level01_22.png | Bin 0 -> 161 bytes .../data/backrooms/layouts/level01_23.png | Bin 0 -> 156 bytes .../data/backrooms/layouts/level01_24.png | Bin 0 -> 160 bytes .../data/backrooms/layouts/level01_25.png | Bin 0 -> 159 bytes .../data/backrooms/layouts/level01_26.png | Bin 0 -> 155 bytes .../data/backrooms/layouts/level01_27.png | Bin 0 -> 135 bytes .../data/backrooms/layouts/level01_3.png | Bin 0 -> 148 bytes .../data/backrooms/layouts/level01_4.png | Bin 0 -> 153 bytes .../data/backrooms/layouts/level01_5.png | Bin 0 -> 151 bytes .../data/backrooms/layouts/level01_6.png | Bin 0 -> 154 bytes .../data/backrooms/layouts/level01_7.png | Bin 0 -> 154 bytes .../data/backrooms/layouts/level01_8.png | Bin 0 -> 166 bytes .../data/backrooms/layouts/level01_9.png | Bin 0 -> 163 bytes .../data/backrooms/layouts/level0_0.png | Bin 161 -> 0 bytes .../data/backrooms/layouts/level0_1.png | Bin 165 -> 0 bytes .../data/backrooms/layouts/level0_2.png | Bin 158 -> 0 bytes .../data/backrooms/layouts/level0_3.png | Bin 161 -> 0 bytes .../data/backrooms/layouts/level0_4.png | Bin 193 -> 0 bytes .../resources/data/backrooms/layouts/roof.png | Bin 184 -> 159 bytes .../data/backrooms/layouts/whiteblock.png | Bin 0 -> 135 bytes src/main/resources/fabric.mod.json | 2 +- 81 files changed, 2375 insertions(+), 2850 deletions(-) delete mode 100644 src/main/java/net/ludocrypt/backrooms/features/Level01Roof.java create mode 100644 src/main/java/net/ludocrypt/backrooms/features/RoomArchives.java create mode 100644 src/main/java/net/ludocrypt/backrooms/misc/BuzzHandler.java create mode 100644 src/main/java/net/ludocrypt/backrooms/mixin/WorldAccessor.java rename src/main/resources/data/backrooms/layouts/{allcolors.png => guide.png} (100%) create mode 100644 src/main/resources/data/backrooms/layouts/level01_0.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_1.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_10.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_11.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_12.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_13.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_14.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_15.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_16.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_17.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_18.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_19.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_2.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_20.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_21.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_22.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_23.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_24.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_25.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_26.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_27.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_3.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_4.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_5.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_6.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_7.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_8.png create mode 100644 src/main/resources/data/backrooms/layouts/level01_9.png delete mode 100644 src/main/resources/data/backrooms/layouts/level0_0.png delete mode 100644 src/main/resources/data/backrooms/layouts/level0_1.png delete mode 100644 src/main/resources/data/backrooms/layouts/level0_2.png delete mode 100644 src/main/resources/data/backrooms/layouts/level0_3.png delete mode 100644 src/main/resources/data/backrooms/layouts/level0_4.png create mode 100644 src/main/resources/data/backrooms/layouts/whiteblock.png diff --git a/bin/main/assets/backrooms/lang/en_us.json b/bin/main/assets/backrooms/lang/en_us.json index 939a1bc..db73912 100644 --- a/bin/main/assets/backrooms/lang/en_us.json +++ b/bin/main/assets/backrooms/lang/en_us.json @@ -58,11 +58,16 @@ "block.backrooms.dotted_red_torn_wallpaper": "Torn Dotted Red Wallpaper", "block.backrooms.vent": "Vent", "biome.backrooms.level0": "Level 0", + "biome.backrooms.level0decrepit": "Level 0 Decrepit", + "biome.backrooms.level0dotted": "Level 0 Dotted", + "biome.backrooms.level0red": "Level 0 Red", + "biome.backrooms.level0dottedred": "Level 0 Dotted Red", "biome.backrooms.level1": "Level 1", + "biome.backrooms.level1off": "Level 1 Off", "biome.backrooms.level2": "Level 2", + "biome.backrooms.level2long": "Level 2 Long", + "biome.backrooms.level2messy": "Level 2 Messy", "biome.backrooms.level3": "Level 3", - "biome.backrooms.level0red": "The Redrooms", - "biome.backrooms.level0dotted": "Level 0 Dotted", "block.buzz": "Buzz", "music.general.menu": "Backrooms Menu", "menu.switch": "§cSwitch", @@ -131,17 +136,19 @@ "text.autoconfig.backrooms.title": "Backrooms Configurations", "text.autoconfig.backrooms.option.Level0DoorChance": "Chance for door to appear in level 0", "text.autoconfig.backrooms.option.Level1DoorChance": "Chance for door to appear in level 1", + "text.autoconfig.backrooms.option.Level3DoorChance": "Chance for door to appear in level 3", "text.autoconfig.backrooms.option.Level0LayerCount": "How many Layers in level 0", "text.autoconfig.backrooms.option.Level1LayerCount": "How many Layers in level 1", "text.autoconfig.backrooms.option.VBDoor": "Chance for the void block to appear in a door", "text.autoconfig.backrooms.option.EnderPearlChance": "Chance for an enderpearl", "text.autoconfig.backrooms.option.SuffocationChance": "Chance for suffocation", "text.autoconfig.backrooms.option.ChestSpawnChance": "Chance for a chest to spawn", + "text.autoconfig.backrooms.option.SearchRange": "Search Range For Noise Making Blocks", "text.autoconfig.backrooms.option.ForceLevel0": "Forces title screen to stay as Level 0", "text.autoconfig.backrooms.option.ForceLevel1": "Forces title screen to stay as Level 1", "text.autoconfig.backrooms.option.ForceLevel2": "Forces title screen to stay as Level 2", "text.autoconfig.backrooms.option.ForceLevel3": "Forces title screen to stay as Level 3", "text.autoconfig.backrooms.option.ForceNormal": "Forces title screen to stay as it should be", - "text.autoconfig.backrooms.option.SanityEffects": "Sanity Effects", + "text.autoconfig.backrooms.option.SanityEffects": "(Currently not in use) Sanity Effects", "text.autoconfig.backrooms.option.TallDoors": "Have doors be ever so slightly taller" } diff --git a/bin/main/assets/backrooms/sounds.json b/bin/main/assets/backrooms/sounds.json index 5cc3b0e..e701dcb 100644 --- a/bin/main/assets/backrooms/sounds.json +++ b/bin/main/assets/backrooms/sounds.json @@ -248,81 +248,80 @@ } ] }, - "buzz": { + "humm_buzz": { "sounds": [ { - "name": "backrooms:buzz" - } - ] - }, - "gulp": { - "sounds": [ + "name": "backrooms:level_noise/buzz1" + }, { - "name": "backrooms:gulp/gulp1" + "name": "backrooms:level_noise/buzz2" }, { - "name": "backrooms:gulp/gulp2" + "name": "backrooms:level_noise/buzz3" }, { - "name": "backrooms:gulp/gulp3" + "name": "backrooms:level_noise/buzz4" } ] }, - "level.0.ambience": { + "humm_buzz_around": { "sounds": [ { - "name": "backrooms:ambient/breath1" + "name": "backrooms:level_noise/buzz_around1" }, { - "name": "backrooms:ambient/breath2" + "name": "backrooms:level_noise/buzz_around2" }, { - "name": "backrooms:ambient/breath3" + "name": "backrooms:level_noise/buzz_around3" }, { - "name": "backrooms:ambient/breath4" - }, - { - "name": "backrooms:ambient/harp1" - }, - { - "name": "backrooms:ambient/harp2" - }, - { - "name": "backrooms:ambient/harp3" - }, + "name": "backrooms:level_noise/buzz_around4" + } + ] + }, + "vent": { + "sounds": [ { - "name": "backrooms:ambient/knock1" + "name": "backrooms:level_noise/vent1" }, { - "name": "backrooms:ambient/knock2" + "name": "backrooms:level_noise/vent2" }, { - "name": "backrooms:ambient/knock3" + "name": "backrooms:level_noise/vent3" }, { - "name": "backrooms:ambient/synth1" - }, + "name": "backrooms:level_noise/vent4" + } + ] + }, + "sizzle": { + "sounds": [ { - "name": "backrooms:ambient/synth2" + "name": "backrooms:level_noise/sizzle1" }, { - "name": "backrooms:ambient/synth3" + "name": "backrooms:level_noise/sizzle2" }, { - "name": "backrooms:ambient/tone1" + "name": "backrooms:level_noise/sizzle3" }, { - "name": "backrooms:ambient/tone2" - }, + "name": "backrooms:level_noise/sizzle4" + } + ] + }, + "gulp": { + "sounds": [ { - "name": "backrooms:ambient/tone3" + "name": "backrooms:gulp/gulp1" }, { - "name": "backrooms:ambient/tone4" + "name": "backrooms:gulp/gulp2" }, { - "name": "backrooms:ambient/whistle1" + "name": "backrooms:gulp/gulp3" } ] } diff --git a/bin/main/backrooms.mixins.json b/bin/main/backrooms.mixins.json index 8e51f94..68efe34 100644 --- a/bin/main/backrooms.mixins.json +++ b/bin/main/backrooms.mixins.json @@ -10,7 +10,8 @@ "client": [ "BuiltinModelItemRendererMixin", "MusicMixin", - "TitleScreenMixin" + "TitleScreenMixin", + "WorldAccessor" ], "injectors": { "defaultRequire": 1 diff --git a/bin/main/fabric.mod.json b/bin/main/fabric.mod.json index f205f76..8d9f6c1 100644 --- a/bin/main/fabric.mod.json +++ b/bin/main/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "backrooms", - "version": "1.2.2", + "version": "$version", "name": "The Backrooms", "description": "The backrooms, endless mono yellow rooms to traverse.", "authors": [ diff --git a/bin/main/net/ludocrypt/backrooms/BackroomsClient.class b/bin/main/net/ludocrypt/backrooms/BackroomsClient.class index faebd68537d1d56ef9887399b326a83946ac80a0..8ae4b04f918671e9b152f4de040fb9d0e77bc796 100644 GIT binary patch delta 1566 zcma)6OIKS}6#h;^a=FP(NvVWT%1Z(yp(TW(ZH-DHr7Z%bK!o}#UXn{1l3ZvKs6{Qc zT3@yGaeQmFzUr&XCDet5fiiO7PjESK>fGhPfx6F4kjKcu$=PS`?|k2WoSUUxe>6CM z{(I#I0PVOT!NkzSPutvl+A1#ugC@I-MtCJOF?8`OmYNQ2R?~BVRANGlo{groz-%xO zP9?|}Nko&~BA8X+gP&phaHMl6G8XRZ={^=2i}Zwh85;OyONB4bVSq!WVA!o-4_X-P zQ~GdD%@|Y+$Gtv6*B~0e-JqplFWMQ3Gg>^6&1o5iGH>6c zI;#d!svZvvj8AIO93L}{SMJAM5)LppjOa`*kqY#y(+WbkoBwM1vv@xaDd@&w{);)t zj^0#?+)VC8zl1)9ev<9CC^&`zK5rS52Qe&Rh{40XRuB0jxSu<%9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_jfsDN z%t;R(NjzxuFi|`h&yslYV4@fNBgX1(qn*sFdR^1~s%t}DH)g;5{`d*N02WrW-*U|p z(W7X&KVPlZMk?i%#c1_s!SjkyxwcrDF0U-b?bg$Jr(iesIN_`3YQ4z7!T~`Vu40D- z8Dtgf5_o2>TOi0f;U))hDe;(~(TKf*Cb&-c?D4PBH~teP_6xQe@uZ+xiR=GIohk`( zMm-~FF|*DITH&j+pRDkZsp>&hCT1ytrCO+1ch*&SreG@U{b`*Hgg&?V%OaA&0)cV zc>@t~fp7q z9bz0qw)jdbPvxMM6N+&*{hZ1W=aJ+jrg^aiUTu|E+kzLv+(CLhj9`>cKAw>LT|KNS pKxWXm#rPd&4LriQ`t!0>y-ZDUsoQ0RD_9M%Naykz|LZ&0_yMz}P?!J! diff --git a/bin/main/net/ludocrypt/backrooms/features/Level0DottedRoom.class b/bin/main/net/ludocrypt/backrooms/features/Level0DottedRoom.class index 5b222446b723582e2a04ebfde31a8921417f4469..dc7a9802d549a9baf83be9861c042e63da8f60b8 100644 GIT binary patch literal 11186 zcmd5?34D~*wf~=QnaLy{W>}&Iltod(5{JD?D3Fa12nmuHHWi0tLPjPtab^M{tzyO2 zx-V71-BzVqZFSIyT`aFwYnSJ3yW|GV#gg)Q<{oV)P+ z0^gd-hK5y@t7=yZCN>O2u_+R3+Y+c!zs<>DGE^b(R9CKERofzPRyH-%tlOAr7B)AX z)v|13OMOGFps=xNb+%!-FuS3?ZW-s9mGxZ7u3lE#%vND*Q+>_Gs)nZO6#{=t)9S{J zS$Z~-!d%eoe9)YH&|HDlTH8qcc5{nfudpGwJ=T*+8C4){NF-s%l zyP#lUTO=F}Cl`?$Wm8)@uR7Kq@?kPg_2Lx4q@m8gDkBLFrl5=)scC9ysjcZ_nPA+| zM_5saX_(=~bV2Em=j@;yrwNKThmtj+j$ltDsZU;TQrXm@QM=ONgJ7luFACINW;^hq zOu^==8e#Ksx)&c3oHEq@w7ew()xmgoDCyt~EFjagoC!|LSv{cyGSD55b%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cw9EKITPrELs(lz~`C+Zpo8UC3z|_9e#3eMc`k2%W=lI!?`!{|=x~Ie=--|IEyT z7)P0znV-W}G7nHbhhq=m?yMM`pPAX$KKXN`eU9F~sl0Fbj>LChRJV&o{E v*ZLDQV>jI-_QlR^Fhg+3A%5#hrJKbwy2ZJ7MYqyzoEH}}d-2`&+u`{a%*TdD diff --git a/bin/main/net/ludocrypt/backrooms/features/Level0RedRoom.class b/bin/main/net/ludocrypt/backrooms/features/Level0RedRoom.class index 0c5823d0772c756d090e1b9dee3bf7b5ae3fa6d5..c341ff4b5bbbf5d0773b1eb53d0141cc3cd5155e 100644 GIT binary patch literal 11171 zcmd5?33yw@wf@gtB+I_R%3{C?WPw1O#VC6rPLp_xLLu8UpPKby2H^>dpy{g3~Z0ZBOQS)p=ke{z;bu4!0w2};&TMDLEu|k z+0d}2a!qZsU~`_1lsRCPNhhPjzMUn%Y)@v%0CFX8orAW?@UyS*9B|Fpd6=BpZE z3vs#^9}t`}+~%~fB?8sKcuy$l;0!Dx$Fz`99dcGrC}|Az#A7|7cydReDi(``g3&eU zHut(1OT74?V6;AIeQ@bP4whn>z`HFN=?yjUw2m#?Fg@#h)5D0P3N>C-3nmWBFTHaI zwOGzG+#XJL3C=7#I;j~NvzDxmb@v40!Of9SMK&c(o6irmCo2>aS2!qi8N1TKD8<+Y zGZOYr=7^8;%X|(}!lXdeM>=%>f&uRj50d z>mbdT~+ua0j^U zn&S}1Qccuytvh@Hec*;?D&&{S7fTceow5w%rr zdMb8180|9RqpGH1S2(y**_|=U?hH28K3t7!y|_j&Yb1$`#iMJ3kw{OF%In}dTu)wU zWDT`#wGDz9Ia|r$6%BBPRfV__H+yl@AVp7GXr<`4DD|$-R;qsUtu}j`gE4Ajf;|q# zy0tqTjB{&uIVf?reUF1G1_z5A&-XO}I81M{>^ z`@DnWP*8v`(ilf{Ff+%Crx}C{mY;BUknT1V>wj~)4N4Hee*K0Bd;;Z~c`YrK5kf7w`8xD>~sj7X`!3iiW zz_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y0} P&tGuxuHzUjhv)wQx+3;k diff --git a/bin/main/net/ludocrypt/backrooms/features/Level0Room.class b/bin/main/net/ludocrypt/backrooms/features/Level0Room.class index efc024d8e8c6ce62a2d53e78191b1f812babe01c..f742b14dd2fe5ce1cc86e0a09556226fb64dfc92 100644 GIT binary patch literal 11142 zcmd5?34D~*wf~=QnaL!dW>}&Iltobj7=~R-C=jwhAdpC6*sM5A1~M|4i8B*6t7660 zy6>WO!Me~ztqvNoT5A_uTl>^jt9I9J*4jm@?P~#j?|<(%Gf8F=VxRB*e(ww4oO{pR z&OP^R_k4W+gRedbV3yqDg&~*{3#S6n?)G>nvAru5*boeDPQ>G#$-u^NFx8z1Cj*V) zE#c_2l|*`B2_~umosn2Lln8E21-8Z$(e}Wma4b6@Q11>D*zNInV!A-q3Vf@o8ylOe zo9k8z#x?ezVnZ|@+8kJ7ZTVUvn_`-+ z0=fgUomO$sa;XMhJXe( zad=X5H1=7tCf?ZkgCi7UmtnaVje-+~U}tM2 z8g{S(O;pwT>Y9cXiv`mTPhxE(!F40?UVi#;8d|)do@!C-wJBOKyHwOR-CRB zP3b@B%Uf%J5!~T2ta7kgow%okBsSKmO|NxOqBeaR&T#MvJ*l=Ms%^ak$88Hb*r3|1 zy6Toz)zq#yq=j&!gCkub>`*1*&PLRW&4N*b9%<4+sXHd7N_tF}1HZy0kn$oqh(OeI zgp(<48Xa_F3r(3eY3p0pG*ddJ4V!AQ6CIR|C# zmTz-#l*@)YR7tbpP6wY?Y&gPocI&lIY4PE1rIYv2S`ER4oY|)Rh$NC~;9dt`P(ouZ zscx+I;Y+yBi!UEm0JNwr2}UX8_u~O7&Z4H))~4l$mxSCPO2XZE(7{7$QM+Xc{k;$S z@Q4==3nmPt9j@4Eid#B(d=7f>D1BE;>&j}^lb@7#c6~*#cbv9ok2yFRMMZd=hB&ID zmg!!6jR8l0&P6(dbgkiFdpHqrU28F(z}Fo-h4I|+Jnb|U>YEO}g>O@wqjcXHCoE{F zXy{{QTT+QgY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r^__XxJmt2$ z&TN7CSfC263Z5h2fHMtwYQW0jJ^>f00`byp zO6AzH`5J);=3*K$6;}?%Nmhu)s7@d(+9~0H1(xYk!Uhe*cWf1srm&x6g|Q)?LSe9qy%QEM~)TF zL4g6xQQsV;{0z>yaF*$R=XWh|2%N_S6?Cq)Uu5vApyjo>a7jIPX8VS5g+^UvNYAV6 zi1tVQUD0@}zpgjg9&atlZ*XG>*C}yB{cz@{oq?hwaZCAJPg#cg;(9okNek2`FB7v2 zZTc+C#vHvcFTfUR(la9GzDCw7ER?y1`ErrrV(B+5lFJO2%aw+!Wr^WBS!!4&HyH-x zX2Y#=yJ1yK)|i)|tTPPBoraBax8YtHF^tM)!PK{B1-?i#*ssA*g)>O8;?#zsrX84)Y0GQg z!+rU|s_pjPDlR2z!i`DYL&_b$DHAo2c7e2Q=M@x^3C^R(#DJR`a_&jv)V{x~oC zH7|dkkC*Z6J7yM@yEX|6 VMHDUguVpS?;+3iyc&%e^{sE;Q!ax83 diff --git a/build.gradle b/build.gradle index a00fa95..dca895e 100644 --- a/build.gradle +++ b/build.gradle @@ -27,19 +27,19 @@ repositories { dependencies { - minecraft "com.mojang:minecraft:1.16.2" - mappings "net.fabricmc:yarn:1.16.2+build.9:v2" - modImplementation "net.fabricmc:fabric-loader:0.9.1+build.205" - modImplementation "net.fabricmc.fabric-api:fabric-api:0.17.2+build.396-1.16" - modApi("me.shedaniel.cloth:config-2:4.7.0-unstable") { + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modApi("me.shedaniel.cloth:config-2:4.8.1") { exclude(group: "net.fabricmc.fabric-api") } - include "me.shedaniel.cloth:config-2:4.7.0-unstable" - modApi "me.sargunvohra.mcmods:autoconfig1u:3.2.0-unstable" - include "me.sargunvohra.mcmods:autoconfig1u:3.2.0-unstable" + include "me.shedaniel.cloth:config-2:4.8.1" + modApi "me.sargunvohra.mcmods:autoconfig1u:3.2.2" + include "me.sargunvohra.mcmods:autoconfig1u:3.2.2" modImplementation "io.github.prospector:modmenu:1.14.6+build.31" include(modImplementation('com.github.Chocohead:Fabric-ASM:v2.1')) - include(modImplementation('com.github.rdvdev2:DisableCustomWorldsAdvice:v1.0')) + modImplementation 'com.github.grondag:darkness:1.16-SNAPSHOT' } processResources { diff --git a/gradle.properties b/gradle.properties index f07567b..ee84eee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,11 @@ org.gradle.jvmargs=-Xmx2G -mod_version = 1.2.3 +mod_version = 1.3.0 maven_group = net.ludocrypt archives_base_name = the-backrooms -minecraft_version=1.16.2 -yarn_mappings=1.16.2+build.9 -loader_version=0.9.1+build.205 -fabric_version=0.17.2+build.396-1.16 +minecraft_version=1.16.3 +yarn_mappings=1.16.3+build.7 +loader_version=0.9.3+build.207 +fabric_version=0.20.2+build.402-1.16 diff --git a/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java b/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java index 83940b7..def62dd 100644 --- a/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java +++ b/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java @@ -7,10 +7,13 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegistry; import net.ludocrypt.backrooms.client.render.block.entity.VoidBlockEntityRenderer; +import net.ludocrypt.backrooms.misc.BuzzHandler; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher; import net.minecraft.client.render.block.entity.BlockEntityRenderer; @@ -24,7 +27,8 @@ public class BackroomsClient implements ClientModInitializer { @Override public void onInitializeClient() { registerBlockEntityRenderer("void_block", VoidBlockEntityRenderer::new); - + ClientTickEvents.START_CLIENT_TICK.register(BackroomsClient::clientTickEvent); + } public static void putItemRenderLayer(Item item, RenderLayer layer) { @@ -38,9 +42,15 @@ public static RenderLayer getItemRenderLayer(Item item) { @SuppressWarnings("unchecked") private void registerBlockEntityRenderer(String identifier, Function> blockEntityRenderer) { - BlockEntityRendererRegistry.INSTANCE.register((BlockEntityType) Registry.BLOCK_ENTITY_TYPE.get(Backrooms.getId(identifier)), blockEntityRenderer); + BlockEntityRendererRegistry.INSTANCE.register( + (BlockEntityType) Registry.BLOCK_ENTITY_TYPE.get(Backrooms.getId(identifier)), blockEntityRenderer); + } + + public static void clientTickEvent(MinecraftClient minecraft) { + if (minecraft.world != null) { + BuzzHandler.buzzCheckingAndRunning(minecraft.gameRenderer.getCamera(), minecraft, minecraft.worldRenderer, + minecraft.world); + } } - - } diff --git a/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java b/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java index 32b7405..3b53d3e 100644 --- a/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java +++ b/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java @@ -27,10 +27,7 @@ public static Biome Level0() { .surfaceBuilder(ConfiguratedSurfaceBuilders.LEVELBUILDER) .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL0ROOM.configure(FeatureConfig.DEFAULT) - .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT))) - .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, - LevelsFeatureInit.LEVEL01ROOF.configure(FeatureConfig.DEFAULT) - .decorate(LevelsFeatureInit.LEVEL01ROOFDECORATOR.configure(DecoratorConfig.DEFAULT))); + .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT))); return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")).depth(0F) .scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(14402413).waterFogColor(14402413).fogColor(14402413) @@ -48,8 +45,8 @@ public static Biome Level0Decrepit() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL0DECREPITROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(14402413).waterFogColor(14402413).fogColor(14402413) .skyColor(14402413).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL0WEIGHTEDMUSIC)) .build()) @@ -63,8 +60,8 @@ public static Biome Level0Dotted() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL0DOTTEDROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(14402413).waterFogColor(14402413).fogColor(14402413) .skyColor(14402413).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL0MUSIC)) .build()) @@ -78,8 +75,8 @@ public static Biome Level0DottedRed() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL0DOTTEDREDROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(14402413).waterFogColor(14402413).fogColor(-5171911) .skyColor(-5171911).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL0WEIGHTEDMUSIC)) .build()) @@ -95,8 +92,8 @@ public static Biome Level0Red() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL0REDROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level0")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(14402413).waterFogColor(14402413).fogColor(-5171911) .skyColor(-5171911).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL0WEIGHTEDMUSIC)) .build()) @@ -113,8 +110,8 @@ public static Biome Level1() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL1ROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL1DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level1")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level1")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(-6710887).waterFogColor(-6710887).fogColor(-6710887) .skyColor(-6710887).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL1ONMUSIC)) .build()) @@ -131,8 +128,8 @@ public static Biome Level1Off() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL1OFFROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL1DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level1")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level1")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(-6710887).waterFogColor(-6710887).fogColor(-6710887) .skyColor(-6710887).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL1OFFMUSIC)) .build()) @@ -150,8 +147,8 @@ public static Biome Level2() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL2ROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL2DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level2")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level2")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(-6710887).waterFogColor(-6710887).fogColor(-6710887) .skyColor(-6710887).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL2MUSIC)) .build()) @@ -169,8 +166,8 @@ public static Biome Level2Long() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL2LONGROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL2DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level2")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level2")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(-6710887).waterFogColor(-6710887).fogColor(-6710887) .skyColor(-6710887).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL2LONGMUSIC)) .build()) @@ -188,14 +185,14 @@ public static Biome Level2Messy() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL2MESSYROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL2DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level2")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level2")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(-6710887).waterFogColor(-6710887).fogColor(-6710887) .skyColor(-6710887).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL2MESSYMUSIC)) .build()) .spawnSettings(spawnSettings).generationSettings(builder.build()).build(); } - + public static Biome Level3() { SpawnSettings spawnSettings = (new SpawnSettings.Builder()) .spawn(SpawnGroup.AMBIENT, new SpawnSettings.SpawnEntry(EntityType.ENDERMAN, 2, 0, 2)) @@ -207,8 +204,8 @@ public static Biome Level3() { .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS, LevelsFeatureInit.LEVEL3ROOM.configure(FeatureConfig.DEFAULT) .decorate(LevelsFeatureInit.LEVEL3DECORATOR.configure(DecoratorConfig.DEFAULT))); - return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level3")).depth(0F) - .scale(0F).temperature(1.0F).downfall(0.0F) + return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.valueOf("level3")) + .depth(0F).scale(0F).temperature(1.0F).downfall(0.0F) .effects((new BiomeEffects.Builder()).waterColor(-6710887).waterFogColor(-6710887).fogColor(-6710887) .skyColor(-6710887).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL3MUSIC)) .build()) diff --git a/src/main/java/net/ludocrypt/backrooms/config/BackroomsConfig.java b/src/main/java/net/ludocrypt/backrooms/config/BackroomsConfig.java index dbcfded..c0e2125 100644 --- a/src/main/java/net/ludocrypt/backrooms/config/BackroomsConfig.java +++ b/src/main/java/net/ludocrypt/backrooms/config/BackroomsConfig.java @@ -12,19 +12,22 @@ public class BackroomsConfig implements ConfigData { public double Level1DoorChance = 0.05; public int Level1LayerCount = 3; + + public double Level3DoorChance = 0.5; public double VBDoor = 0.05; public double EnderPearlChance = 0.01; public double SuffocationChance = 0.01; public double ChestSpawnChance = 0.1; + public int SearchRange = 5; public boolean TallDoors = true; public boolean ForceLevel0 = false; public boolean ForceLevel1 = false; public boolean ForceLevel2 = false; public boolean ForceLevel3 = false; public boolean ForceNormal = false; - public boolean SanityEffects = true; + public boolean SanityEffects = false; public static BackroomsConfig getInstance() { return AutoConfig.getConfigHolder(BackroomsConfig.class).getConfig(); diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level01Roof.java b/src/main/java/net/ludocrypt/backrooms/features/Level01Roof.java deleted file mode 100644 index fcc1e84..0000000 --- a/src/main/java/net/ludocrypt/backrooms/features/Level01Roof.java +++ /dev/null @@ -1,138 +0,0 @@ -package net.ludocrypt.backrooms.features; - -import java.util.Random; - -import com.mojang.serialization.Codec; - -import net.ludocrypt.backrooms.Backrooms; -import net.ludocrypt.backrooms.blocks.Carpet; -import net.ludocrypt.backrooms.blocks.Tile; -import net.ludocrypt.backrooms.config.BackroomsConfig; -import net.ludocrypt.imagereader.Layout; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.ChestBlock; -import net.minecraft.block.entity.LootableContainerBlockEntity; -import net.minecraft.block.enums.ChestType; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.ServerWorldAccess; -import net.minecraft.world.StructureWorldAccess; -import net.minecraft.world.gen.chunk.ChunkGenerator; -import net.minecraft.world.gen.feature.DefaultFeatureConfig; -import net.minecraft.world.gen.feature.Feature; - -public class Level01Roof extends Feature { - public Level01Roof(Codec configFactory) { - super(configFactory); - } - - private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) - .with(Tile.SINGLE, false); - private static final BlockState NORTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.NORTH) - .with(Tile.SINGLE, false); - private static final BlockState TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.EAST) - .with(Tile.SINGLE, true); - private static final BlockState LIGHT = Backrooms.LIGHT.getDefaultState(); - private static final BlockState VENT = Backrooms.VENT.getDefaultState(); - private static final BlockState AIR = Blocks.AIR.getDefaultState(); - private static final BlockState CARPET = Backrooms.CARPET.getDefaultState(); - private static final BlockState MOLDY_CARPET = Backrooms.CARPET.getDefaultState().with(Carpet.MOLDY, true); - private static final BlockState CHEST = Blocks.CHEST.getDefaultState().with(ChestBlock.CHEST_TYPE, ChestType.SINGLE) - .with(ChestBlock.FACING, Direction.NORTH).with(ChestBlock.WATERLOGGED, false); - - Integer[][] Roof = Layout.getLayout("roof", 0, 0, 1, 0, 3, 4, 2, 0, 0, 0); - Integer[][] air = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - - }; - - public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, - DefaultFeatureConfig featureConfig) { - BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); - - generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), air, rand); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), air, rand); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), air, rand); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), air, rand); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), carpet, rand); - - return true; - - } - - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { - - BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), - centerPos.getZ()); - for (int x = 0; x < slice.length; x++) { - for (int z = 0; z < slice[0].length; z++) { - int sliceBlock = slice[x][z]; - if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) - || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) - && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { - switch (sliceBlock) { - case 0: - break; - case 1: - world.setBlockState(currentPosition, SOUTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 2: - world.setBlockState(currentPosition, NORTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 3: - world.setBlockState(currentPosition, TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 4: - world.setBlockState(currentPosition, LIGHT, 2); - break; - case 5: - if (rand.nextDouble() < 0.01) { - world.setBlockState(currentPosition, MOLDY_CARPET, 2); - } else { - world.setBlockState(currentPosition, CARPET, 2); - } - if (rand.nextDouble() < 0.001) { - if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { - world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); - LootableContainerBlockEntity.setLootTable(world, rand, currentPosition.add(0, 1, 0), - Backrooms.LEVEL0CHEST); - } - } - break; - } - } - currentPosition.move(Direction.SOUTH); - } - currentPosition.move(-1, 0, -slice[0].length); - } - } -} \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level0DecrepitRoom.java b/src/main/java/net/ludocrypt/backrooms/features/Level0DecrepitRoom.java index 8ecf898..326db74 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level0DecrepitRoom.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level0DecrepitRoom.java @@ -1,5 +1,6 @@ package net.ludocrypt.backrooms.features; +import java.util.List; import java.util.Random; import com.mojang.serialization.Codec; @@ -11,6 +12,7 @@ import net.ludocrypt.backrooms.blocks.Tile; import net.ludocrypt.backrooms.blocks.TornWallpaper; import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.ludocrypt.imagereader.Layout; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.ChestBlock; @@ -31,92 +33,10 @@ public Level0DecrepitRoom(Codec configFactory) { super(configFactory); } - public static boolean door1 = true; - public static boolean door2 = true; - public static boolean door3 = true; - public static boolean door4 = true; - - private int[][] One = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Two = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Three = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Four = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 9, 5, 9, 5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] OneNoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] TwoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1NoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12,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 1, 1, 1, 1 } }; - private int[][] Hallway2NoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1Light = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 1, 10, 4, 4, 4, 4, 4, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1NoLight = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 1, 10, 4, 4, 4, 4, 4, 3, 3, 2, 11 }, { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - - private int[][] StairWall = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + private boolean door1 = true; private static final BlockState WALLPAPER = Backrooms.WALLPAPER.getDefaultState(); private static final BlockState CARPET = Backrooms.CARPET.getDefaultState(); - private static final BlockState CARPET_STAIRS = Backrooms.CARPET_STAIRS.getDefaultState() - .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) - .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); private static final BlockState MOLDY_CARPET = Backrooms.CARPET.getDefaultState().with(Carpet.MOLDY, true); private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) .with(Tile.SINGLE, false); @@ -138,175 +58,136 @@ public Level0DecrepitRoom(Codec configFactory) { private static final BlockState TORN_WALLPAPER_4 = Backrooms.TORN_WALLPAPER.getDefaultState() .with(TornWallpaper.TORN_LEVEL, 4); private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + private static final BlockState STAIR = Backrooms.CARPET_STAIRS.getDefaultState() + .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) + .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + + private static List LayoutsTop = Layout.listLayouts(27, "level01", 1, 0, new Layout()); + private static List LayoutsBottom = Layout.listLayouts(27, "level01", 2, 0, new Layout()); + private static Integer[][] Roof = Layout.getColoredLayout("roof", 0, 0, 3, 0, 6, 5, 4, 0, 0, 0, new Layout()); + private static Integer[][] Floor = Layout.getLayout("whiteblock", 0, 7, new Layout()); public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, DefaultFeatureConfig featureConfig) { - - Random generator = new Random(world.getSeed()); - long seed = world.getSeed(); - long l = generator.nextLong(); - long m = generator.nextLong(); - long n = generator.nextLong(); - long o = position.getX() * l ^ position.getY() * m ^ position.getZ() * n ^ seed; - generator = new Random(o); BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); + int layoutInt = 0; - if (generator.nextDouble() < 0.7) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); - } else if (generator.nextDouble() < 0.8) { - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall1, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall2, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + if (rand.nextDouble() < 0.7) { + layoutInt = 0; + } else if (rand.nextDouble() < 0.8) { + int k = rand.nextInt(9); + switch (k) { + case 0: + layoutInt = 8; + break; + case 1: + layoutInt = 9; + break; + case 2: + layoutInt = 10; + break; + case 3: + layoutInt = 11; + break; + case 4: + layoutInt = 17; + break; + case 5: + layoutInt = 18; + break; + case 6: + layoutInt = 19; + break; + case 7: + layoutInt = 20; + break; + case 8: + layoutInt = 25; + break; + case 9: + layoutInt = 26; + break; + } + } else { + if (rand.nextDouble() < 0.5) { + layoutInt = 100; } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + layoutInt = rand.nextInt(27); } - } else if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + } + + if (layoutInt == 100) { + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.One, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Four, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, false); } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); + Integer[][] layoutTop = LayoutsTop.get(layoutInt); + Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); + + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Floor, rand); } return true; } - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand) { + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { - BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, slice[0].length)); - BlockPos.Mutable currentPosition = new BlockPos.Mutable(currentPositionOffsetted.getX(), - currentPositionOffsetted.getY(), currentPositionOffsetted.getZ()); + BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), + centerPos.getZ()); - for (int y = 0; y < slice.length; y++) { + for (int x = 0; x < slice.length; x++) { for (int z = 0; z < slice[0].length; z++) { - int sliceBlock = slice[y][z]; + int sliceBlock = slice[x][z]; if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { - - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DecrepitRoom.door1 = true; - } else { - Level0DecrepitRoom.door1 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DecrepitRoom.door2 = true; - } else { - Level0DecrepitRoom.door2 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DecrepitRoom.door3 = true; - } else { - Level0DecrepitRoom.door3 = false; - } if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DecrepitRoom.door4 = true; + door1 = true; } else { - Level0DecrepitRoom.door4 = false; + door1 = false; } switch (sliceBlock) { case 0: - break; - case 2: - world.setBlockState(currentPosition, SOUTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 11: - world.setBlockState(currentPosition, NORTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 12: - world.setBlockState(currentPosition, TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 3: - world.setBlockState(currentPosition, LIGHT, 8); - break; - case 4: world.setBlockState(currentPosition, AIR, 2); break; - case 5: + case 1: if (rand.nextDouble() < 0.35) { int k = rand.nextInt(4); switch (k) { @@ -327,120 +208,97 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 6: + case 2: if (door1) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + BlockState placement; + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor && rand.nextDouble() < 0.1) { + placement = VOID_BLOCK; + } else { + placement = AIR; } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - break; - case 7: - if (door2) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); + world.setBlockState(currentPosition, placement, 2); + world.setBlockState(currentPosition.add(0, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), placement, 2); if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), placement, 2); } - if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { - world.setBlockState(currentPosition, VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); + } else { + if (rand.nextDouble() < 0.35) { + int k = rand.nextInt(4); + switch (k) { + case 0: + world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); + break; + case 1: + world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); + break; + case 2: + world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); + break; + case 3: + world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); + break; } } else { - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); + world.setBlockState(currentPosition, WALLPAPER, 2); } - - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 8: - if (door3) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 3: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 9: - if (door4) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 4: + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); + } + break; + case 5: + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 10: - world.setBlockState(currentPosition, CARPET_STAIRS, 2); + case 6: + world.setBlockState(currentPosition, LIGHT, 2); break; - case 1: + case 7: if (rand.nextDouble() < 0.25) { world.setBlockState(currentPosition, MOLDY_CARPET, 2); } else { @@ -458,7 +316,7 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, } currentPosition.move(Direction.SOUTH); } - currentPosition.move(0, -1, -slice[0].length); + currentPosition.move(-1, 0, -slice[0].length); } } } \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRedRoom.java b/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRedRoom.java index 4f216ab..4397ba8 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRedRoom.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRedRoom.java @@ -1,5 +1,6 @@ package net.ludocrypt.backrooms.features; +import java.util.List; import java.util.Random; import com.mojang.serialization.Codec; @@ -10,6 +11,7 @@ import net.ludocrypt.backrooms.blocks.Tile; import net.ludocrypt.backrooms.blocks.TornWallpaper; import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.ludocrypt.imagereader.Layout; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.ChestBlock; @@ -30,92 +32,10 @@ public Level0DottedRedRoom(Codec configFactory) { super(configFactory); } - public static boolean door1 = true; - public static boolean door2 = true; - public static boolean door3 = true; - public static boolean door4 = true; - - private int[][] One = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][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5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] OneNoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] TwoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1NoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall1 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall2 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1Light = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 1, 10, 4, 4, 4, 4, 4, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1NoLight = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 1, 10, 4, 4, 4, 4, 4, 3, 3, 2, 11 }, { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - - private int[][] StairWall = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + private boolean door1 = true; private static final BlockState WALLPAPER = Backrooms.DOTTED_RED_WALLPAPER.getDefaultState(); private static final BlockState CARPET = Backrooms.CARPET.getDefaultState(); - private static final BlockState CARPET_STAIRS = Backrooms.CARPET_STAIRS.getDefaultState() - .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) - .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); private static final BlockState MOLDY_CARPET = Backrooms.CARPET.getDefaultState().with(Carpet.MOLDY, true); private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) .with(Tile.SINGLE, false); @@ -137,175 +57,136 @@ public Level0DottedRedRoom(Codec configFactory) { private static final BlockState TORN_WALLPAPER_4 = Backrooms.DOTTED_RED_TORN_WALLPAPER.getDefaultState() .with(TornWallpaper.TORN_LEVEL, 4); private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + private static final BlockState STAIR = Backrooms.CARPET_STAIRS.getDefaultState() + .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) + .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + + private static List LayoutsTop = Layout.listLayouts(27, "level01", 1, 0, new Layout()); + private static List LayoutsBottom = Layout.listLayouts(27, "level01", 2, 0, new Layout()); + private static Integer[][] Roof = Layout.getColoredLayout("roof", 0, 0, 3, 0, 6, 5, 4, 0, 0, 0, new Layout()); + private static Integer[][] Floor = Layout.getLayout("whiteblock", 0, 7, new Layout()); public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, DefaultFeatureConfig featureConfig) { - - Random generator = new Random(world.getSeed()); - long seed = world.getSeed(); - long l = generator.nextLong(); - long m = generator.nextLong(); - long n = generator.nextLong(); - long o = position.getX() * l ^ position.getY() * m ^ position.getZ() * n ^ seed; - generator = new Random(o); BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); + int layoutInt = 0; - if (generator.nextDouble() < 0.7) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); - } else if (generator.nextDouble() < 0.8) { - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall1, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall2, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + if (rand.nextDouble() < 0.7) { + layoutInt = 0; + } else if (rand.nextDouble() < 0.8) { + int k = rand.nextInt(9); + switch (k) { + case 0: + layoutInt = 8; + break; + case 1: + layoutInt = 9; + break; + case 2: + layoutInt = 10; + break; + case 3: + layoutInt = 11; + break; + case 4: + layoutInt = 17; + break; + case 5: + layoutInt = 18; + break; + case 6: + layoutInt = 19; + break; + case 7: + layoutInt = 20; + break; + case 8: + layoutInt = 25; + break; + case 9: + layoutInt = 26; + break; + } + } else { + if (rand.nextDouble() < 0.5) { + layoutInt = 100; } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + layoutInt = rand.nextInt(27); } - } else if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + } + + if (layoutInt == 100) { + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.One, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Four, rand, + Backrooms.DOTTED_RED_WALLPAPER, Backrooms.DOTTED_RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); + Integer[][] layoutTop = LayoutsTop.get(layoutInt); + Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); + + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Floor, rand); } return true; } - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand) { + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { - BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, slice[0].length)); - BlockPos.Mutable currentPosition = new BlockPos.Mutable(currentPositionOffsetted.getX(), - currentPositionOffsetted.getY(), currentPositionOffsetted.getZ()); + BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), + centerPos.getZ()); - for (int y = 0; y < slice.length; y++) { + for (int x = 0; x < slice.length; x++) { for (int z = 0; z < slice[0].length; z++) { - int sliceBlock = slice[y][z]; + int sliceBlock = slice[x][z]; if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { - - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRedRoom.door1 = true; - } else { - Level0DottedRedRoom.door1 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRedRoom.door2 = true; - } else { - Level0DottedRedRoom.door2 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRedRoom.door3 = true; - } else { - Level0DottedRedRoom.door3 = false; - } if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRedRoom.door4 = true; + door1 = true; } else { - Level0DottedRedRoom.door4 = false; + door1 = false; } switch (sliceBlock) { case 0: - break; - case 2: - world.setBlockState(currentPosition, SOUTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 11: - world.setBlockState(currentPosition, NORTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 12: - world.setBlockState(currentPosition, TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 3: - world.setBlockState(currentPosition, LIGHT, 2); - break; - case 4: world.setBlockState(currentPosition, AIR, 2); break; - case 5: + case 1: if (rand.nextDouble() < 0.005) { int k = rand.nextInt(4); switch (k) { @@ -326,126 +207,102 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 6: + case 2: if (door1) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + BlockState placement; + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor && rand.nextDouble() < 0.1) { + placement = VOID_BLOCK; + } else { + placement = AIR; } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - break; - case 7: - if (door2) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); + world.setBlockState(currentPosition, placement, 2); + world.setBlockState(currentPosition.add(0, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), placement, 2); if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), placement, 2); } - if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { - world.setBlockState(currentPosition, VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); + } else { + if (rand.nextDouble() < 0.005) { + int k = rand.nextInt(4); + switch (k) { + case 0: + world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); + break; + case 1: + world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); + break; + case 2: + world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); + break; + case 3: + world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); + break; } } else { - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); + world.setBlockState(currentPosition, WALLPAPER, 2); } - - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 8: - if (door3) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 3: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 9: - if (door4) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 4: + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 10: - world.setBlockState(currentPosition, CARPET_STAIRS, 2); + case 5: + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); + } break; - case 1: + case 6: + world.setBlockState(currentPosition, LIGHT, 2); + break; + case 7: if (rand.nextDouble() < 0.01) { world.setBlockState(currentPosition, MOLDY_CARPET, 2); } else { world.setBlockState(currentPosition, CARPET, 2); } - if (rand.nextDouble() < 0.001) { if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); @@ -458,7 +315,7 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, } currentPosition.move(Direction.SOUTH); } - currentPosition.move(0, -1, -slice[0].length); + currentPosition.move(-1, 0, -slice[0].length); } } } \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRoom.java b/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRoom.java index b78efcd..32d94ea 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRoom.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level0DottedRoom.java @@ -1,5 +1,6 @@ package net.ludocrypt.backrooms.features; +import java.util.List; import java.util.Random; import com.mojang.serialization.Codec; @@ -10,6 +11,7 @@ import net.ludocrypt.backrooms.blocks.Tile; import net.ludocrypt.backrooms.blocks.TornWallpaper; import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.ludocrypt.imagereader.Layout; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.ChestBlock; @@ -30,92 +32,10 @@ public Level0DottedRoom(Codec configFactory) { super(configFactory); } - public static boolean door1 = true; - public static boolean door2 = true; - public static boolean door3 = true; - public static boolean door4 = true; - - private int[][] One = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Two = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Three = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Four = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 9, 5, 9, 5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] OneNoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] TwoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1NoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall1 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall2 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 9, 5, 9, 5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2NoLight = { { 0,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1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1NoLight = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 1, 10, 4, 4, 4, 4, 4, 3, 3, 2, 11 }, { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - - private int[][] StairWall = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + private boolean door1 = true; private static final BlockState WALLPAPER = Backrooms.DOTTED_WALLPAPER.getDefaultState(); private static final BlockState CARPET = Backrooms.CARPET.getDefaultState(); - private static final BlockState CARPET_STAIRS = Backrooms.CARPET_STAIRS.getDefaultState() - .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) - .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); private static final BlockState MOLDY_CARPET = Backrooms.CARPET.getDefaultState().with(Carpet.MOLDY, true); private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) .with(Tile.SINGLE, false); @@ -137,175 +57,136 @@ public Level0DottedRoom(Codec configFactory) { private static final BlockState TORN_WALLPAPER_4 = Backrooms.DOTTED_TORN_WALLPAPER.getDefaultState() .with(TornWallpaper.TORN_LEVEL, 4); private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + private static final BlockState STAIR = Backrooms.CARPET_STAIRS.getDefaultState() + .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) + .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + + private static List LayoutsTop = Layout.listLayouts(27, "level01", 1, 0, new Layout()); + private static List LayoutsBottom = Layout.listLayouts(27, "level01", 2, 0, new Layout()); + private static Integer[][] Roof = Layout.getColoredLayout("roof", 0, 0, 3, 0, 6, 5, 4, 0, 0, 0, new Layout()); + private static Integer[][] Floor = Layout.getLayout("whiteblock", 0, 7, new Layout()); public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, DefaultFeatureConfig featureConfig) { - - Random generator = new Random(world.getSeed()); - long seed = world.getSeed(); - long l = generator.nextLong(); - long m = generator.nextLong(); - long n = generator.nextLong(); - long o = position.getX() * l ^ position.getY() * m ^ position.getZ() * n ^ seed; - generator = new Random(o); BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); + int layoutInt = 0; - if (generator.nextDouble() < 0.7) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); - } else if (generator.nextDouble() < 0.8) { - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall1, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall2, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + if (rand.nextDouble() < 0.7) { + layoutInt = 0; + } else if (rand.nextDouble() < 0.8) { + int k = rand.nextInt(9); + switch (k) { + case 0: + layoutInt = 8; + break; + case 1: + layoutInt = 9; + break; + case 2: + layoutInt = 10; + break; + case 3: + layoutInt = 11; + break; + case 4: + layoutInt = 17; + break; + case 5: + layoutInt = 18; + break; + case 6: + layoutInt = 19; + break; + case 7: + layoutInt = 20; + break; + case 8: + layoutInt = 25; + break; + case 9: + layoutInt = 26; + break; + } + } else { + if (rand.nextDouble() < 0.5) { + layoutInt = 100; } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + layoutInt = rand.nextInt(27); } - } else if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + } + + if (layoutInt == 100) { + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.One, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Four, rand, + Backrooms.DOTTED_WALLPAPER, Backrooms.DOTTED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); + Integer[][] layoutTop = LayoutsTop.get(layoutInt); + Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); + + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Floor, rand); } return true; } - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand) { + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { - BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, slice[0].length)); - BlockPos.Mutable currentPosition = new BlockPos.Mutable(currentPositionOffsetted.getX(), - currentPositionOffsetted.getY(), currentPositionOffsetted.getZ()); + BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), + centerPos.getZ()); - for (int y = 0; y < slice.length; y++) { + for (int x = 0; x < slice.length; x++) { for (int z = 0; z < slice[0].length; z++) { - int sliceBlock = slice[y][z]; + int sliceBlock = slice[x][z]; if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { - - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRoom.door1 = true; - } else { - Level0DottedRoom.door1 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRoom.door2 = true; - } else { - Level0DottedRoom.door2 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRoom.door3 = true; - } else { - Level0DottedRoom.door3 = false; - } if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0DottedRoom.door4 = true; + door1 = true; } else { - Level0DottedRoom.door4 = false; + door1 = false; } switch (sliceBlock) { case 0: - break; - case 2: - world.setBlockState(currentPosition, SOUTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 11: - world.setBlockState(currentPosition, NORTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 12: - world.setBlockState(currentPosition, TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 3: - world.setBlockState(currentPosition, LIGHT, 2); - break; - case 4: world.setBlockState(currentPosition, AIR, 2); break; - case 5: + case 1: if (rand.nextDouble() < 0.005) { int k = rand.nextInt(4); switch (k) { @@ -326,126 +207,102 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 6: + case 2: if (door1) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + BlockState placement; + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor && rand.nextDouble() < 0.1) { + placement = VOID_BLOCK; + } else { + placement = AIR; } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - break; - case 7: - if (door2) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); + world.setBlockState(currentPosition, placement, 2); + world.setBlockState(currentPosition.add(0, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), placement, 2); if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), placement, 2); } - if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { - world.setBlockState(currentPosition, VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); + } else { + if (rand.nextDouble() < 0.005) { + int k = rand.nextInt(4); + switch (k) { + case 0: + world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); + break; + case 1: + world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); + break; + case 2: + world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); + break; + case 3: + world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); + break; } } else { - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); + world.setBlockState(currentPosition, WALLPAPER, 2); } - - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 8: - if (door3) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 3: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 9: - if (door4) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 4: + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 10: - world.setBlockState(currentPosition, CARPET_STAIRS, 2); + case 5: + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); + } break; - case 1: + case 6: + world.setBlockState(currentPosition, LIGHT, 2); + break; + case 7: if (rand.nextDouble() < 0.01) { world.setBlockState(currentPosition, MOLDY_CARPET, 2); } else { world.setBlockState(currentPosition, CARPET, 2); } - if (rand.nextDouble() < 0.001) { if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); @@ -458,7 +315,7 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, } currentPosition.move(Direction.SOUTH); } - currentPosition.move(0, -1, -slice[0].length); + currentPosition.move(-1, 0, -slice[0].length); } } } \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level0RedRoom.java b/src/main/java/net/ludocrypt/backrooms/features/Level0RedRoom.java index 5413478..9ed26ac 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level0RedRoom.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level0RedRoom.java @@ -1,15 +1,24 @@ package net.ludocrypt.backrooms.features; +import java.util.List; import java.util.Random; import com.mojang.serialization.Codec; import net.ludocrypt.backrooms.Backrooms; +import net.ludocrypt.backrooms.blocks.BackroomsStairs; +import net.ludocrypt.backrooms.blocks.Carpet; import net.ludocrypt.backrooms.blocks.Tile; import net.ludocrypt.backrooms.blocks.TornWallpaper; import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.ludocrypt.imagereader.Layout; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.block.ChestBlock; +import net.minecraft.block.entity.LootableContainerBlockEntity; +import net.minecraft.block.enums.BlockHalf; +import net.minecraft.block.enums.ChestType; +import net.minecraft.block.enums.StairShape; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.ServerWorldAccess; @@ -23,74 +32,11 @@ public Level0RedRoom(Codec configFactory) { super(configFactory); } - public static boolean door1 = true; - public static boolean door2 = true; - public static boolean door3 = true; - public static boolean door4 = true; - - private int[][] One = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Two = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Three = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Four = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 9, 5, 9, 5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] OneNoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] TwoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 },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}, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + private boolean door1 = true; private static final BlockState WALLPAPER = Backrooms.RED_WALLPAPER.getDefaultState(); private static final BlockState CARPET = Backrooms.CARPET.getDefaultState(); + private static final BlockState MOLDY_CARPET = Backrooms.CARPET.getDefaultState().with(Carpet.MOLDY, true); private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) .with(Tile.SINGLE, false); private static final BlockState NORTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.NORTH) @@ -99,6 +45,8 @@ public Level0RedRoom(Codec configFactory) { .with(Tile.SINGLE, true); private static final BlockState LIGHT = Backrooms.LIGHT.getDefaultState(); private static final BlockState AIR = Blocks.AIR.getDefaultState(); + private static final BlockState CHEST = Blocks.CHEST.getDefaultState().with(ChestBlock.CHEST_TYPE, ChestType.SINGLE) + .with(ChestBlock.FACING, Direction.NORTH).with(ChestBlock.WATERLOGGED, false); private static final BlockState VOID_BLOCK = Backrooms.VOID_BLOCK.getDefaultState(); private static final BlockState TORN_WALLPAPER_1 = Backrooms.RED_TORN_WALLPAPER.getDefaultState() .with(TornWallpaper.TORN_LEVEL, 1); @@ -109,176 +57,136 @@ public Level0RedRoom(Codec configFactory) { private static final BlockState TORN_WALLPAPER_4 = Backrooms.RED_TORN_WALLPAPER.getDefaultState() .with(TornWallpaper.TORN_LEVEL, 4); private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + private static final BlockState STAIR = Backrooms.CARPET_STAIRS.getDefaultState() + .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) + .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + + private static List LayoutsTop = Layout.listLayouts(27, "level01", 1, 0, new Layout()); + private static List LayoutsBottom = Layout.listLayouts(27, "level01", 2, 0, new Layout()); + private static Integer[][] Roof = Layout.getColoredLayout("roof", 0, 0, 3, 0, 6, 5, 4, 0, 0, 0, new Layout()); + private static Integer[][] Floor = Layout.getLayout("whiteblock", 0, 7, new Layout()); public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, DefaultFeatureConfig featureConfig) { - - Random generator = new Random(world.getSeed()); - long seed = world.getSeed(); - long l = generator.nextLong(); - long m = generator.nextLong(); - long n = generator.nextLong(); - long o = position.getX() * l ^ position.getY() * m ^ position.getZ() * n ^ seed; - generator = new Random(o); - BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); + int layoutInt = 0; - if (generator.nextDouble() < 0.7) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); - } else if (generator.nextDouble() < 0.8) { - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall1, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall2, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + if (rand.nextDouble() < 0.7) { + layoutInt = 0; + } else if (rand.nextDouble() < 0.8) { + int k = rand.nextInt(9); + switch (k) { + case 0: + layoutInt = 8; + break; + case 1: + layoutInt = 9; + break; + case 2: + layoutInt = 10; + break; + case 3: + layoutInt = 11; + break; + case 4: + layoutInt = 17; + break; + case 5: + layoutInt = 18; + break; + case 6: + layoutInt = 19; + break; + case 7: + layoutInt = 20; + break; + case 8: + layoutInt = 25; + break; + case 9: + layoutInt = 26; + break; + } + } else { + if (rand.nextDouble() < 0.5) { + layoutInt = 100; } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + layoutInt = rand.nextInt(27); } - } else if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + } + + if (layoutInt == 100) { + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.One, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Four, rand, + Backrooms.RED_WALLPAPER, Backrooms.RED_TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); + Integer[][] layoutTop = LayoutsTop.get(layoutInt); + Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); + + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Floor, rand); } return true; } - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand) { + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { - BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, slice[0].length)); - BlockPos.Mutable currentPosition = new BlockPos.Mutable(currentPositionOffsetted.getX(), - currentPositionOffsetted.getY(), currentPositionOffsetted.getZ()); + BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), + centerPos.getZ()); - for (int y = 0; y < slice.length; y++) { + for (int x = 0; x < slice.length; x++) { for (int z = 0; z < slice[0].length; z++) { - int sliceBlock = slice[y][z]; + int sliceBlock = slice[x][z]; if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { - - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0RedRoom.door1 = true; - } else { - Level0RedRoom.door1 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0RedRoom.door2 = true; - } else { - Level0RedRoom.door2 = false; - } if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0RedRoom.door3 = true; + door1 = true; } else { - Level0RedRoom.door3 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0RedRoom.door4 = true; - } else { - Level0RedRoom.door4 = false; + door1 = false; } switch (sliceBlock) { case 0: - break; - case 2: - world.setBlockState(currentPosition, SOUTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 11: - world.setBlockState(currentPosition, NORTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 12: - world.setBlockState(currentPosition, TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 3: - world.setBlockState(currentPosition, LIGHT, 2); - break; - case 4: world.setBlockState(currentPosition, AIR, 2); break; - case 5: + case 1: if (rand.nextDouble() < 0.005) { int k = rand.nextInt(4); switch (k) { @@ -299,125 +207,115 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 6: + case 2: if (door1) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + BlockState placement; + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor && rand.nextDouble() < 0.1) { + placement = VOID_BLOCK; + } else { + placement = AIR; } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - break; - case 7: - if (door2) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); + world.setBlockState(currentPosition, placement, 2); + world.setBlockState(currentPosition.add(0, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), placement, 2); if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), placement, 2); } - if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { - world.setBlockState(currentPosition, VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); + } else { + if (rand.nextDouble() < 0.005) { + int k = rand.nextInt(4); + switch (k) { + case 0: + world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); + break; + case 1: + world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); + break; + case 2: + world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); + break; + case 3: + world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); + break; } } else { - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); + world.setBlockState(currentPosition, WALLPAPER, 2); } - - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); } break; - case 8: - if (door3) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 3: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 9: - if (door4) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + case 4: + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 1: - world.setBlockState(currentPosition, CARPET, 2); + case 5: + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); + } + break; + case 6: + world.setBlockState(currentPosition, LIGHT, 2); + break; + case 7: + if (rand.nextDouble() < 0.01) { + world.setBlockState(currentPosition, MOLDY_CARPET, 2); + } else { + world.setBlockState(currentPosition, CARPET, 2); + } + if (rand.nextDouble() < 0.001) { + if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { + world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); + LootableContainerBlockEntity.setLootTable(world, rand, currentPosition.add(0, 1, 0), + Backrooms.LEVEL0CHEST); + } + } break; } } currentPosition.move(Direction.SOUTH); } - currentPosition.move(0, -1, -slice[0].length); + currentPosition.move(-1, 0, -slice[0].length); } - } } \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level0Room.java b/src/main/java/net/ludocrypt/backrooms/features/Level0Room.java index 6966a55..78f11c4 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level0Room.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level0Room.java @@ -19,10 +19,8 @@ import net.minecraft.block.enums.BlockHalf; import net.minecraft.block.enums.ChestType; import net.minecraft.block.enums.StairShape; -import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.minecraft.util.math.Vec2f; import net.minecraft.world.ServerWorldAccess; import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.gen.chunk.ChunkGenerator; @@ -34,16 +32,10 @@ public Level0Room(Codec configFactory) { super(configFactory); } - public static boolean door1 = true; - public static boolean door2 = true; - public static boolean door3 = true; - public static boolean door4 = true; + private boolean door1 = true; private static final BlockState WALLPAPER = Backrooms.WALLPAPER.getDefaultState(); private static final BlockState CARPET = Backrooms.CARPET.getDefaultState(); - private static final BlockState CARPET_STAIRS = Backrooms.CARPET_STAIRS.getDefaultState() - .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) - .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); private static final BlockState MOLDY_CARPET = Backrooms.CARPET.getDefaultState().with(Carpet.MOLDY, true); private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) .with(Tile.SINGLE, false); @@ -65,171 +57,115 @@ public Level0Room(Codec configFactory) { private static final BlockState TORN_WALLPAPER_4 = Backrooms.TORN_WALLPAPER.getDefaultState() .with(TornWallpaper.TORN_LEVEL, 4); private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + private static final BlockState STAIR = Backrooms.CARPET_STAIRS.getDefaultState() + .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) + .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); -// private static Integer[][] WallsTop = Layout.getLayout("level0_1", 5, 0); -// private static Integer[][] WallsBottom = Layout.getLayout("level0_1", 4, 0); -// private static List LayoutsTop = Layout.listLayouts(32, "level0", 10, 0, 1, 2, 3, 4, 5, 6, 7, 8); -// private static List LayoutsBottom = Layout.listLayouts(32, "level0", 9, 0, 0, 0, 0, 0, 0, 0, 0, 0); -// private static Integer[][] layoutTest = Layout.getLayout("level0test", 10, 0, 1, 2, 3, 4, 5, 6, 7, 8); -// private static Integer[][] layoutTestBottom = Layout.getLayout("level0test", 9, 0, 1, 2, 3, 4, 5, 6, 7, 8); - - private static List LayoutsTop = Layout.listLayouts(4, "level0", 10, 0, 1, 2, 3, 4, 5, 6, 7, 8); - private static List LayoutsBottom = Layout.listLayouts(4, "level0", 9, 0, 1, 2, 3, 4, 5, 6, 7, 8); + private static List LayoutsTop = Layout.listLayouts(27, "level01", 1, 0, new Layout()); + private static List LayoutsBottom = Layout.listLayouts(27, "level01", 2, 0, new Layout()); + private static Integer[][] Roof = Layout.getColoredLayout("roof", 0, 0, 3, 0, 6, 5, 4, 0, 0, 0, new Layout()); + private static Integer[][] Floor = Layout.getLayout("whiteblock", 0, 7, new Layout()); public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, DefaultFeatureConfig featureConfig) { BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); - boolean red; - boolean red2; - boolean green; - boolean green2; - boolean blue; - boolean blue2; - boolean purple; - boolean purple2; - red = rand.nextBoolean(); - red2 = rand.nextBoolean(); - green = rand.nextBoolean(); - green2 = rand.nextBoolean(); - blue = rand.nextBoolean(); - blue2 = rand.nextBoolean(); - purple = rand.nextBoolean(); - purple2 = rand.nextBoolean(); - int layoutInt; + int layoutInt = 0; if (rand.nextDouble() < 0.7) { layoutInt = 0; } else if (rand.nextDouble() < 0.8) { - if (rand.nextDouble() < 0.5) { - layoutInt = 1; - } else { - layoutInt = 2; + int k = rand.nextInt(9); + switch (k) { + case 0: + layoutInt = 8; + break; + case 1: + layoutInt = 9; + break; + case 2: + layoutInt = 10; + break; + case 3: + layoutInt = 11; + break; + case 4: + layoutInt = 17; + break; + case 5: + layoutInt = 18; + break; + case 6: + layoutInt = 19; + break; + case 7: + layoutInt = 20; + break; + case 8: + layoutInt = 25; + break; + case 9: + layoutInt = 26; + break; } - } else if (rand.nextDouble() < 0.5) { + } else { if (rand.nextDouble() < 0.5) { - layoutInt = 3; + layoutInt = 100; } else { - layoutInt = 4; + layoutInt = rand.nextInt(27); } - } else { - layoutInt = 0; } - Integer[][] layoutTop = LayoutsTop.get(layoutInt); - Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); - - generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand, red, red2, green, green2, blue, - blue2, purple, purple2); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand, red, red2, green, green2, blue, - blue2, purple, purple2); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand, red, red2, green, green2, blue, - blue2, purple, purple2); - generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand, red, red2, green, green2, blue, - blue2, purple, purple2); - -// generateSlice(world, mutableBlockPos.move(Direction.DOWN), WallsTop, rand, red, green, blue); -// generateSlice(world, mutableBlockPos.move(Direction.DOWN), WallsTop, rand, red, green, blue); -// generateSlice(world, mutableBlockPos.move(Direction.DOWN), WallsTop, rand, red, green, blue); -// generateSlice(world, mutableBlockPos.move(Direction.DOWN), WallsTop, rand, red, green, blue); + if (layoutInt == 100) { + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.One, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Four, rand, + Backrooms.WALLPAPER, Backrooms.TORN_WALLPAPER, STAIR, Backrooms.CARPET, MOLDY_CARPET, true); + } else { + Integer[][] layoutTop = LayoutsTop.get(layoutInt); + Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); -// if (generator.nextDouble() < 0.7) { -// generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); -// } else if (generator.nextDouble() < 0.8) { -// if (generator.nextDouble() < 0.5) { -// generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall1, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall2, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); -// } else { -// generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); -// } -// } else if (generator.nextDouble() < 0.5) { -// generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); -// } else { -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); -// } + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Floor, rand); + } return true; } - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand, - boolean red, boolean red2, boolean green, boolean green2, boolean blue, boolean blue2, boolean purple, - boolean purple2) { + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { -// BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, slice[0].length)); BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), centerPos.getZ()); @@ -240,88 +176,85 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { - -// if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { -// Level0Room.door1 = rand.nextBoolean(); -// } if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { - Level0Room.door1 = true; + door1 = true; } else { - Level0Room.door1 = false; + door1 = false; } -// if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { -// Level0Room.door2 = true; -// } else { -// Level0Room.door2 = false; -// } -// if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { -// Level0Room.door3 = true; -// } else { -// Level0Room.door3 = false; -// } -// if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { -// Level0Room.door4 = true; -// } else { -// Level0Room.door4 = false; -// } switch (sliceBlock) { - case 0: world.setBlockState(currentPosition, AIR, 2); break; case 1: - if (red) { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + if (rand.nextDouble() < 0.005) { + int k = rand.nextInt(4); + switch (k) { + case 0: + world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); + break; + case 1: + world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); + break; + case 2: + world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); + break; + case 3: + world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); + break; } } else { - world.setBlockState(currentPosition, AIR, 2); + world.setBlockState(currentPosition, WALLPAPER, 2); } break; case 2: - if (red2) { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } + if (door1) { + BlockState placement; + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor && rand.nextDouble() < 0.1) { + placement = VOID_BLOCK; } else { - world.setBlockState(currentPosition, WALLPAPER, 2); + placement = AIR; + } + world.setBlockState(currentPosition, placement, 2); + world.setBlockState(currentPosition.add(0, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), placement, 2); + if (BackroomsConfig.getInstance().TallDoors) { + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), placement, 2); } } else { - world.setBlockState(currentPosition, AIR, 2); - } - break; - case 3: - if (green) { if (rand.nextDouble() < 0.005) { int k = rand.nextInt(4); switch (k) { @@ -341,387 +274,43 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, } else { world.setBlockState(currentPosition, WALLPAPER, 2); } - } else { - world.setBlockState(currentPosition, AIR, 2); + } + break; + case 3: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; case 4: - if (green2) { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - } else { - world.setBlockState(currentPosition, AIR, 2); + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; case 5: - if (blue) { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - } else { - world.setBlockState(currentPosition, AIR, 2); + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; case 6: - if (blue2) { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - } else { - world.setBlockState(currentPosition, AIR, 2); - } + world.setBlockState(currentPosition, LIGHT, 2); break; case 7: - if (purple) { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - } else { - world.setBlockState(currentPosition, AIR, 2); - } - break; - case 8: - if (purple2) { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } - } else { - world.setBlockState(currentPosition, AIR, 2); - } - break; - - case 9: - if (door1) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 1), AIR, 2); - } + if (rand.nextDouble() < 0.01) { + world.setBlockState(currentPosition, MOLDY_CARPET, 2); } else { - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; - } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); - } + world.setBlockState(currentPosition, CARPET, 2); } - break; - case 10: - if (rand.nextDouble() < 0.005) { - int k = rand.nextInt(4); - switch (k) { - case 0: - world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); - break; - case 1: - world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); - break; - case 2: - world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); - break; - case 3: - world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); - break; + if (rand.nextDouble() < 0.001) { + if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { + world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); + LootableContainerBlockEntity.setLootTable(world, rand, currentPosition.add(0, 1, 0), + Backrooms.LEVEL0CHEST); } - } else { - world.setBlockState(currentPosition, WALLPAPER, 2); } break; - -// case 0: -// break; -// case 2: -// world.setBlockState(currentPosition, SOUTH_TILE, 2); -// if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { -// world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); -// } -// break; -// case 11: -// world.setBlockState(currentPosition, NORTH_TILE, 2); -// if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { -// world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); -// } -// break; -// case 12: -// world.setBlockState(currentPosition, TILE, 2); -// if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { -// world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); -// } -// break; -// case 3: -// world.setBlockState(currentPosition, LIGHT, 2); -// break; -// case 4: -// world.setBlockState(currentPosition, AIR, 2); -// break; -// case 5: -// if (rand.nextDouble() < 0.005) { -// int k = rand.nextInt(4); -// switch (k) { -// case 0: -// world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); -// break; -// case 1: -// world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); -// break; -// case 2: -// world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); -// break; -// case 3: -// world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); -// break; -// } -// } else { -// world.setBlockState(currentPosition, WALLPAPER, 2); -// } -// break; -// case 6: -// if (door1) { -// world.setBlockState(currentPosition, AIR, 2); -// world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); -// world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); -// world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); -// if (BackroomsConfig.getInstance().TallDoors) { -// world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); -// } -// } else { -// world.setBlockState(currentPosition, WALLPAPER, 2); -// } -// break; -// case 7: -// if (door2) { -// world.setBlockState(currentPosition, AIR, 3); -// world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); -// world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); -// world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); -// world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); -// world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); -// world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); -// world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); -// world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); -// world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); -// world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); -// if (BackroomsConfig.getInstance().TallDoors) { -// world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); -// } -// if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { -// world.setBlockState(currentPosition, VOID_BLOCK, 3); -// world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); -// world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); -// world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); -// world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); -// world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); -// if (BackroomsConfig.getInstance().TallDoors) { -// world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); -// world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); -// } -// } else { -// world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); -// } -// -// } else { -// world.setBlockState(currentPosition, WALLPAPER, 2); -// } -// break; -// case 8: -// if (door3) { -// world.setBlockState(currentPosition, AIR, 3); -// world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); -// world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); -// world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); -// if (BackroomsConfig.getInstance().TallDoors) { -// world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); -// world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); -// } -// } else { -// world.setBlockState(currentPosition, WALLPAPER, 2); -// } -// break; -// case 9: -// if (door4) { -// world.setBlockState(currentPosition, AIR, 2); -// world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); -// world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); -// world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); -// world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); -// world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); -// world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); -// world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); -// world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); -// world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); -// if (BackroomsConfig.getInstance().TallDoors) { -// world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); -// world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); -// world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); -// } -// } else { -// world.setBlockState(currentPosition, WALLPAPER, 2); -// } -// break; -// case 10: -// world.setBlockState(currentPosition, CARPET_STAIRS, 2); -// break; -// case 1: -// if (rand.nextDouble() < 0.01) { -// world.setBlockState(currentPosition, MOLDY_CARPET, 2); -// } else { -// world.setBlockState(currentPosition, CARPET, 2); -// } -// if (rand.nextDouble() < 0.001) { -// if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { -// world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); -// LootableContainerBlockEntity.setLootTable(world, rand, currentPosition.add(0, 1, 0), -// Backrooms.LEVEL0CHEST); -// } -// } -// break; } } currentPosition.move(Direction.SOUTH); diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level1OffRoom.java b/src/main/java/net/ludocrypt/backrooms/features/Level1OffRoom.java index 4d43b1b..84b5dda 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level1OffRoom.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level1OffRoom.java @@ -1,5 +1,6 @@ package net.ludocrypt.backrooms.features; +import java.util.List; import java.util.Random; import com.mojang.serialization.Codec; @@ -9,6 +10,7 @@ import net.ludocrypt.backrooms.blocks.Light; import net.ludocrypt.backrooms.blocks.Tile; import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.ludocrypt.imagereader.Layout; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.ChestBlock; @@ -29,92 +31,10 @@ public Level1OffRoom(Codec configFactory) { super(configFactory); } - public static boolean door1 = true; - public static boolean door2 = true; - public static boolean door3 = true; - public static boolean door4 = true; + private boolean door1 = true; - private int[][] One = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Two = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 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, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] OneNoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] TwoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1NoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall1 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall2 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 9, 5, 9, 5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2NoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1Light = { { 0, 0,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, 5, 5, 5, 8, 8, 8, 8, 8, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - - private static final BlockState CEMENT_BRICKS = Backrooms.CEMENT_BRICKS.getDefaultState(); private static final BlockState CEMENT = Backrooms.CEMENT.getDefaultState(); - private static final BlockState CEMENT_STAIRS = Backrooms.CEMENT_STAIRS.getDefaultState() - .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) - .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + private static final BlockState CEMENT_BRICKS = Backrooms.CEMENT_BRICKS.getDefaultState(); private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) .with(Tile.SINGLE, false); private static final BlockState NORTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.NORTH) @@ -127,306 +47,225 @@ public Level1OffRoom(Codec configFactory) { .with(ChestBlock.FACING, Direction.NORTH).with(ChestBlock.WATERLOGGED, false); private static final BlockState VOID_BLOCK = Backrooms.VOID_BLOCK.getDefaultState(); private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + private static final BlockState STAIR = Backrooms.CEMENT_STAIRS.getDefaultState() + .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) + .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + + private static List LayoutsTop = Layout.listLayouts(27, "level01", 1, 0, new Layout()); + private static List LayoutsBottom = Layout.listLayouts(27, "level01", 2, 0, new Layout()); + private static Integer[][] Roof = Layout.getColoredLayout("roof", 0, 0, 3, 0, 6, 5, 4, 0, 0, 0, new Layout()); + private static Integer[][] Floor = Layout.getLayout("whiteblock", 0, 7, new Layout()); public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, DefaultFeatureConfig featureConfig) { - - Random generator = new Random(world.getSeed()); - long seed = world.getSeed(); - long l = generator.nextLong(); - long m = generator.nextLong(); - long n = generator.nextLong(); - long o = position.getX() * l ^ position.getY() * m ^ position.getZ() * n ^ seed * 5; - generator = new Random(o); - BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); + int layoutInt = 0; - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); - } else if (generator.nextDouble() < 0.5) { - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall1, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall2, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + if (rand.nextDouble() < 0.7) { + layoutInt = 0; + } else if (rand.nextDouble() < 0.8) { + int k = rand.nextInt(9); + switch (k) { + case 0: + layoutInt = 8; + break; + case 1: + layoutInt = 9; + break; + case 2: + layoutInt = 10; + break; + case 3: + layoutInt = 11; + break; + case 4: + layoutInt = 17; + break; + case 5: + layoutInt = 18; + break; + case 6: + layoutInt = 19; + break; + case 7: + layoutInt = 20; + break; + case 8: + layoutInt = 25; + break; + case 9: + layoutInt = 26; + break; + } + } else { + if (rand.nextDouble() < 0.5) { + layoutInt = 100; } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + layoutInt = rand.nextInt(27); } - } else if (generator.nextDouble() < 0.3) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + } + + if (layoutInt == 100) { + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.One, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Four, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, false); } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); + Integer[][] layoutTop = LayoutsTop.get(layoutInt); + Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); + + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Floor, rand); } return true; } - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand) { + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { - BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, -slice[0].length)); - BlockPos.Mutable currentPosition = new BlockPos.Mutable(currentPositionOffsetted.getX(), - currentPositionOffsetted.getY(), currentPositionOffsetted.getZ()); + BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), + centerPos.getZ()); - for (int y = 0; y < slice.length; y++) { + for (int x = 0; x < slice.length; x++) { for (int z = 0; z < slice[0].length; z++) { - int sliceBlock = slice[y][z]; + int sliceBlock = slice[x][z]; if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) - && (world.getBlockState(currentPosition).getBlock() != Backrooms.CEMENT_STAIRS)) { - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1OffRoom.door1 = true; - } else { - Level1OffRoom.door1 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1OffRoom.door2 = true; - } else { - Level1OffRoom.door2 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1OffRoom.door3 = true; - } else { - Level1OffRoom.door3 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1OffRoom.door4 = true; + && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { + if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { + door1 = true; } else { - Level1OffRoom.door4 = false; + door1 = false; } switch (sliceBlock) { case 0: - break; - case 2: - - world.setBlockState(currentPosition, SOUTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 11: - world.setBlockState(currentPosition, NORTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 12: - world.setBlockState(currentPosition, TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 3: - world.setBlockState(currentPosition, LIGHT, 2); - break; - case 4: world.setBlockState(currentPosition, AIR, 2); break; - case 5: + case 1: world.setBlockState(currentPosition, CEMENT_BRICKS, 2); break; - case 6: + case 2: if (door1) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); + BlockState placement; + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor && rand.nextDouble() < 0.1) { + placement = VOID_BLOCK; + } else { + placement = AIR; + } + world.setBlockState(currentPosition, placement, 2); + world.setBlockState(currentPosition.add(0, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), placement, 2); if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), placement, 2); } } else { world.setBlockState(currentPosition, CEMENT_BRICKS, 2); } break; - case 7: - if (door2) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); - } - if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { - world.setBlockState(currentPosition, VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); - } - } else { - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); - } - - } else { - world.setBlockState(currentPosition, CEMENT_BRICKS, 2); + case 3: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 8: - if (door3) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, CEMENT_BRICKS, 2); + case 4: + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 9: - if (door4) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, CEMENT_BRICKS, 2); + case 5: + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 10: - world.setBlockState(currentPosition, CEMENT_STAIRS, 2); + case 6: + world.setBlockState(currentPosition, LIGHT, 2); break; - case 1: - if (rand.nextDouble() < 0.005) { + case 7: + world.setBlockState(currentPosition, CEMENT, 2); + if (rand.nextDouble() < 0.001) { if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); LootableContainerBlockEntity.setLootTable(world, rand, currentPosition.add(0, 1, 0), Backrooms.LEVEL1CHEST); } } - world.setBlockState(currentPosition, CEMENT, 2); break; } } currentPosition.move(Direction.SOUTH); } - currentPosition.move(0, -1, -slice[0].length); + currentPosition.move(-1, 0, -slice[0].length); } } } \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level1Room.java b/src/main/java/net/ludocrypt/backrooms/features/Level1Room.java index 121dc2d..3af3e86 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level1Room.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level1Room.java @@ -1,5 +1,6 @@ package net.ludocrypt.backrooms.features; +import java.util.List; import java.util.Random; import com.mojang.serialization.Codec; @@ -8,6 +9,7 @@ import net.ludocrypt.backrooms.blocks.BackroomsStairs; import net.ludocrypt.backrooms.blocks.Tile; import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.ludocrypt.imagereader.Layout; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.ChestBlock; @@ -28,92 +30,10 @@ public Level1Room(Codec configFactory) { super(configFactory); } - public static boolean door1 = true; - public static boolean door2 = true; - public static boolean door3 = true; - public static boolean door4 = true; + private boolean door1 = true; - private int[][] One = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Two = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 },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 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway1Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 7, 4, 4, 4, 4, 8, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall1 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 6, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Wall2 = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 9, 5, 9, 5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2NoLight = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Hallway2Light = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 11, 12, 3, 3, 12, 2, 11, 3, 3, 2, 11 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5 }, { 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1Light = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 1, 10, 4, 4, 4, 4, 4, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - private int[][] Stair1NoLight = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, - { 2, 11, 3, 3, 2, 1, 10, 4, 4, 4, 4, 4, 3, 3, 2, 11 }, { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, - { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - - private int[][] StairWall = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8 }, - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; - - private static final BlockState CEMENT_BRICKS = Backrooms.CEMENT_BRICKS.getDefaultState(); private static final BlockState CEMENT = Backrooms.CEMENT.getDefaultState(); - private static final BlockState CEMENT_STAIRS = Backrooms.CEMENT_STAIRS.getDefaultState() - .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) - .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + private static final BlockState CEMENT_BRICKS = Backrooms.CEMENT_BRICKS.getDefaultState(); private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) .with(Tile.SINGLE, false); private static final BlockState NORTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.NORTH) @@ -126,307 +46,225 @@ public Level1Room(Codec configFactory) { .with(ChestBlock.FACING, Direction.NORTH).with(ChestBlock.WATERLOGGED, false); private static final BlockState VOID_BLOCK = Backrooms.VOID_BLOCK.getDefaultState(); private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + private static final BlockState STAIR = Backrooms.CEMENT_STAIRS.getDefaultState() + .with(BackroomsStairs.FACING, Direction.NORTH).with(BackroomsStairs.HALF, BlockHalf.BOTTOM) + .with(BackroomsStairs.SHAPE, StairShape.STRAIGHT); + + private static List LayoutsTop = Layout.listLayouts(27, "level01", 1, 0, new Layout()); + private static List LayoutsBottom = Layout.listLayouts(27, "level01", 2, 0, new Layout()); + private static Integer[][] Roof = Layout.getColoredLayout("roof", 0, 0, 3, 0, 6, 5, 4, 0, 0, 0, new Layout()); + private static Integer[][] Floor = Layout.getLayout("whiteblock", 0, 7, new Layout()); public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random rand, BlockPos position, DefaultFeatureConfig featureConfig) { - - Random generator = new Random(world.getSeed()); - long seed = world.getSeed(); - long l = generator.nextLong(); - long m = generator.nextLong(); - long n = generator.nextLong(); - long o = position.getX() * l ^ position.getY() * m ^ position.getZ() * n ^ seed * 5; - generator = new Random(o); - BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable().set(position); + int layoutInt = 0; - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); - } else if (generator.nextDouble() < 0.5) { - if (generator.nextDouble() < 0.5) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall1, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Wall2, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway2NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + if (rand.nextDouble() < 0.7) { + layoutInt = 0; + } else if (rand.nextDouble() < 0.8) { + int k = rand.nextInt(9); + switch (k) { + case 0: + layoutInt = 8; + break; + case 1: + layoutInt = 9; + break; + case 2: + layoutInt = 10; + break; + case 3: + layoutInt = 11; + break; + case 4: + layoutInt = 17; + break; + case 5: + layoutInt = 18; + break; + case 6: + layoutInt = 19; + break; + case 7: + layoutInt = 20; + break; + case 8: + layoutInt = 25; + break; + case 9: + layoutInt = 26; + break; + } + } else { + if (rand.nextDouble() < 0.5) { + layoutInt = 100; } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Hallway1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + layoutInt = rand.nextInt(27); } - } else if (generator.nextDouble() < 0.3) { - generateSlice(world, mutableBlockPos.move(Direction.EAST), One, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1Light, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Stair1NoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), StairWall, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Three, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Two, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), Four, rand); + } + + if (layoutInt == 100) { + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.One, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1Light, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Stair1NoLight, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.StairWall, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Three, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Two, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); + RoomArchives.generateSlice(world, mutableBlockPos.move(Direction.EAST), RoomArchives.Four, rand, + Backrooms.CEMENT_BRICKS, null, STAIR, Backrooms.CEMENT, null, true); } else { - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), TwoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); - generateSlice(world, mutableBlockPos.move(Direction.EAST), OneNoLight, rand); + Integer[][] layoutTop = LayoutsTop.get(layoutInt); + Integer[][] layoutBottom = LayoutsBottom.get(layoutInt); + + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Roof, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutTop, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), layoutBottom, rand); + generateSlice(world, mutableBlockPos.move(Direction.DOWN), Floor, rand); } return true; } - private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand) { + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, Integer[][] slice, Random rand) { - BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, -slice[0].length)); - BlockPos.Mutable currentPosition = new BlockPos.Mutable(currentPositionOffsetted.getX(), - currentPositionOffsetted.getY(), currentPositionOffsetted.getZ()); + BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1, centerPos.getY(), + centerPos.getZ()); - for (int y = 0; y < slice.length; y++) { + for (int x = 0; x < slice.length; x++) { for (int z = 0; z < slice[0].length; z++) { - int sliceBlock = slice[y][z]; + int sliceBlock = slice[x][z]; if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) - && (world.getBlockState(currentPosition).getBlock() != Backrooms.CEMENT_STAIRS)) { - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1Room.door1 = true; - } else { - Level1Room.door1 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1Room.door2 = true; - } else { - Level1Room.door2 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1Room.door3 = true; - } else { - Level1Room.door3 = false; - } - if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level1DoorChance))) { - Level1Room.door4 = true; + && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { + if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { + door1 = true; } else { - Level1Room.door4 = false; + door1 = false; } switch (sliceBlock) { case 0: - break; - case 2: - - world.setBlockState(currentPosition, SOUTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 11: - world.setBlockState(currentPosition, NORTH_TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 12: - world.setBlockState(currentPosition, TILE, 2); - if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { - world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); - } - break; - case 3: - world.setBlockState(currentPosition, LIGHT, 2); - break; - case 4: world.setBlockState(currentPosition, AIR, 2); break; - case 5: + case 1: world.setBlockState(currentPosition, CEMENT_BRICKS, 2); break; - case 6: + case 2: if (door1) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); + BlockState placement; + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor && rand.nextDouble() < 0.1) { + placement = VOID_BLOCK; + } else { + placement = AIR; + } + world.setBlockState(currentPosition, placement, 2); + world.setBlockState(currentPosition.add(0, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(0, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 0, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 1, -1), placement, 2); + world.setBlockState(currentPosition.add(1, 2, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), placement, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), placement, 2); if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(0, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 0), placement, 2); + world.setBlockState(currentPosition.add(1, 3, 1), placement, 2); + world.setBlockState(currentPosition.add(1, 3, -1), placement, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), placement, 2); } } else { world.setBlockState(currentPosition, CEMENT_BRICKS, 2); } break; - case 7: - if (door2) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); - world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); - } - if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { - world.setBlockState(currentPosition, VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); - world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); - } - } else { - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); - } - - } else { - world.setBlockState(currentPosition, CEMENT_BRICKS, 2); + case 3: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 8: - if (door3) { - world.setBlockState(currentPosition, AIR, 3); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); - world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, CEMENT_BRICKS, 2); + case 4: + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - case 9: - if (door4) { - world.setBlockState(currentPosition, AIR, 2); - world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); - if (BackroomsConfig.getInstance().TallDoors) { - world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); - world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); - } - } else { - world.setBlockState(currentPosition, CEMENT_BRICKS, 2); + case 5: + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); } break; - - case 10: - world.setBlockState(currentPosition, CEMENT_STAIRS, 2); + case 6: + world.setBlockState(currentPosition, LIGHT, 2); break; - case 1: - if (rand.nextDouble() < 0.005) { + case 7: + world.setBlockState(currentPosition, CEMENT, 2); + if (rand.nextDouble() < 0.001) { if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); LootableContainerBlockEntity.setLootTable(world, rand, currentPosition.add(0, 1, 0), Backrooms.LEVEL1CHEST); } } - world.setBlockState(currentPosition, CEMENT, 2); break; } } currentPosition.move(Direction.SOUTH); } - currentPosition.move(0, -1, -slice[0].length); + currentPosition.move(-1, 0, -slice[0].length); } } } \ No newline at end of file diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level3Room.java b/src/main/java/net/ludocrypt/backrooms/features/Level3Room.java index 8646cff..7ac896a 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/Level3Room.java +++ b/src/main/java/net/ludocrypt/backrooms/features/Level3Room.java @@ -218,6 +218,7 @@ public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerato return true; } + private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand) { BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(0, 3, slice[0].length)); @@ -261,7 +262,16 @@ private void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, break; case 7: world.setBlockState(currentPosition, FLOOR, 2); - if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { + if (rand.nextDouble() < BackroomsConfig.getInstance().Level3DoorChance) { + world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 4, 0), PIPE, 2); + world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); + world.setBlockState(currentPosition.add(0, 4, 1), PIPE, 2); + } else if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { if (rand.nextDouble() < 0.05) { world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 2); world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 2); diff --git a/src/main/java/net/ludocrypt/backrooms/features/LevelsFeatureInit.java b/src/main/java/net/ludocrypt/backrooms/features/LevelsFeatureInit.java index e7121b1..1f21c0e 100644 --- a/src/main/java/net/ludocrypt/backrooms/features/LevelsFeatureInit.java +++ b/src/main/java/net/ludocrypt/backrooms/features/LevelsFeatureInit.java @@ -13,7 +13,7 @@ import net.minecraft.world.gen.feature.Feature; public class LevelsFeatureInit { - public static Feature LEVEL01ROOF = new Level01Roof(DefaultFeatureConfig.CODEC); + public static Feature LEVEL0ROOM = new Level0Room(DefaultFeatureConfig.CODEC); public static Feature LEVEL0REDROOM = new Level0RedRoom(DefaultFeatureConfig.CODEC); public static Feature LEVEL0DOTTEDROOM = new Level0DottedRoom(DefaultFeatureConfig.CODEC); @@ -34,7 +34,7 @@ public class LevelsFeatureInit { public static Decorator LEVEL3DECORATOR = new Level3RoomDecorator(NopeDecoratorConfig.CODEC); public static void registerFeatures() { - Registry.register(Registry.FEATURE, new Identifier("backrooms", "level01roof"), LEVEL01ROOF); + Registry.register(Registry.FEATURE, new Identifier("backrooms", "level0room"), LEVEL0ROOM); Registry.register(Registry.FEATURE, new Identifier("backrooms", "level0redroom"), LEVEL0REDROOM); Registry.register(Registry.FEATURE, new Identifier("backrooms", "level0dottedroom"), LEVEL0DOTTEDROOM); diff --git a/src/main/java/net/ludocrypt/backrooms/features/RoomArchives.java b/src/main/java/net/ludocrypt/backrooms/features/RoomArchives.java new file mode 100644 index 0000000..be39463 --- /dev/null +++ b/src/main/java/net/ludocrypt/backrooms/features/RoomArchives.java @@ -0,0 +1,325 @@ +package net.ludocrypt.backrooms.features; + +import java.util.Random; + +import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.annotation.Nullable; +import net.ludocrypt.backrooms.Backrooms; +import net.ludocrypt.backrooms.blocks.Light; +import net.ludocrypt.backrooms.blocks.Tile; +import net.ludocrypt.backrooms.blocks.TornWallpaper; +import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.ChestBlock; +import net.minecraft.block.entity.LootableContainerBlockEntity; +import net.minecraft.block.enums.ChestType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.ServerWorldAccess; + +public class RoomArchives { + + public static boolean door1 = true; + public static boolean door2 = true; + public static boolean door3 = true; + public static boolean door4 = true; + + public static int[][] One = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, 11, 2, 11, 2, 11, 2,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, 1, 1 } }; + public static int[][] Four = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 9, 5, 9, 5, 9, 9, 9, 9, 5, 9, 5, 9, 5, 5 }, + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + public static int[][] Stair1Light = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, + { 2, 11, 2, 11, 2, 1, 10, 4, 4, 4, 4, 4, 2, 11, 2, 11 }, + { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, + { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + public static int[][] Stair1NoLight = { { 0, 0, 0, 0, 0, 10, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0 }, + { 2, 11, 3, 3, 2, 1, 10, 4, 4, 4, 4, 4, 3, 3, 2, 11 }, { 5, 5, 5, 5, 5, 1, 1, 10, 4, 4, 4, 4, 4, 4, 4, 5 }, + { 5, 5, 5, 5, 5, 1, 1, 1, 10, 4, 4, 4, 4, 4, 4, 5 }, { 5, 5, 5, 5, 5, 1, 1, 1, 1, 10, 4, 4, 4, 4, 4, 5 }, + { 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 10, 4, 4, 4, 4, 8 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + public static int[][] StairWall = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11, 2, 11 }, + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8 }, + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } }; + + private static final BlockState SOUTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.SOUTH) + .with(Tile.SINGLE, false); + private static final BlockState NORTH_TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.NORTH) + .with(Tile.SINGLE, false); + private static final BlockState TILE = Backrooms.TILE.getDefaultState().with(Tile.FACING, Direction.EAST) + .with(Tile.SINGLE, true); + private static final BlockState LIGHT = Backrooms.LIGHT.getDefaultState(); + private static final BlockState AIR = Blocks.AIR.getDefaultState(); + private static final BlockState CHEST = Blocks.CHEST.getDefaultState().with(ChestBlock.CHEST_TYPE, ChestType.SINGLE) + .with(ChestBlock.FACING, Direction.NORTH).with(ChestBlock.WATERLOGGED, false); + private static final BlockState VOID_BLOCK = Backrooms.VOID_BLOCK.getDefaultState(); + private static final BlockState VENT = Backrooms.VENT.getDefaultState(); + + public static void generateSlice(ServerWorldAccess world, BlockPos.Mutable centerPos, int[][] slice, Random rand, + Block wallpaper, @Nullable Block tornWallpaper, BlockState stair, Block floor, + @Nullable BlockState floorAlternative, boolean lightsOn) { + + BlockPos.Mutable currentPosition = new BlockPos.Mutable(centerPos.getX() - 1 - 16, centerPos.getY(), + centerPos.getZ()); + BlockState WALLPAPER = wallpaper.getDefaultState(); + BlockState TORN_WALLPAPER_1; + BlockState TORN_WALLPAPER_2; + BlockState TORN_WALLPAPER_3; + BlockState TORN_WALLPAPER_4; + if (tornWallpaper != null) { + TORN_WALLPAPER_1 = tornWallpaper.getDefaultState().with(TornWallpaper.TORN_LEVEL, 1); + TORN_WALLPAPER_2 = tornWallpaper.getDefaultState().with(TornWallpaper.TORN_LEVEL, 2); + TORN_WALLPAPER_3 = tornWallpaper.getDefaultState().with(TornWallpaper.TORN_LEVEL, 3); + TORN_WALLPAPER_4 = tornWallpaper.getDefaultState().with(TornWallpaper.TORN_LEVEL, 4); + } else { + TORN_WALLPAPER_1 = wallpaper.getDefaultState(); + TORN_WALLPAPER_2 = wallpaper.getDefaultState(); + TORN_WALLPAPER_3 = wallpaper.getDefaultState(); + TORN_WALLPAPER_4 = wallpaper.getDefaultState(); + } + BlockState STAIRS = stair; + BlockState CARPET = floor.getDefaultState(); + BlockState MOLDY_CARPET; + if (floorAlternative != null) { + MOLDY_CARPET = floorAlternative; + } else { + MOLDY_CARPET = floor.getDefaultState(); + } + BlockState LIGHT; + if (lightsOn) { + LIGHT = Backrooms.LIGHT.getDefaultState(); + } else { + LIGHT = Backrooms.LIGHT.getDefaultState().with(Light.ON, false); + } + + for (int y = 0; y < slice.length; y++) { + for (int z = 0; z < slice[0].length; z++) { + int sliceBlock = slice[y][z]; + + if (((world.getBlockState(currentPosition).getBlock() == Backrooms.WALL) + || (world.getBlockState(currentPosition).getBlock() == Blocks.BEDROCK)) + && (world.getBlockState(currentPosition).getBlock() != Backrooms.CARPET_STAIRS)) { + + if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { + RoomArchives.door1 = true; + } else { + RoomArchives.door1 = false; + } + if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { + RoomArchives.door2 = true; + } else { + RoomArchives.door2 = false; + } + if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { + RoomArchives.door3 = true; + } else { + RoomArchives.door3 = false; + } + if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) { + RoomArchives.door4 = true; + } else { + RoomArchives.door4 = false; + } + + switch (sliceBlock) { + case 0: + break; + case 2: + world.setBlockState(currentPosition, SOUTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); + } + break; + case 11: + world.setBlockState(currentPosition, NORTH_TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); + } + break; + case 12: + world.setBlockState(currentPosition, TILE, 2); + if (world.getBlockState(currentPosition.add(0, -1, 0)) == AIR && rand.nextDouble() < 0.25) { + world.setBlockState(currentPosition.add(0, -1, 0), VENT, 2); + } + break; + case 3: + world.setBlockState(currentPosition, LIGHT, 2); + break; + case 4: + world.setBlockState(currentPosition, AIR, 2); + break; + case 5: + if (rand.nextDouble() < 0.005) { + int k = rand.nextInt(4); + switch (k) { + case 0: + world.setBlockState(currentPosition, TORN_WALLPAPER_1, 2); + break; + case 1: + world.setBlockState(currentPosition, TORN_WALLPAPER_2, 2); + break; + case 2: + world.setBlockState(currentPosition, TORN_WALLPAPER_3, 2); + break; + case 3: + world.setBlockState(currentPosition, TORN_WALLPAPER_4, 2); + break; + } + } else { + world.setBlockState(currentPosition, WALLPAPER, 2); + } + break; + case 6: + if (door1) { + world.setBlockState(currentPosition, AIR, 2); + world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 2); + if (BackroomsConfig.getInstance().TallDoors) { + world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + } + } else { + world.setBlockState(currentPosition, WALLPAPER, 2); + } + break; + case 7: + if (door2) { + world.setBlockState(currentPosition, AIR, 3); + world.setBlockState(currentPosition.add(0, 1, 0), AIR, 3); + world.setBlockState(currentPosition.add(0, 2, 0), AIR, 3); + world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 3); + world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 3); + world.setBlockState(currentPosition.add(0, 0, -1), AIR, 3); + world.setBlockState(currentPosition.add(0, 1, -1), AIR, 3); + world.setBlockState(currentPosition.add(0, 2, -1), AIR, 3); + world.setBlockState(currentPosition.add(-1, 0, -1), AIR, 3); + world.setBlockState(currentPosition.add(-1, 1, -1), AIR, 3); + world.setBlockState(currentPosition.add(-1, 2, -1), AIR, 3); + if (BackroomsConfig.getInstance().TallDoors) { + world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 3, -1), AIR, 2); + } + if (rand.nextDouble() < BackroomsConfig.getInstance().VBDoor) { + world.setBlockState(currentPosition, VOID_BLOCK, 3); + world.setBlockState(currentPosition.add(0, 1, 0), VOID_BLOCK, 3); + world.setBlockState(currentPosition.add(0, 2, 0), VOID_BLOCK, 3); + world.setBlockState(currentPosition.add(-1, 0, 0), VOID_BLOCK, 3); + world.setBlockState(currentPosition.add(-1, 1, 0), VOID_BLOCK, 3); + world.setBlockState(currentPosition.add(-1, 2, 0), VOID_BLOCK, 3); + if (BackroomsConfig.getInstance().TallDoors) { + world.setBlockState(currentPosition.add(0, 3, 0), VOID_BLOCK, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), VOID_BLOCK, 2); + } + } else { + world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 3); + } + + } else { + world.setBlockState(currentPosition, WALLPAPER, 2); + } + break; + case 8: + if (door3) { + world.setBlockState(currentPosition, AIR, 3); + world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 0, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 1, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 2, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 0, 1), AIR, 2); + world.setBlockState(currentPosition.add(0, 1, 1), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, 1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 0, 1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 1, 1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 2, 1), AIR, 2); + if (BackroomsConfig.getInstance().TallDoors) { + world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(-1, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, 1), AIR, 2); + world.setBlockState(currentPosition.add(-1, 3, 1), AIR, 2); + } + } else { + world.setBlockState(currentPosition, WALLPAPER, 2); + } + break; + case 9: + if (door4) { + world.setBlockState(currentPosition, AIR, 2); + world.setBlockState(currentPosition.add(0, 1, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 0, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 1, -1), AIR, 2); + world.setBlockState(currentPosition.add(0, 2, -1), AIR, 2); + world.setBlockState(currentPosition.add(1, 0, 0), AIR, 2); + world.setBlockState(currentPosition.add(1, 1, 0), AIR, 2); + world.setBlockState(currentPosition.add(1, 2, 0), AIR, 2); + world.setBlockState(currentPosition.add(1, 0, -1), AIR, 2); + world.setBlockState(currentPosition.add(1, 1, -1), AIR, 2); + world.setBlockState(currentPosition.add(1, 2, -1), AIR, 2); + if (BackroomsConfig.getInstance().TallDoors) { + world.setBlockState(currentPosition.add(0, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(0, 3, -1), AIR, 2); + world.setBlockState(currentPosition.add(1, 3, 0), AIR, 2); + world.setBlockState(currentPosition.add(1, 3, -1), AIR, 2); + } + } else { + world.setBlockState(currentPosition, WALLPAPER, 2); + } + break; + case 10: + world.setBlockState(currentPosition, STAIRS, 2); + break; + case 1: + if (rand.nextDouble() < 0.01) { + world.setBlockState(currentPosition, MOLDY_CARPET, 2); + } else { + world.setBlockState(currentPosition, CARPET, 2); + } + + if (rand.nextDouble() < 0.001) { + if (rand.nextDouble() < BackroomsConfig.getInstance().ChestSpawnChance) { + world.setBlockState(currentPosition.add(0, 1, 0), CHEST, 2); + LootableContainerBlockEntity.setLootTable(world, rand, currentPosition.add(0, 1, 0), + Backrooms.LEVEL0CHEST); + } + } + break; + } + } + currentPosition.move(Direction.SOUTH); + } + currentPosition.move(0, -1, -slice[0].length); + } + } +} diff --git a/src/main/java/net/ludocrypt/backrooms/misc/BackroomsSoundEvents.java b/src/main/java/net/ludocrypt/backrooms/misc/BackroomsSoundEvents.java index 1ea4980..cf70c23 100644 --- a/src/main/java/net/ludocrypt/backrooms/misc/BackroomsSoundEvents.java +++ b/src/main/java/net/ludocrypt/backrooms/misc/BackroomsSoundEvents.java @@ -22,10 +22,12 @@ public class BackroomsSoundEvents { public static final SoundEvent MUSIC_DISC_BURGERS_AND_FRIES = register("backrooms:music_disc.burgers_and_fries"); public static final SoundEvent MUSIC_DISC_PRETZELS_AND_CHEESE = register("backrooms:music_disc.pretzels_and_cheese"); public static final SoundEvent TONE = register("backrooms:tone"); - public static final SoundEvent LEVEL0AMBIENCE = register("backrooms:level.0.ambience"); public static final SoundEvent GULP = register("backrooms:gulp"); - public static final SoundEvent BUZZ = register("backrooms:buzz"); public static final SoundEvent TEAR = register("backrooms:tear"); + public static final SoundEvent VENT = register("backrooms:vent"); + public static final SoundEvent SIZZLE = register("backrooms:sizzle"); + public static final SoundEvent HUMM_BUZZ_AROUND = register("backrooms:humm_buzz_around"); + public static final SoundEvent HUMM_BUZZ = register("backrooms:humm_buzz"); private static SoundEvent register(String id) { return (SoundEvent) Registry.register(Registry.SOUND_EVENT, (String) id, new SoundEvent(new Identifier(id))); diff --git a/src/main/java/net/ludocrypt/backrooms/misc/BuzzHandler.java b/src/main/java/net/ludocrypt/backrooms/misc/BuzzHandler.java new file mode 100644 index 0000000..69bb1a7 --- /dev/null +++ b/src/main/java/net/ludocrypt/backrooms/misc/BuzzHandler.java @@ -0,0 +1,79 @@ +package net.ludocrypt.backrooms.misc; + +import java.util.Random; + +import net.ludocrypt.backrooms.Backrooms; +import net.ludocrypt.backrooms.blocks.Light; +import net.ludocrypt.backrooms.config.BackroomsConfig; +import net.ludocrypt.backrooms.dimension.BDimension; +import net.ludocrypt.backrooms.mixin.WorldAccessor; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.Camera; +import net.minecraft.client.render.WorldRenderer; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.math.BlockPos; + +public class BuzzHandler { + + public static void buzzCheckingAndRunning(Camera cam, MinecraftClient client, WorldRenderer worldRenderer, + ClientWorld world) { + int rainTime = ((WorldAccessor) worldRenderer).rainSoundTime() == 0 ? 1 + : ((WorldAccessor) worldRenderer).rainSoundTime(); + long ticks = ((WorldAccessor) worldRenderer).ticks(); + BlockPos playerPos = cam.getBlockPos(); + int radius = BackroomsConfig.getInstance().SearchRange; + Random random = new Random(ticks * 312987231L); + + int numOfLight = 0; + BlockPos posOfLight = null; + int numOfVent = 0; + BlockPos posOfVent = null; + for (double x = playerPos.getX() - radius; x <= playerPos.getX() + radius; x++) { + for (double y = playerPos.getY() - radius; y <= playerPos.getY() + radius; y++) { + for (double z = playerPos.getZ() - radius; z <= playerPos.getZ() + radius; z++) { + BlockPos pos = new BlockPos(x, y, z); + if (world.getBlockState(pos) == Backrooms.LIGHT.getDefaultState().with(Light.ON, true)) { + numOfLight = numOfLight + 1; + if (numOfLight == 1) { + posOfLight = pos; + } + } + if (world.getBlockState(pos).getBlock() == Backrooms.VENT) { + numOfVent = numOfVent + 1; + if (numOfVent == 1) { + posOfVent = pos; + } + } + } + } + } + if (random.nextInt(3) < rainTime++ && !client.isPaused()) { + rainTime = 0; + SoundEvent buzz = BackroomsSoundEvents.HUMM_BUZZ; + if (client.player.isSubmergedInWater()) { + buzz = BackroomsSoundEvents.HUMM_BUZZ_AROUND; + } else { + buzz = BackroomsSoundEvents.HUMM_BUZZ; + } + if (numOfLight > 1) { + world.playSound(cam.getBlockPos(), buzz, SoundCategory.AMBIENT, 0.1F, 1.0F, false); + } else if (numOfLight == 1 && posOfLight != null) { + world.playSound(posOfLight, buzz, SoundCategory.AMBIENT, 0.1F, 1.0F, false); + } + if (numOfVent > 1) { + world.playSound(cam.getBlockPos(), BackroomsSoundEvents.VENT, SoundCategory.AMBIENT, 0.25F, 1.0F, + false); + } else if (numOfVent == 1 && posOfVent != null) { + world.playSound(posOfVent, BackroomsSoundEvents.VENT, SoundCategory.AMBIENT, 0.25F, 1.0F, false); + } + if ((world.getRegistryKey() == BDimension.LEVEL0WORLD || world.getRegistryKey() == BDimension.LEVEL1WORLD) + && numOfLight == 0) { + world.playSound(cam.getBlockPos(), BackroomsSoundEvents.HUMM_BUZZ_AROUND, SoundCategory.AMBIENT, 0.05F, + 0.8F, false); + } + } + } + +} diff --git a/src/main/java/net/ludocrypt/backrooms/misc/PreInitialize.java b/src/main/java/net/ludocrypt/backrooms/misc/PreInitialize.java index 64d9f46..6195621 100644 --- a/src/main/java/net/ludocrypt/backrooms/misc/PreInitialize.java +++ b/src/main/java/net/ludocrypt/backrooms/misc/PreInitialize.java @@ -2,12 +2,16 @@ import com.chocohead.mm.api.ClassTinkerers; +import net.fabricmc.loader.api.FabricLoader; +import net.fabricmc.loader.api.MappingResolver; + public interface PreInitialize { static void initialize() { - ClassTinkerers.enumBuilder("net.minecraft.world.biome.Biome$Category", String.class) - .addEnum("level0", () -> new Object[] { "level0" }).addEnum("level1", () -> new Object[] { "level1" }) - .addEnum("level2", () -> new Object[] { "level2" }).addEnum("level3", () -> new Object[] { "level3" }) - .build(); + MappingResolver remapper = FabricLoader.getInstance().getMappingResolver(); + String biomeCategory = remapper.mapClassName("intermediary", "net.minecraft.class_1959$class_1961"); + ClassTinkerers.enumBuilder(biomeCategory, String.class).addEnum("level0", () -> new Object[] { "level0" }) + .addEnum("level1", () -> new Object[] { "level1" }).addEnum("level2", () -> new Object[] { "level2" }) + .addEnum("level3", () -> new Object[] { "level3" }).build(); } } diff --git a/src/main/java/net/ludocrypt/backrooms/mixin/WorldAccessor.java b/src/main/java/net/ludocrypt/backrooms/mixin/WorldAccessor.java new file mode 100644 index 0000000..0d7e97d --- /dev/null +++ b/src/main/java/net/ludocrypt/backrooms/mixin/WorldAccessor.java @@ -0,0 +1,18 @@ +package net.ludocrypt.backrooms.mixin; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.render.WorldRenderer; + +@Environment(EnvType.CLIENT) +@Mixin(WorldRenderer.class) +public interface WorldAccessor { + @Accessor("field_20793") + public int rainSoundTime(); + + @Accessor("ticks") + public int ticks(); +} diff --git a/src/main/java/net/ludocrypt/imagereader/Layout.java b/src/main/java/net/ludocrypt/imagereader/Layout.java index f8cc9ee..dbe14f2 100644 --- a/src/main/java/net/ludocrypt/imagereader/Layout.java +++ b/src/main/java/net/ludocrypt/imagereader/Layout.java @@ -12,18 +12,15 @@ public class Layout { - public static Integer[][] getLayout(String room, int blackBlock, int whiteBlock, @Nullable int red, - @Nullable int red2, @Nullable int green, @Nullable int green2, @Nullable int blue, @Nullable int blue2, - @Nullable int purple, @Nullable int purple2) { + public static Integer[][] getLayout(String room, int blackBlock, int whiteBlock, Layout layout) { BufferedImage image; try { - image = ImageIO.read(room.getClass().getResourceAsStream("/data/backrooms/layouts/" + room + ".png")); + image = ImageIO.read(layout.getClass().getResourceAsStream("/data/backrooms/layouts/" + room + ".png")); if (image.getHeight() != 16 && image.getWidth() != 16) { return null; } else { - return Layout.compileList(image, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, purple, - purple2); + return Layout.compileList(image, blackBlock, whiteBlock); } } catch (IOException e) { e.printStackTrace(); @@ -32,9 +29,7 @@ public static Integer[][] getLayout(String room, int blackBlock, int whiteBlock, } - private static Integer[][] compileList(BufferedImage image, int blackBlock, int whiteBlock, @Nullable int red, - @Nullable int red2, @Nullable int green, @Nullable int green2, @Nullable int blue, @Nullable int blue2, - @Nullable int purple, @Nullable int purple2) { + private static Integer[][] compileList(BufferedImage image, int blackBlock, int whiteBlock) { List intList1 = new ArrayList(); List intList2 = new ArrayList(); List intList3 = new ArrayList(); @@ -55,53 +50,37 @@ private static Integer[][] compileList(BufferedImage image, int blackBlock, int for (int x = 0; x < image.getWidth(); x++) { Color c = new Color(image.getRGB(x, y)); if (y == 0) { - Layout.colorChecker(c, intList1, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList1, blackBlock, whiteBlock); } else if (y == 1) { - Layout.colorChecker(c, intList2, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList2, blackBlock, whiteBlock); } else if (y == 2) { - Layout.colorChecker(c, intList3, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList3, blackBlock, whiteBlock); } else if (y == 3) { - Layout.colorChecker(c, intList4, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList4, blackBlock, whiteBlock); } else if (y == 4) { - Layout.colorChecker(c, intList5, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList5, blackBlock, whiteBlock); } else if (y == 5) { - Layout.colorChecker(c, intList6, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList6, blackBlock, whiteBlock); } else if (y == 6) { - Layout.colorChecker(c, intList7, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList7, blackBlock, whiteBlock); } else if (y == 7) { - Layout.colorChecker(c, intList8, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList8, blackBlock, whiteBlock); } else if (y == 8) { - Layout.colorChecker(c, intList9, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList9, blackBlock, whiteBlock); } else if (y == 9) { - Layout.colorChecker(c, intList10, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList10, blackBlock, whiteBlock); } else if (y == 10) { - Layout.colorChecker(c, intList11, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList11, blackBlock, whiteBlock); } else if (y == 11) { - Layout.colorChecker(c, intList12, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList12, blackBlock, whiteBlock); } else if (y == 12) { - Layout.colorChecker(c, intList13, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList13, blackBlock, whiteBlock); } else if (y == 13) { - Layout.colorChecker(c, intList14, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList14, blackBlock, whiteBlock); } else if (y == 14) { - Layout.colorChecker(c, intList15, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList15, blackBlock, whiteBlock); } else if (y == 15) { - Layout.colorChecker(c, intList16, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, - purple, purple2); + Layout.colorChecker(c, intList16, blackBlock, whiteBlock); } } } @@ -174,19 +153,200 @@ private static Integer[][] compileList(BufferedImage image, int blackBlock, int return layout; } - public static List listLayouts(int max, String room, int blackBlock, int whiteBlock, @Nullable int red, + public static List listLayouts(int max, String room, int blackBlock, int whiteBlock, Layout layout) { + List intListList = new ArrayList(); + for (int m = 0; m <= max; m++) { + Integer[][] intList = Layout.getLayout(room + '_' + m, blackBlock, whiteBlock, layout); + intListList.add(intList); + } + return intListList; + } + + private static void colorChecker(Color c, List list, int black, int white) { + if (c.getRed() == 0 && c.getGreen() == 0 && c.getBlue() == 0) { + list.add(black); + } else { + list.add(white); + } + } + + // Colored + + public static Integer[][] getColoredLayout(String room, int blackBlock, int whiteBlock, @Nullable int red, @Nullable int red2, @Nullable int green, @Nullable int green2, @Nullable int blue, @Nullable int blue2, - @Nullable int purple, @Nullable int purple2) { + @Nullable int purple, @Nullable int purple2, Layout layout) { + + BufferedImage image; + try { + image = ImageIO.read(layout.getClass().getResourceAsStream("/data/backrooms/layouts/" + room + ".png")); + if (image.getHeight() != 16 && image.getWidth() != 16) { + return null; + } else { + return Layout.compileColoredList(image, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2, + purple, purple2); + } + } catch (IOException e) { + e.printStackTrace(); + return null; + } + + } + + private static Integer[][] compileColoredList(BufferedImage image, int blackBlock, int whiteBlock, + @Nullable int red, @Nullable int red2, @Nullable int green, @Nullable int green2, @Nullable int blue, + @Nullable int blue2, @Nullable int purple, @Nullable int purple2) { + List intList1 = new ArrayList(); + List intList2 = new ArrayList(); + List intList3 = new ArrayList(); + List intList4 = new ArrayList(); + List intList5 = new ArrayList(); + List intList6 = new ArrayList(); + List intList7 = new ArrayList(); + List intList8 = new ArrayList(); + List intList9 = new ArrayList(); + List intList10 = new ArrayList(); + List intList11 = new ArrayList(); + List intList12 = new ArrayList(); + List intList13 = new ArrayList(); + List intList14 = new ArrayList(); + List intList15 = new ArrayList(); + List intList16 = new ArrayList(); + for (int y = 0; y < image.getHeight(); y++) { + for (int x = 0; x < image.getWidth(); x++) { + Color c = new Color(image.getRGB(x, y)); + if (y == 0) { + Layout.coloredcolorChecker(c, intList1, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 1) { + Layout.coloredcolorChecker(c, intList2, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 2) { + Layout.coloredcolorChecker(c, intList3, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 3) { + Layout.coloredcolorChecker(c, intList4, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 4) { + Layout.coloredcolorChecker(c, intList5, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 5) { + Layout.coloredcolorChecker(c, intList6, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 6) { + Layout.coloredcolorChecker(c, intList7, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 7) { + Layout.coloredcolorChecker(c, intList8, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 8) { + Layout.coloredcolorChecker(c, intList9, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 9) { + Layout.coloredcolorChecker(c, intList10, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 10) { + Layout.coloredcolorChecker(c, intList11, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 11) { + Layout.coloredcolorChecker(c, intList12, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 12) { + Layout.coloredcolorChecker(c, intList13, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 13) { + Layout.coloredcolorChecker(c, intList14, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 14) { + Layout.coloredcolorChecker(c, intList15, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } else if (y == 15) { + Layout.coloredcolorChecker(c, intList16, blackBlock, whiteBlock, red, red2, green, green2, blue, + blue2, purple, purple2); + } + } + } + Integer[][] layout = { + { intList1.get(1 - 1), intList1.get(2 - 1), intList1.get(3 - 1), intList1.get(4 - 1), + intList1.get(5 - 1), intList1.get(6 - 1), intList1.get(7 - 1), intList1.get(8 - 1), + intList1.get(9 - 1), intList1.get(10 - 1), intList1.get(11 - 1), intList1.get(12 - 1), + intList1.get(13 - 1), intList1.get(14 - 1), intList1.get(15 - 1), intList1.get(16 - 1) }, + { intList2.get(1 - 1), intList2.get(2 - 1), intList2.get(3 - 1), intList2.get(4 - 1), + intList2.get(5 - 1), intList2.get(6 - 1), intList2.get(7 - 1), intList2.get(8 - 1), + intList2.get(9 - 1), intList2.get(10 - 1), intList2.get(11 - 1), intList2.get(12 - 1), + intList2.get(13 - 1), intList2.get(14 - 1), intList2.get(15 - 1), intList2.get(16 - 1) }, + { intList3.get(1 - 1), intList3.get(2 - 1), intList3.get(3 - 1), intList3.get(4 - 1), + intList3.get(5 - 1), intList3.get(6 - 1), intList3.get(7 - 1), intList3.get(8 - 1), + intList3.get(9 - 1), intList3.get(10 - 1), intList3.get(11 - 1), intList3.get(12 - 1), + intList3.get(13 - 1), intList3.get(14 - 1), intList3.get(15 - 1), intList3.get(16 - 1) }, + { intList4.get(1 - 1), intList4.get(2 - 1), intList4.get(3 - 1), intList4.get(4 - 1), + intList4.get(5 - 1), intList4.get(6 - 1), intList4.get(7 - 1), intList4.get(8 - 1), + intList4.get(9 - 1), intList4.get(10 - 1), intList4.get(11 - 1), intList4.get(12 - 1), + intList4.get(13 - 1), intList4.get(14 - 1), intList4.get(15 - 1), intList4.get(16 - 1) }, + { intList5.get(1 - 1), intList5.get(2 - 1), intList5.get(3 - 1), intList5.get(4 - 1), + intList5.get(5 - 1), intList5.get(6 - 1), intList5.get(7 - 1), intList5.get(8 - 1), + intList5.get(9 - 1), intList5.get(10 - 1), intList5.get(11 - 1), intList5.get(12 - 1), + intList5.get(13 - 1), intList5.get(14 - 1), intList5.get(15 - 1), intList5.get(16 - 1) }, + { intList6.get(1 - 1), intList6.get(2 - 1), intList6.get(3 - 1), intList6.get(4 - 1), + intList6.get(5 - 1), intList6.get(6 - 1), intList6.get(7 - 1), intList6.get(8 - 1), + intList6.get(9 - 1), intList6.get(10 - 1), intList6.get(11 - 1), intList6.get(12 - 1), + intList6.get(13 - 1), intList6.get(14 - 1), intList6.get(15 - 1), intList6.get(16 - 1) }, + { intList7.get(1 - 1), intList7.get(2 - 1), intList7.get(3 - 1), intList7.get(4 - 1), + intList7.get(5 - 1), intList7.get(6 - 1), intList7.get(7 - 1), intList7.get(8 - 1), + intList7.get(9 - 1), intList7.get(10 - 1), intList7.get(11 - 1), intList7.get(12 - 1), + intList7.get(13 - 1), intList7.get(14 - 1), intList7.get(15 - 1), intList7.get(16 - 1) }, + { intList8.get(1 - 1), intList8.get(2 - 1), intList8.get(3 - 1), intList8.get(4 - 1), + intList8.get(5 - 1), intList8.get(6 - 1), intList8.get(7 - 1), intList8.get(8 - 1), + intList8.get(9 - 1), intList8.get(10 - 1), intList8.get(11 - 1), intList8.get(12 - 1), + intList8.get(13 - 1), intList8.get(14 - 1), intList8.get(15 - 1), intList8.get(16 - 1) }, + { intList9.get(1 - 1), intList9.get(2 - 1), intList9.get(3 - 1), intList9.get(4 - 1), + intList9.get(5 - 1), intList9.get(6 - 1), intList9.get(7 - 1), intList9.get(8 - 1), + intList9.get(9 - 1), intList9.get(10 - 1), intList9.get(11 - 1), intList9.get(12 - 1), + intList9.get(13 - 1), intList9.get(14 - 1), intList9.get(15 - 1), intList9.get(16 - 1) }, + { intList10.get(1 - 1), intList10.get(2 - 1), intList10.get(3 - 1), intList10.get(4 - 1), + intList10.get(5 - 1), intList10.get(6 - 1), intList10.get(7 - 1), intList10.get(8 - 1), + intList10.get(9 - 1), intList10.get(10 - 1), intList10.get(11 - 1), intList10.get(12 - 1), + intList10.get(13 - 1), intList10.get(14 - 1), intList10.get(15 - 1), intList10.get(16 - 1) }, + { intList11.get(1 - 1), intList11.get(2 - 1), intList11.get(3 - 1), intList11.get(4 - 1), + intList11.get(5 - 1), intList11.get(6 - 1), intList11.get(7 - 1), intList11.get(8 - 1), + intList11.get(9 - 1), intList11.get(10 - 1), intList11.get(11 - 1), intList11.get(12 - 1), + intList11.get(13 - 1), intList11.get(14 - 1), intList11.get(15 - 1), intList11.get(16 - 1) }, + { intList12.get(1 - 1), intList12.get(2 - 1), intList12.get(3 - 1), intList12.get(4 - 1), + intList12.get(5 - 1), intList12.get(6 - 1), intList12.get(7 - 1), intList12.get(8 - 1), + intList12.get(9 - 1), intList12.get(10 - 1), intList12.get(11 - 1), intList12.get(12 - 1), + intList12.get(13 - 1), intList12.get(14 - 1), intList12.get(15 - 1), intList12.get(16 - 1) }, + { intList13.get(1 - 1), intList13.get(2 - 1), intList13.get(3 - 1), intList13.get(4 - 1), + intList13.get(5 - 1), intList13.get(6 - 1), intList13.get(7 - 1), intList13.get(8 - 1), + intList13.get(9 - 1), intList13.get(10 - 1), intList13.get(11 - 1), intList13.get(12 - 1), + intList13.get(13 - 1), intList13.get(14 - 1), intList13.get(15 - 1), intList13.get(16 - 1) }, + { intList14.get(1 - 1), intList14.get(2 - 1), intList14.get(3 - 1), intList14.get(4 - 1), + intList14.get(5 - 1), intList14.get(6 - 1), intList14.get(7 - 1), intList14.get(8 - 1), + intList14.get(9 - 1), intList14.get(10 - 1), intList14.get(11 - 1), intList14.get(12 - 1), + intList14.get(13 - 1), intList14.get(14 - 1), intList14.get(15 - 1), intList14.get(16 - 1) }, + { intList15.get(1 - 1), intList15.get(2 - 1), intList15.get(3 - 1), intList15.get(4 - 1), + intList15.get(5 - 1), intList15.get(6 - 1), intList15.get(7 - 1), intList15.get(8 - 1), + intList15.get(9 - 1), intList15.get(10 - 1), intList15.get(11 - 1), intList15.get(12 - 1), + intList15.get(13 - 1), intList15.get(14 - 1), intList15.get(15 - 1), intList15.get(16 - 1) }, + { intList16.get(1 - 1), intList16.get(2 - 1), intList16.get(3 - 1), intList16.get(4 - 1), + intList16.get(5 - 1), intList16.get(6 - 1), intList16.get(7 - 1), intList16.get(8 - 1), + intList16.get(9 - 1), intList16.get(10 - 1), intList16.get(11 - 1), intList16.get(12 - 1), + intList16.get(13 - 1), intList16.get(14 - 1), intList16.get(15 - 1), intList16.get(16 - 1) } }; + + return layout; + } + + public static List listColoredLayouts(int max, String room, int blackBlock, int whiteBlock, + @Nullable int red, @Nullable int red2, @Nullable int green, @Nullable int green2, @Nullable int blue, + @Nullable int blue2, @Nullable int purple, @Nullable int purple2, Layout layout) { List intListList = new ArrayList(); for (int m = 0; m <= max; m++) { - Integer[][] intList = Layout.getLayout(room + '_' + m, blackBlock, whiteBlock, red, red2, green, green2, - blue, blue2, purple, purple2); + Integer[][] intList = Layout.getColoredLayout(room + '_' + m, blackBlock, whiteBlock, red, red2, green, + green2, blue, blue2, purple, purple2, layout); intListList.add(intList); } return intListList; } - private static void colorChecker(Color c, List list, int black, int white, @Nullable int red, + private static void coloredcolorChecker(Color c, List list, int black, int white, @Nullable int red, @Nullable int red2, @Nullable int green, @Nullable int green2, @Nullable int blue, @Nullable int blue2, @Nullable int purple, @Nullable int purple2) { if (c.getRed() == 0 && c.getGreen() == 0 && c.getBlue() == 255) { diff --git a/src/main/resources/assets/backrooms/lang/en_us.json b/src/main/resources/assets/backrooms/lang/en_us.json index 7d43e79..db73912 100644 --- a/src/main/resources/assets/backrooms/lang/en_us.json +++ b/src/main/resources/assets/backrooms/lang/en_us.json @@ -136,12 +136,14 @@ "text.autoconfig.backrooms.title": "Backrooms Configurations", "text.autoconfig.backrooms.option.Level0DoorChance": "Chance for door to appear in level 0", "text.autoconfig.backrooms.option.Level1DoorChance": "Chance for door to appear in level 1", + "text.autoconfig.backrooms.option.Level3DoorChance": "Chance for door to appear in level 3", "text.autoconfig.backrooms.option.Level0LayerCount": "How many Layers in level 0", "text.autoconfig.backrooms.option.Level1LayerCount": "How many Layers in level 1", "text.autoconfig.backrooms.option.VBDoor": "Chance for the void block to appear in a door", "text.autoconfig.backrooms.option.EnderPearlChance": "Chance for an enderpearl", "text.autoconfig.backrooms.option.SuffocationChance": "Chance for suffocation", "text.autoconfig.backrooms.option.ChestSpawnChance": "Chance for a chest to spawn", + "text.autoconfig.backrooms.option.SearchRange": "Search Range For Noise Making Blocks", "text.autoconfig.backrooms.option.ForceLevel0": "Forces title screen to stay as Level 0", "text.autoconfig.backrooms.option.ForceLevel1": "Forces title screen to stay as Level 1", "text.autoconfig.backrooms.option.ForceLevel2": "Forces title screen to stay as Level 2", diff --git a/src/main/resources/assets/backrooms/sounds.json b/src/main/resources/assets/backrooms/sounds.json index 5cc3b0e..e701dcb 100644 --- a/src/main/resources/assets/backrooms/sounds.json +++ b/src/main/resources/assets/backrooms/sounds.json @@ -248,81 +248,80 @@ } ] }, - "buzz": { + "humm_buzz": { "sounds": [ { - "name": "backrooms:buzz" - } - ] - }, - "gulp": { - "sounds": [ + "name": "backrooms:level_noise/buzz1" + }, { - "name": "backrooms:gulp/gulp1" + "name": "backrooms:level_noise/buzz2" }, { - "name": "backrooms:gulp/gulp2" + "name": "backrooms:level_noise/buzz3" }, { - "name": "backrooms:gulp/gulp3" + "name": "backrooms:level_noise/buzz4" } ] }, - "level.0.ambience": { + "humm_buzz_around": { "sounds": [ { - "name": "backrooms:ambient/breath1" + "name": "backrooms:level_noise/buzz_around1" }, { - "name": "backrooms:ambient/breath2" + "name": "backrooms:level_noise/buzz_around2" }, { - "name": "backrooms:ambient/breath3" + "name": "backrooms:level_noise/buzz_around3" }, { - "name": "backrooms:ambient/breath4" - }, - { - "name": "backrooms:ambient/harp1" - }, - { - "name": "backrooms:ambient/harp2" - }, - { - "name": "backrooms:ambient/harp3" - }, + "name": "backrooms:level_noise/buzz_around4" + } + ] + }, + "vent": { + "sounds": [ { - "name": "backrooms:ambient/knock1" + "name": "backrooms:level_noise/vent1" }, { - "name": "backrooms:ambient/knock2" + "name": "backrooms:level_noise/vent2" }, { - "name": "backrooms:ambient/knock3" + "name": "backrooms:level_noise/vent3" }, { - "name": "backrooms:ambient/synth1" - }, + "name": "backrooms:level_noise/vent4" + } + ] + }, + "sizzle": { + "sounds": [ { - "name": "backrooms:ambient/synth2" + "name": "backrooms:level_noise/sizzle1" }, { - "name": "backrooms:ambient/synth3" + "name": "backrooms:level_noise/sizzle2" }, { - "name": "backrooms:ambient/tone1" + "name": "backrooms:level_noise/sizzle3" }, { - "name": "backrooms:ambient/tone2" - }, + "name": "backrooms:level_noise/sizzle4" + } + ] + }, + "gulp": { + "sounds": [ { - "name": "backrooms:ambient/tone3" + "name": "backrooms:gulp/gulp1" }, { - "name": "backrooms:ambient/tone4" + "name": "backrooms:gulp/gulp2" }, { - "name": "backrooms:ambient/whistle1" + "name": "backrooms:gulp/gulp3" } ] } diff --git a/src/main/resources/backrooms.mixins.json b/src/main/resources/backrooms.mixins.json index 8e51f94..68efe34 100644 --- a/src/main/resources/backrooms.mixins.json +++ b/src/main/resources/backrooms.mixins.json @@ -10,7 +10,8 @@ "client": [ "BuiltinModelItemRendererMixin", "MusicMixin", - "TitleScreenMixin" + "TitleScreenMixin", + "WorldAccessor" ], "injectors": { "defaultRequire": 1 diff --git a/src/main/resources/data/backrooms/advancements/dottedredrooms.json b/src/main/resources/data/backrooms/advancements/dottedredrooms.json index 3552a5d..c3834b5 100644 --- a/src/main/resources/data/backrooms/advancements/dottedredrooms.json +++ b/src/main/resources/data/backrooms/advancements/dottedredrooms.json @@ -15,13 +15,18 @@ "hidden": false }, "criteria": { - "level0": { + "level0dottedred": { "trigger": "minecraft:location", "conditions": { "biome": "backrooms:level0dottedred" } } }, + "requirements": [ + [ + "level0dottedred" + ] + ], "rewards": { "experience": 10 }, diff --git a/src/main/resources/data/backrooms/advancements/dottedrooms.json b/src/main/resources/data/backrooms/advancements/dottedrooms.json index b6f53ba..26b097d 100644 --- a/src/main/resources/data/backrooms/advancements/dottedrooms.json +++ b/src/main/resources/data/backrooms/advancements/dottedrooms.json @@ -15,13 +15,18 @@ "hidden": false }, "criteria": { - "level0": { + "level0dotted": { "trigger": "minecraft:location", "conditions": { "biome": "backrooms:level0dotted" } } }, + "requirements": [ + [ + "level0dotted" + ] + ], "rewards": { "experience": 10 }, diff --git a/src/main/resources/data/backrooms/advancements/level1off.json b/src/main/resources/data/backrooms/advancements/level1off.json index 49f3743..4002564 100644 --- a/src/main/resources/data/backrooms/advancements/level1off.json +++ b/src/main/resources/data/backrooms/advancements/level1off.json @@ -15,7 +15,7 @@ "hidden": false }, "criteria": { - "level0": { + "level1off": { "trigger": "minecraft:location", "conditions": { "biome": "backrooms:level1off", @@ -28,6 +28,11 @@ } } }, + "requirements": [ + [ + "level1off" + ] + ], "rewards": { "experience": 10 }, diff --git a/src/main/resources/data/backrooms/advancements/level2long.json b/src/main/resources/data/backrooms/advancements/level2long.json index 3db2736..6a491bc 100644 --- a/src/main/resources/data/backrooms/advancements/level2long.json +++ b/src/main/resources/data/backrooms/advancements/level2long.json @@ -15,13 +15,18 @@ "hidden": false }, "criteria": { - "level0": { + "level2long": { "trigger": "minecraft:location", "conditions": { "biome": "backrooms:level2long" } } }, + "requirements": [ + [ + "level2long" + ] + ], "rewards": { "experience": 10 }, diff --git a/src/main/resources/data/backrooms/advancements/level2messy.json b/src/main/resources/data/backrooms/advancements/level2messy.json index 2792515..43f6a42 100644 --- a/src/main/resources/data/backrooms/advancements/level2messy.json +++ b/src/main/resources/data/backrooms/advancements/level2messy.json @@ -15,13 +15,18 @@ "hidden": false }, "criteria": { - "level0": { + "level2messy": { "trigger": "minecraft:location", "conditions": { "biome": "backrooms:level2messy" } } }, + "requirements": [ + [ + "level2messy" + ] + ], "rewards": { "experience": 10 }, diff --git a/src/main/resources/data/backrooms/advancements/redrooms.json b/src/main/resources/data/backrooms/advancements/redrooms.json index f2cd910..f221014 100644 --- a/src/main/resources/data/backrooms/advancements/redrooms.json +++ b/src/main/resources/data/backrooms/advancements/redrooms.json @@ -15,13 +15,18 @@ "hidden": false }, "criteria": { - "level0": { + "level0red": { "trigger": "minecraft:location", "conditions": { "biome": "backrooms:level0red" } } }, + "requirements": [ + [ + "level0red" + ] + ], "rewards": { "experience": 10 }, diff --git a/src/main/resources/data/backrooms/dimension/level_0.json b/src/main/resources/data/backrooms/dimension/level_0.json index 576aeee..9b72b0c 100644 --- a/src/main/resources/data/backrooms/dimension/level_0.json +++ b/src/main/resources/data/backrooms/dimension/level_0.json @@ -34,6 +34,286 @@ "humidity": 0.0 }, "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.0, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.0, + "humidity": 0.0 + }, + "biome": "backrooms:level0decrepit" + }, + { + "parameters": { + "altitude": 0.1, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.1, + "humidity": 0.1 + }, + "biome": "backrooms:level0decrepit" + }, + { + "parameters": { + "altitude": 0.2, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.2, + "humidity": 0.2 + }, + "biome": "backrooms:level0decrepit" + }, + { + "parameters": { + "altitude": 0.5, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.5 + }, + "biome": "backrooms:level0decrepit" + }, + { + "parameters": { + "altitude": 0.5, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.5 + }, + "biome": "backrooms:level0dotted" + }, + { + "parameters": { + "altitude": 0.5, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.5 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.0, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.5 + }, + "biome": "backrooms:level0red" + }, + { + "parameters": { + "altitude": 0.1, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.4, + "humidity": 0.5 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.1, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.4, + "humidity": 0.3 + }, + "biome": "backrooms:level0dotted" + }, + { + "parameters": { + "altitude": 0.2, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.4, + "humidity": 0.5 + }, + "biome": "backrooms:level0dotted" + }, + { + "parameters": { + "altitude": 0.2, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.5 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.1, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.3, + "humidity": 0.4 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.2, + "humidity": 0.5 + }, + "biome": "backrooms:level0dotted" + }, + { + "parameters": { + "altitude": 0.2, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.4 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.1, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.4 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.0, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.4, + "humidity": 0.5 + }, + "biome": "backrooms:level0dotted" + }, + { + "parameters": { + "altitude": 0.0, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.2, + "humidity": 0.3 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.1, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.4, + "humidity": 0.6 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.0, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.5, + "humidity": 0.0 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.0, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.5, + "humidity": 0.0 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.0, + "humidity": 0.4 + }, + "biome": "backrooms:level0dottedred" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.0, + "humidity": 0.4 + }, + "biome": "backrooms:level0dotted" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.0, + "humidity": 0.4 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.0, + "humidity": 0.4 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.0, + "humidity": 0.4 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.0, + "humidity": 0.4 + }, + "biome": "backrooms:level0dotted" + }, + { + "parameters": { + "altitude": 0.6, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 1.0, + "humidity": 0.4 + }, + "biome": "backrooms:level0" + }, + { + "parameters": { + "altitude": 0.0, + "weirdness": 0.0, + "offset": 0.0, + "temperature": 0.5, + "humidity": 0.0 + }, + "biome": "backrooms:level0" } ], "temperature_noise": { diff --git a/src/main/resources/data/backrooms/layouts/allcolors.png b/src/main/resources/data/backrooms/layouts/guide.png similarity index 100% rename from src/main/resources/data/backrooms/layouts/allcolors.png rename to src/main/resources/data/backrooms/layouts/guide.png diff --git a/src/main/resources/data/backrooms/layouts/level01_0.png b/src/main/resources/data/backrooms/layouts/level01_0.png new file mode 100644 index 0000000000000000000000000000000000000000..2d479985a86c8cf94f9949f38e1e90faab4731eb GIT binary patch literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBuf-vKbiP>*~f@+>Fjv*HQ$qJ$dOdtRM|F0<1)G%@4M9xzx lQaxD;Y&}^E7!wj07*~g6f_wjv*HQ$qJ$dOdtRM|F0;ckdTscq5)6T-IAxApsx<*>VeoYIb6Mw<&;$T`!X~Ex literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_10.png b/src/main/resources/data/backrooms/layouts/level01_10.png new file mode 100644 index 0000000000000000000000000000000000000000..3a24866eabb59289c4a97345d60d8411c0839a4d GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF*R=maf(O99Ok&&TgH|x|LlaBiUH86O(`njxgN@xNAE_EsX literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_12.png b/src/main/resources/data/backrooms/layouts/level01_12.png new file mode 100644 index 0000000000000000000000000000000000000000..e9be4f3fbdbe1e29c515a39b33770f6e7406adea GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFLPbG3)O=cnnm=;OXk;vd$@?2>_~cC({4` literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_14.png b/src/main/resources/data/backrooms/layouts/level01_14.png new file mode 100644 index 0000000000000000000000000000000000000000..85b7362ef837dda03b9e3fd17420fbad23d17df8 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF|{E!NT*(8$Qh!^5z+oK5icY5QQHLIzJ)KbLh*2~7a;7bg<{ literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_16.png b/src/main/resources/data/backrooms/layouts/level01_16.png new file mode 100644 index 0000000000000000000000000000000000000000..84972aa0cded70d8ed66dfd00bd04da119384933 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF*J!52PH}I36TBFfcPS6m4b=yigeG1=PXd>FVdQ&MBb@0Hxe3 Ac>n+a literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_17.png b/src/main/resources/data/backrooms/layouts/level01_17.png new file mode 100644 index 0000000000000000000000000000000000000000..a770c4e6ff9932a2e0cf1c7107293266d45d2038 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFbP0l+XkKQY|VV literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_18.png b/src/main/resources/data/backrooms/layouts/level01_18.png new file mode 100644 index 0000000000000000000000000000000000000000..55bfbf42a7ea61dc46149b3cceff660b722d6cd9 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFzopr01s~}3;+NC literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_19.png b/src/main/resources/data/backrooms/layouts/level01_19.png new file mode 100644 index 0000000000000000000000000000000000000000..db04d727f658b597e29d50c952f35a35df33184b GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFVMX9JZpc)I$ztaD0e0s!!6DZKyy literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_2.png b/src/main/resources/data/backrooms/layouts/level01_2.png new file mode 100644 index 0000000000000000000000000000000000000000..4e36183f71fcf8f3c5ae813169b25bbe2994294b GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFoy{Q{SoHzX(*$;OXk;vd$@?2>=(JD-Zwx literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_21.png b/src/main/resources/data/backrooms/layouts/level01_21.png new file mode 100644 index 0000000000000000000000000000000000000000..9881e3ff31de37e313dfa2583af3169ccf2c775c GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFFVdQ&MBb@0M;uh>Hq)$ literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_22.png b/src/main/resources/data/backrooms/layouts/level01_22.png new file mode 100644 index 0000000000000000000000000000000000000000..c2480295aa004642bc125952d45482b6f774469c GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFJ0!vt2=sXpw!(LkjPp00i_>zopr04?z*KmY&$ literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_24.png b/src/main/resources/data/backrooms/layouts/level01_24.png new file mode 100644 index 0000000000000000000000000000000000000000..b4a0191765d60048fe219a8e064fce04116e932c GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFi{v!z2I?SKi#A(sLpg@#5(hW68}f!i3i832_tc)I$ztaD0e0stGODun<5 literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_25.png b/src/main/resources/data/backrooms/layouts/level01_25.png new file mode 100644 index 0000000000000000000000000000000000000000..bbdfe5d94539140e3409adaeaa580804f1d9e346 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sEXgD|57Yp@DX(8SZlF~q_@SwYl*>Er+Z{}p9?4xBjAp~L;e z$Z@6%^Q~+JNr4Y0QWDGNxphaG80grXJ;1=gF^gZ!@0@EgP(OpGtDnm{r-UW|Ibtd2 literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_26.png b/src/main/resources/data/backrooms/layouts/level01_26.png new file mode 100644 index 0000000000000000000000000000000000000000..0589065fa56bd83a1b40e8caa01b04db54c9891b GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFkipZ{&t;ucLK6VL03_G| literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_7.png b/src/main/resources/data/backrooms/layouts/level01_7.png new file mode 100644 index 0000000000000000000000000000000000000000..ec8b5d9e2ebc28a9b8b90edd63e74a1da210b11f GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF4xMg5g$$mqelF{r5}E+gStbVn literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_8.png b/src/main/resources/data/backrooms/layouts/level01_8.png new file mode 100644 index 0000000000000000000000000000000000000000..3d9c5bf08c259c029cea612785bcc275181c6f64 GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFgTe~DWM4f D1k@|E literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level01_9.png b/src/main/resources/data/backrooms/layouts/level01_9.png new file mode 100644 index 0000000000000000000000000000000000000000..adfb08e59f31451f62cddc74f888cd9f1a369bc9 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFFVdQ&MBb@0HkFr A@&Et; literal 0 HcmV?d00001 diff --git a/src/main/resources/data/backrooms/layouts/level0_0.png b/src/main/resources/data/backrooms/layouts/level0_0.png deleted file mode 100644 index 37bdcbcf4f6220afa5fe0c56d80cfc7761ff21e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFdZB8wRq_zrdZB8wRq_zrKZ@ZMp7XB=OZmfXCH;@{B!_5)8r#io%Jz&+q_EVDNPHb6Mw<&;$VN C%`9&K diff --git a/src/main/resources/data/backrooms/layouts/level0_4.png b/src/main/resources/data/backrooms/layouts/level0_4.png deleted file mode 100644 index cd9bb8cc9194efbb91834f7ec6c2f19d5b8b66ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1enFwE1%F~q|E?xcf!3<5mP(fi*%UM_f0O-P(Q zPUf1a_mv9|6b#CnL`o01Oq!|&`v^`)8#j5b;R6XT8|^j)Z7G sCY3g!#S@Jt98h!Zk>c87Y{bNH#*gXh%1x)90@X2iy85}Sb4q9e0OEHaF8}}l delta 121 zcmbQwxPx(mThV_8Aovf0{~5~Um@WW$oCO|{#S9F5he4R}c>anMprEOzi(`ny<>Urt zM~#Gp03b|CVCvG~(&FOe;!FxoK9F$W%z>UYZ0k-3TnLB=h?pQVnU$4sl_i^O#Gl_^ PK$dvA`njxgN@xNAOo%8Z diff --git a/src/main/resources/data/backrooms/layouts/whiteblock.png b/src/main/resources/data/backrooms/layouts/whiteblock.png new file mode 100644 index 0000000000000000000000000000000000000000..12e3f0c206d59a3b1f43736ba0c0030451415a7d GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPF