diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..0a04128
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/bin/main/fabric.mod.json b/bin/main/fabric.mod.json
index cb57585..f205f76 100644
--- a/bin/main/fabric.mod.json
+++ b/bin/main/fabric.mod.json
@@ -13,10 +13,13 @@
"sources": "https://github.com/LudoCrypt/Backrooms",
"issues": "https://github.com/LudoCrypt/Backrooms/issues"
},
- "license": "CC0-1.0",
+ "license": "LGPLv3",
"icon": "assets/backrooms/icon.png",
"environment": "*",
"entrypoints": {
+ "mm:early_risers": [
+ "net.ludocrypt.backrooms.misc.PreInitialize::initialize"
+ ],
"main": [
"net.ludocrypt.backrooms.Backrooms"
],
diff --git a/bin/main/net/ludocrypt/backrooms/Backrooms.class b/bin/main/net/ludocrypt/backrooms/Backrooms.class
index d8914a8..670de72 100644
Binary files a/bin/main/net/ludocrypt/backrooms/Backrooms.class and b/bin/main/net/ludocrypt/backrooms/Backrooms.class differ
diff --git a/bin/main/net/ludocrypt/backrooms/BackroomsClient.class b/bin/main/net/ludocrypt/backrooms/BackroomsClient.class
index a3b18b8..faebd68 100644
Binary files a/bin/main/net/ludocrypt/backrooms/BackroomsClient.class and b/bin/main/net/ludocrypt/backrooms/BackroomsClient.class differ
diff --git a/bin/main/net/ludocrypt/backrooms/features/Level0Room.class b/bin/main/net/ludocrypt/backrooms/features/Level0Room.class
index 4904099..efc024d 100644
Binary files a/bin/main/net/ludocrypt/backrooms/features/Level0Room.class and b/bin/main/net/ludocrypt/backrooms/features/Level0Room.class differ
diff --git a/bin/main/net/ludocrypt/backrooms/features/LevelsFeatureInit.class b/bin/main/net/ludocrypt/backrooms/features/LevelsFeatureInit.class
index e9454b6..738fc11 100644
Binary files a/bin/main/net/ludocrypt/backrooms/features/LevelsFeatureInit.class and b/bin/main/net/ludocrypt/backrooms/features/LevelsFeatureInit.class differ
diff --git a/bin/main/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.class b/bin/main/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.class
index 75ba43f..e792289 100644
Binary files a/bin/main/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.class and b/bin/main/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.class differ
diff --git a/build.gradle b/build.gradle
index 60936c1..a00fa95 100644
--- a/build.gradle
+++ b/build.gradle
@@ -39,6 +39,7 @@ dependencies {
include "me.sargunvohra.mcmods:autoconfig1u:3.2.0-unstable"
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'))
}
processResources {
diff --git a/src/main/java/net/ludocrypt/backrooms/Backrooms.java b/src/main/java/net/ludocrypt/backrooms/Backrooms.java
index 6e566e9..91103ba 100644
--- a/src/main/java/net/ludocrypt/backrooms/Backrooms.java
+++ b/src/main/java/net/ludocrypt/backrooms/Backrooms.java
@@ -465,6 +465,9 @@ public void onInitialize() {
registerBlockEntity("void_block", VOID_BLOCK, VoidBlockEntity::new,
(blockEntityType) -> VoidBlockEntity.blockEntityType = blockEntityType);
+ System.out.println(
+ "The Backrooms Mod. Only play this mod if you got it from CurseForge, or from me on my discord server.");
+
}
@SuppressWarnings("rawtypes")
diff --git a/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java b/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java
index 2fecbd8..83940b7 100644
--- a/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java
+++ b/src/main/java/net/ludocrypt/backrooms/BackroomsClient.java
@@ -24,6 +24,7 @@ public class BackroomsClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
registerBlockEntityRenderer("void_block", VoidBlockEntityRenderer::new);
+
}
public static void putItemRenderLayer(Item item, RenderLayer layer) {
@@ -39,5 +40,7 @@ private void registerBlockEntityRenderer(String identifi
Function> blockEntityRenderer) {
BlockEntityRendererRegistry.INSTANCE.register((BlockEntityType) Registry.BLOCK_ENTITY_TYPE.get(Backrooms.getId(identifier)), blockEntityRenderer);
}
+
+
}
diff --git a/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java b/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java
index c64c38b..32b7405 100644
--- a/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java
+++ b/src/main/java/net/ludocrypt/backrooms/biome/BkBiomes.java
@@ -27,8 +27,11 @@ public static Biome Level0() {
.surfaceBuilder(ConfiguratedSurfaceBuilders.LEVELBUILDER)
.feature(GenerationStep.Feature.LOCAL_MODIFICATIONS,
LevelsFeatureInit.LEVEL0ROOM.configure(FeatureConfig.DEFAULT)
- .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT)));
- return (new Biome.Builder()).precipitation(Biome.Precipitation.NONE).category(Biome.Category.THEEND).depth(0F)
+ .decorate(LevelsFeatureInit.LEVEL0DECORATOR.configure(DecoratorConfig.DEFAULT)))
+ .feature(GenerationStep.Feature.LOCAL_MODIFICATIONS,
+ LevelsFeatureInit.LEVEL01ROOF.configure(FeatureConfig.DEFAULT)
+ .decorate(LevelsFeatureInit.LEVEL01ROOFDECORATOR.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)
.skyColor(14402413).music(MusicType.createIngameMusic(BackroomsSoundEvents.LEVEL0MUSIC))
@@ -45,7 +48,7 @@ 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.THEEND).depth(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))
@@ -60,7 +63,7 @@ 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.THEEND).depth(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))
@@ -75,7 +78,7 @@ 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.THEEND).depth(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))
@@ -92,7 +95,7 @@ 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.THEEND).depth(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))
@@ -110,7 +113,7 @@ 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.NETHER).depth(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))
@@ -128,7 +131,7 @@ 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.NETHER).depth(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))
@@ -147,7 +150,7 @@ 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.NONE).depth(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))
@@ -166,7 +169,7 @@ 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.NONE).depth(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))
@@ -185,7 +188,7 @@ 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.NONE).depth(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))
@@ -204,7 +207,7 @@ 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.NONE).depth(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))
diff --git a/src/main/java/net/ludocrypt/backrooms/biome/LevelBuilder.java b/src/main/java/net/ludocrypt/backrooms/biome/LevelBuilder.java
index e96565a..80067ce 100644
--- a/src/main/java/net/ludocrypt/backrooms/biome/LevelBuilder.java
+++ b/src/main/java/net/ludocrypt/backrooms/biome/LevelBuilder.java
@@ -29,11 +29,11 @@ public void generate(Random random, Chunk chunkIn, Biome biomeIn, int x, int z,
int zpos = z & 15;
int yheight = 75;
BlockPos.Mutable blockpos$Mutable = new BlockPos.Mutable();
- if (biomeIn.getCategory() == Biome.Category.THEEND) {
+ if (biomeIn.getCategory() == Biome.Category.valueOf("level0")) {
if (BackroomsConfig.getInstance().Level0LayerCount > 11) {
yheight = (BackroomsConfig.getInstance().Level0LayerCount * 6) + 8;
}
- } else if (biomeIn.getCategory() == Biome.Category.NETHER) {
+ } else if (biomeIn.getCategory() == Biome.Category.valueOf("level1")) {
if (BackroomsConfig.getInstance().Level1LayerCount > 11) {
yheight = (BackroomsConfig.getInstance().Level1LayerCount * 6) + 8;
}
diff --git a/src/main/java/net/ludocrypt/backrooms/features/Level01Roof.java b/src/main/java/net/ludocrypt/backrooms/features/Level01Roof.java
new file mode 100644
index 0000000..fcc1e84
--- /dev/null
+++ b/src/main/java/net/ludocrypt/backrooms/features/Level01Roof.java
@@ -0,0 +1,138 @@
+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, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+
+ };
+ Integer[][] carpet = { { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
+ { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, { 5, 5, 5, 5, 5, 5, 5, 5, 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/Level0Room.java b/src/main/java/net/ludocrypt/backrooms/features/Level0Room.java
index 6e075fe..6966a55 100644
--- a/src/main/java/net/ludocrypt/backrooms/features/Level0Room.java
+++ b/src/main/java/net/ludocrypt/backrooms/features/Level0Room.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;
@@ -17,8 +19,10 @@
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;
@@ -35,82 +39,6 @@ public Level0Room(Codec configFactory) {
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, 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 WALLPAPER = Backrooms.WALLPAPER.getDefaultState();
private static final BlockState CARPET = Backrooms.CARPET.getDefaultState();
private static final BlockState CARPET_STAIRS = Backrooms.CARPET_STAIRS.getDefaultState()
@@ -138,326 +66,667 @@ public Level0Room(Codec configFactory) {
.with(TornWallpaper.TORN_LEVEL, 4);
private static final BlockState VENT = Backrooms.VENT.getDefaultState();
+// 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);
+
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);
+ 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;
- 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) {
+ if (rand.nextDouble() < 0.5) {
+ layoutInt = 1;
} 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 = 2;
+ }
+ } else if (rand.nextDouble() < 0.5) {
+ if (rand.nextDouble() < 0.5) {
+ layoutInt = 3;
+ } else {
+ layoutInt = 4;
}
- } 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);
+ 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 (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);
+// }
+
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,
+ boolean red, boolean red2, boolean green, boolean green2, boolean blue, boolean blue2, boolean purple,
+ boolean purple2) {
- BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, slice[0].length));
- BlockPos.Mutable currentPosition = new BlockPos.Mutable(currentPositionOffsetted.getX(),
- currentPositionOffsetted.getY(), currentPositionOffsetted.getZ());
+// BlockPos currentPositionOffsetted = new BlockPos(centerPos.add(-1, 3, slice[0].length));
+ 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))) {
+// Level0Room.door1 = rand.nextBoolean();
+// }
if ((rand.nextDouble()) < ((BackroomsConfig.getInstance().Level0DoorChance))) {
Level0Room.door1 = true;
} else {
Level0Room.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;
- }
+// 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 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);
+ 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);
+ }
+ } else {
+ world.setBlockState(currentPosition, AIR, 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);
+ 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;
+ }
+ } else {
+ world.setBlockState(currentPosition, WALLPAPER, 2);
+ }
+ } else {
+ world.setBlockState(currentPosition, AIR, 2);
}
break;
case 3:
- world.setBlockState(currentPosition, LIGHT, 2);
+ if (green) {
+ 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 4:
- world.setBlockState(currentPosition, AIR, 2);
+ 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);
+ }
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;
+ 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, WALLPAPER, 2);
+ world.setBlockState(currentPosition, AIR, 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);
+ 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, WALLPAPER, 2);
+ world.setBlockState(currentPosition, AIR, 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);
+ 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.add(-1, 0, 0), AIR, 3);
+ world.setBlockState(currentPosition, WALLPAPER, 2);
}
-
} else {
- world.setBlockState(currentPosition, WALLPAPER, 2);
+ world.setBlockState(currentPosition, AIR, 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);
+ 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, WALLPAPER, 2);
+ world.setBlockState(currentPosition, AIR, 2);
}
break;
+
case 9:
- if (door4) {
+ 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);
+ 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);
+ world.setBlockState(currentPosition.add(1, 3, 1), AIR, 2);
}
} 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, 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);
+ 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 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);
}
- 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/LevelsFeatureInit.java b/src/main/java/net/ludocrypt/backrooms/features/LevelsFeatureInit.java
index 6b114ac..e7121b1 100644
--- a/src/main/java/net/ludocrypt/backrooms/features/LevelsFeatureInit.java
+++ b/src/main/java/net/ludocrypt/backrooms/features/LevelsFeatureInit.java
@@ -1,5 +1,6 @@
package net.ludocrypt.backrooms.features;
+import net.ludocrypt.backrooms.features.decorators.Level01RoofDecorator;
import net.ludocrypt.backrooms.features.decorators.Level0RoomDecorator;
import net.ludocrypt.backrooms.features.decorators.Level1RoomDecorator;
import net.ludocrypt.backrooms.features.decorators.Level2RoomDecorator;
@@ -12,6 +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);
@@ -24,12 +26,15 @@ public class LevelsFeatureInit {
public static Feature LEVEL2LONGROOM = new Level2LongRoom(DefaultFeatureConfig.CODEC);
public static Feature LEVEL2MESSYROOM = new Level2MessyRoom(DefaultFeatureConfig.CODEC);
public static Feature LEVEL3ROOM = new Level3Room(DefaultFeatureConfig.CODEC);
+ public static Decorator LEVEL01ROOFDECORATOR = new Level01RoofDecorator(
+ NopeDecoratorConfig.CODEC);
public static Decorator LEVEL0DECORATOR = new Level0RoomDecorator(NopeDecoratorConfig.CODEC);
public static Decorator LEVEL1DECORATOR = new Level1RoomDecorator(NopeDecoratorConfig.CODEC);
public static Decorator LEVEL2DECORATOR = new Level2RoomDecorator(NopeDecoratorConfig.CODEC);
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);
@@ -41,9 +46,11 @@ public static void registerFeatures() {
Registry.register(Registry.FEATURE, new Identifier("backrooms", "level2longroom"), LEVEL2LONGROOM);
Registry.register(Registry.FEATURE, new Identifier("backrooms", "level2messyroom"), LEVEL2MESSYROOM);
Registry.register(Registry.FEATURE, new Identifier("backrooms", "level3room"), LEVEL3ROOM);
- Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level0decorator"), LEVEL0DECORATOR);
- Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level1decorator"), LEVEL1DECORATOR);
- Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level2decorator"), LEVEL2DECORATOR);
- Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level3decorator"), LEVEL3DECORATOR);
+ Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level01roofdecorator"),
+ LEVEL01ROOFDECORATOR);
+ Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level0decorator"), LEVEL0DECORATOR);
+ Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level1decorator"), LEVEL1DECORATOR);
+ Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level2decorator"), LEVEL2DECORATOR);
+ Registry.register(Registry.DECORATOR, new Identifier("backrooms", "level3decorator"), LEVEL3DECORATOR);
}
}
\ No newline at end of file
diff --git a/src/main/java/net/ludocrypt/backrooms/features/decorators/Level01RoofDecorator.java b/src/main/java/net/ludocrypt/backrooms/features/decorators/Level01RoofDecorator.java
new file mode 100644
index 0000000..cb76f1a
--- /dev/null
+++ b/src/main/java/net/ludocrypt/backrooms/features/decorators/Level01RoofDecorator.java
@@ -0,0 +1,35 @@
+package net.ludocrypt.backrooms.features.decorators;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.stream.Stream;
+
+import com.mojang.serialization.Codec;
+
+import net.ludocrypt.backrooms.config.BackroomsConfig;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.gen.decorator.Decorator;
+import net.minecraft.world.gen.decorator.DecoratorContext;
+import net.minecraft.world.gen.decorator.NopeDecoratorConfig;
+
+public class Level01RoofDecorator extends Decorator {
+
+ public Level01RoofDecorator(Codec codec) {
+ super(codec);
+ }
+
+ @Override
+ public Stream getPositions(DecoratorContext context, Random random, NopeDecoratorConfig config,
+ BlockPos pos) {
+
+ BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable(pos.getX(), 0, pos.getZ());
+ List blockPosList = new ArrayList();
+
+ for (int repeat = 0; repeat < BackroomsConfig.getInstance().Level0LayerCount; repeat++) {
+ mutableBlockPos.move(0, 6, 0);
+ blockPosList.add(mutableBlockPos.toImmutable());
+ }
+ return blockPosList.stream();
+ }
+}
diff --git a/src/main/java/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.java b/src/main/java/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.java
index 69ad6b8..4f154c8 100644
--- a/src/main/java/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.java
+++ b/src/main/java/net/ludocrypt/backrooms/features/decorators/Level0RoomDecorator.java
@@ -23,7 +23,7 @@ public Level0RoomDecorator(Codec codec) {
public Stream getPositions(DecoratorContext context, Random random, NopeDecoratorConfig config,
BlockPos pos) {
- BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable(pos.getX(), 0, pos.getZ());
+ BlockPos.Mutable mutableBlockPos = new BlockPos.Mutable(pos.getX(), 1, pos.getZ());
List blockPosList = new ArrayList();
for (int repeat = 0; repeat < BackroomsConfig.getInstance().Level0LayerCount; repeat++) {
diff --git a/src/main/java/net/ludocrypt/backrooms/misc/PreInitialize.java b/src/main/java/net/ludocrypt/backrooms/misc/PreInitialize.java
new file mode 100644
index 0000000..64d9f46
--- /dev/null
+++ b/src/main/java/net/ludocrypt/backrooms/misc/PreInitialize.java
@@ -0,0 +1,13 @@
+package net.ludocrypt.backrooms.misc;
+
+import com.chocohead.mm.api.ClassTinkerers;
+
+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();
+ }
+}
diff --git a/src/main/java/net/ludocrypt/backrooms/mixin/EntityMixin.java b/src/main/java/net/ludocrypt/backrooms/mixin/EntityMixin.java
index 2fe4185..c47e655 100644
--- a/src/main/java/net/ludocrypt/backrooms/mixin/EntityMixin.java
+++ b/src/main/java/net/ludocrypt/backrooms/mixin/EntityMixin.java
@@ -49,7 +49,7 @@ private void onEntityTick(CallbackInfo ci) {
if (entity instanceof PlayerEntity) {
if (!world.isClient) {
if (entity.isInsideWall() && entity.world.getRegistryKey() == World.OVERWORLD
- && ((PlayerEntity) entity).isCreative()) {
+ && !((PlayerEntity) entity).isCreative()) {
if (Math.random() < 0.75) {
if (Math.random() < BackroomsConfig.getInstance().SuffocationChance) {
if (Math.random() < 0.02) {
diff --git a/src/main/java/net/ludocrypt/imagereader/Layout.java b/src/main/java/net/ludocrypt/imagereader/Layout.java
new file mode 100644
index 0000000..f8cc9ee
--- /dev/null
+++ b/src/main/java/net/ludocrypt/imagereader/Layout.java
@@ -0,0 +1,215 @@
+package net.ludocrypt.imagereader;
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.imageio.ImageIO;
+
+import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.annotation.Nullable;
+
+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) {
+
+ BufferedImage image;
+ try {
+ image = ImageIO.read(room.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);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+
+ }
+
+ 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) {
+ 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.colorChecker(c, intList1, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 1) {
+ Layout.colorChecker(c, intList2, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 2) {
+ Layout.colorChecker(c, intList3, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 3) {
+ Layout.colorChecker(c, intList4, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 4) {
+ Layout.colorChecker(c, intList5, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 5) {
+ Layout.colorChecker(c, intList6, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 6) {
+ Layout.colorChecker(c, intList7, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 7) {
+ Layout.colorChecker(c, intList8, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 8) {
+ Layout.colorChecker(c, intList9, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 9) {
+ Layout.colorChecker(c, intList10, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 10) {
+ Layout.colorChecker(c, intList11, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 11) {
+ Layout.colorChecker(c, intList12, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 12) {
+ Layout.colorChecker(c, intList13, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 13) {
+ Layout.colorChecker(c, intList14, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 14) {
+ Layout.colorChecker(c, intList15, blackBlock, whiteBlock, red, red2, green, green2, blue, blue2,
+ purple, purple2);
+ } else if (y == 15) {
+ Layout.colorChecker(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 listLayouts(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) {
+ 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);
+ intListList.add(intList);
+ }
+ return intListList;
+ }
+
+ private static void colorChecker(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) {
+ list.add(blue);
+ } else if (c.getRed() == 0 && c.getGreen() == 255 && c.getBlue() == 255) {
+ list.add(blue2);
+ } else if (c.getRed() == 255 && c.getGreen() == 0 && c.getBlue() == 0) {
+ list.add(red);
+ } else if (c.getRed() == 255 && c.getGreen() == 123 && c.getBlue() == 0) {
+ list.add(red2);
+ } else if (c.getRed() == 0 && c.getGreen() == 255 && c.getBlue() == 0) {
+ list.add(green);
+ } else if (c.getRed() == 255 && c.getGreen() == 255 && c.getBlue() == 0) {
+ list.add(green2);
+ } else if (c.getRed() == 255 && c.getGreen() == 0 && c.getBlue() == 255) {
+ list.add(purple);
+ } else if (c.getRed() == 144 && c.getGreen() == 0 && c.getBlue() == 255) {
+ list.add(purple2);
+ } else if (c.getRed() == 0 && c.getGreen() == 0 && c.getBlue() == 0) {
+ list.add(black);
+ } else {
+ list.add(white);
+ }
+ }
+
+}
diff --git a/src/main/resources/assets/backrooms/lang/en_us.json b/src/main/resources/assets/backrooms/lang/en_us.json
index 939a1bc..7d43e79 100644
--- a/src/main/resources/assets/backrooms/lang/en_us.json
+++ b/src/main/resources/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",
@@ -142,6 +147,6 @@
"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/src/main/resources/data/backrooms/dimension/level_0.json b/src/main/resources/data/backrooms/dimension/level_0.json
index 9b72b0c..576aeee 100644
--- a/src/main/resources/data/backrooms/dimension/level_0.json
+++ b/src/main/resources/data/backrooms/dimension/level_0.json
@@ -34,286 +34,6 @@
"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/allcolors.png
new file mode 100644
index 0000000..3f2e5b3
Binary files /dev/null and b/src/main/resources/data/backrooms/layouts/allcolors.png differ
diff --git a/src/main/resources/data/backrooms/layouts/level0_0.png b/src/main/resources/data/backrooms/layouts/level0_0.png
new file mode 100644
index 0000000..37bdcbc
Binary files /dev/null and b/src/main/resources/data/backrooms/layouts/level0_0.png differ
diff --git a/src/main/resources/data/backrooms/layouts/level0_1.png b/src/main/resources/data/backrooms/layouts/level0_1.png
new file mode 100644
index 0000000..f2ed75b
Binary files /dev/null and b/src/main/resources/data/backrooms/layouts/level0_1.png differ
diff --git a/src/main/resources/data/backrooms/layouts/level0_2.png b/src/main/resources/data/backrooms/layouts/level0_2.png
new file mode 100644
index 0000000..73b49f2
Binary files /dev/null and b/src/main/resources/data/backrooms/layouts/level0_2.png differ
diff --git a/src/main/resources/data/backrooms/layouts/level0_3.png b/src/main/resources/data/backrooms/layouts/level0_3.png
new file mode 100644
index 0000000..af86ec8
Binary files /dev/null and b/src/main/resources/data/backrooms/layouts/level0_3.png differ
diff --git a/src/main/resources/data/backrooms/layouts/level0_4.png b/src/main/resources/data/backrooms/layouts/level0_4.png
new file mode 100644
index 0000000..cd9bb8c
Binary files /dev/null and b/src/main/resources/data/backrooms/layouts/level0_4.png differ
diff --git a/src/main/resources/data/backrooms/layouts/roof.png b/src/main/resources/data/backrooms/layouts/roof.png
new file mode 100644
index 0000000..701f4aa
Binary files /dev/null and b/src/main/resources/data/backrooms/layouts/roof.png differ
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index cb57585..f205f76 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -13,10 +13,13 @@
"sources": "https://github.com/LudoCrypt/Backrooms",
"issues": "https://github.com/LudoCrypt/Backrooms/issues"
},
- "license": "CC0-1.0",
+ "license": "LGPLv3",
"icon": "assets/backrooms/icon.png",
"environment": "*",
"entrypoints": {
+ "mm:early_risers": [
+ "net.ludocrypt.backrooms.misc.PreInitialize::initialize"
+ ],
"main": [
"net.ludocrypt.backrooms.Backrooms"
],