Skip to content

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
level 3, level 2 fixed, void block balanced and fixed. new advancements, recipies for when you get afvancements.
  • Loading branch information
LudoCrypt committed Jul 22, 2020
1 parent b97fe9d commit 5c3a015
Show file tree
Hide file tree
Showing 90 changed files with 2,792 additions and 507 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ repositories {
maven {
url = "https://jitpack.io"
}

jcenter()
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
minecraft_version=1.15.2
yarn_mappings=1.15.2+build.17
loader_version=0.8.9+build.203
mod_version = 0.1.6
mod_version = 1.0.0
maven_group = net.ludocrypt
archives_base_name = backrooms
fabric_version=0.14.0+build.317-1.15
19 changes: 19 additions & 0 deletions src/main/java/net/ludocrypt/backrooms/Backrooms.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
import net.ludocrypt.backrooms.biome.Level0Red;
import net.ludocrypt.backrooms.biome.Level1;
import net.ludocrypt.backrooms.biome.Level2;
import net.ludocrypt.backrooms.biome.Level3;
import net.ludocrypt.backrooms.blocks.BackroomsSlab;
import net.ludocrypt.backrooms.blocks.BackroomsStairs;
import net.ludocrypt.backrooms.blocks.Carpet;
import net.ludocrypt.backrooms.blocks.Cement;
import net.ludocrypt.backrooms.blocks.Cement_Bricks;
import net.ludocrypt.backrooms.blocks.Checkered_Block;
import net.ludocrypt.backrooms.blocks.Light;
import net.ludocrypt.backrooms.blocks.LinedPipe;
import net.ludocrypt.backrooms.blocks.Pipe;
import net.ludocrypt.backrooms.blocks.Poolstone;
import net.ludocrypt.backrooms.blocks.Poolstone_Bricks;
Expand Down Expand Up @@ -57,6 +59,7 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.Rarity;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.Heightmap;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.dimension.DimensionType;
import net.minecraft.world.gen.GenerationStep;
Expand All @@ -70,6 +73,7 @@ public class Backrooms implements ModInitializer {
private static final Set<Identifier> LOOT_TABLES = Sets.newHashSet();
public static final Identifier LEVEL0CHEST = register("backrooms:chests/level0");
public static final Identifier LEVEL1CHEST = register("backrooms:chests/level1");
public static final Identifier LEVEL3CHEST = register("backrooms:chests/level3");
// variables
public static boolean Display = false;
public static int DisplayLevel = 0;
Expand All @@ -87,6 +91,8 @@ public class Backrooms implements ModInitializer {
public static final Block DOTTED_WALLPAPER = new Wallpaper();
public static final Block RED_WALLPAPER = new Wallpaper();
public static final Block TORN_WALLPAPER = new TornWallpaper();
public static final Block RED_TORN_WALLPAPER = new TornWallpaper();
public static final Block DOTTED_TORN_WALLPAPER = new TornWallpaper();
public static final Block LIGHT = new Light();
public static final Block WALL = new Wall();
public static final Block CARPET = new Carpet();
Expand Down Expand Up @@ -127,6 +133,7 @@ public class Backrooms implements ModInitializer {
public static final Block VOID_BLOCK = new VoidBlock();
public static BlockEntityType<VoidBlockEntity> VOID_BLOCK_ENTITY;
public static final Block PIPE = new Pipe();
public static final Block LINEDPIPE = new LinedPipe();
// checkered
public static final Block CHECKERED_BLOCK = new Checkered_Block();
// colours
Expand Down Expand Up @@ -157,6 +164,8 @@ public class Backrooms implements ModInitializer {
new Level1());
public static final Biome LEVEL2 = Registry.register(Registry.BIOME, new Identifier("backrooms", "level2"),
new Level2());
public static final Biome LEVEL3 = Registry.register(Registry.BIOME, new Identifier("backrooms", "level3"),
new Level3());
// record discs
public static final Item MUSIC_DISC_GLACIAL_CAVERN = new BackroomsMusicDiscItem(1,
BackroomsSoundEvents.MUSIC_DISC_GLACIAL_CAVERN,
Expand Down Expand Up @@ -211,6 +220,8 @@ public void onInitialize() {
Registry.register(Registry.BLOCK, new Identifier("backrooms", "dotted_wallpaper"), DOTTED_WALLPAPER);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "red_wallpaper"), RED_WALLPAPER);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "torn_wallpaper"), TORN_WALLPAPER);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "red_torn_wallpaper"), RED_TORN_WALLPAPER);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "dotted_torn_wallpaper"), DOTTED_TORN_WALLPAPER);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "wall"), WALL);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "carpet"), CARPET);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "carpet_stairs"), CARPET_STAIRS);
Expand Down Expand Up @@ -243,6 +254,7 @@ public void onInitialize() {
Registry.register(Registry.BLOCK, new Identifier("backrooms", "poolstone_brick_slab"), POOLSTONE_BRICK_SLAB);

Registry.register(Registry.BLOCK, new Identifier("backrooms", "pipe"), PIPE);
Registry.register(Registry.BLOCK, new Identifier("backrooms", "linedpipe"), LINEDPIPE);

// checkered
Registry.register(Registry.BLOCK, new Identifier("backrooms", "black_checkered"), BLACK_CHECKERED);
Expand Down Expand Up @@ -271,6 +283,10 @@ public void onInitialize() {
new BlockItem(RED_WALLPAPER, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)));
Registry.register(Registry.ITEM, new Identifier("backrooms", "torn_wallpaper"),
new BlockItem(TORN_WALLPAPER, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)));
Registry.register(Registry.ITEM, new Identifier("backrooms", "red_torn_wallpaper"),
new BlockItem(RED_TORN_WALLPAPER, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)));
Registry.register(Registry.ITEM, new Identifier("backrooms", "dotted_torn_wallpaper"),
new BlockItem(DOTTED_TORN_WALLPAPER, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)));
Registry.register(Registry.ITEM, new Identifier("backrooms", "wall"),
new BlockItem(WALL, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)));
Registry.register(Registry.ITEM, new Identifier("backrooms", "carpet"),
Expand Down Expand Up @@ -426,6 +442,9 @@ public static void ambientSoundGenerator(PlayerEntity target, SoundEvent sound,

public static void teleportPlayer(Entity entity, DimensionType newDimension) {
entity.changeDimension(newDimension);
if (newDimension == DimensionType.OVERWORLD) {
entity.teleport(entity.getX(), entity.world.getTopY(Heightmap.Type.MOTION_BLOCKING, (int) entity.getX(), (int) entity.getZ()) + 1, entity.getZ());
}
}

}
41 changes: 41 additions & 0 deletions src/main/java/net/ludocrypt/backrooms/biome/Level3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package net.ludocrypt.backrooms.biome;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.ludocrypt.backrooms.Backrooms;
import net.ludocrypt.backrooms.features.LevelsFeatureInit;
import net.ludocrypt.backrooms.features.decorators.Level2RoomDecorator;
import net.minecraft.block.BlockState;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.decorator.DecoratorConfig;
import net.minecraft.world.gen.decorator.NopeDecoratorConfig;
import net.minecraft.world.gen.feature.FeatureConfig;
import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder;

public class Level3 extends Biome {
protected static final BlockState WALL = Backrooms.WALL.getDefaultState();
public static final Decorator<NopeDecoratorConfig> LEVEL3PLACER = new Level2RoomDecorator(NopeDecoratorConfig::deserialize);

public Level3() {

super(new Biome.Settings().configureSurfaceBuilder(SurfaceBuilder.NOPE, SurfaceBuilder.AIR_CONFIG)
.precipitation(Biome.Precipitation.NONE).category(Biome.Category.NONE).depth(0F).scale(0F)
.temperature(5.0F).downfall(0F).waterColor(69).waterFogColor(69).parent((String) null));

this.addFeature(GenerationStep.Feature.LOCAL_MODIFICATIONS,
LevelsFeatureInit.LEVEL3ROOM.configure(FeatureConfig.DEFAULT)
.createDecoratedFeature(LEVEL3PLACER.configure(DecoratorConfig.DEFAULT)));
}

@Environment(EnvType.CLIENT)
public int getGrassColorAt(double p_225528_1_, double p_225528_3_) {
return 226217111;
}

@Environment(EnvType.CLIENT)
public int getFoliageColor() {
return 226217111;
}
}
2 changes: 1 addition & 1 deletion src/main/java/net/ludocrypt/backrooms/blocks/Cement.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Cement extends Block {

public Cement() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(4).resistance(5));
.hardness(3).resistance(5));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Cement_Bricks extends Block {

public Cement_Bricks() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(5).resistance(5));
.hardness(4).resistance(5));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class Checkered_Block extends Block {
public Checkered_Block() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(6).resistance(6));
.hardness(4).resistance(4));
}
}
59 changes: 59 additions & 0 deletions src/main/java/net/ludocrypt/backrooms/blocks/LinedPipe.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package net.ludocrypt.backrooms.blocks;

import java.util.Random;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Material;
import net.minecraft.entity.EntityContext;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.IntProperty;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;

public class LinedPipe extends Block {

public static final IntProperty TYPE = IntProperty.of("type", 1, 2);

public static final VoxelShape SHAPE = Block.createCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 14.0D, 16.0D);

public LinedPipe() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(6).resistance(6).lightLevel(5));
setDefaultState(getStateManager().getDefaultState().with(TYPE, 1));
}

@Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext context) {
return SHAPE;
}

@Override
protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
stateManager.add(TYPE);
}

@Override
@Environment(EnvType.CLIENT)
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
super.randomDisplayTick(state, world, pos, random);
if (random.nextInt(2) == 0) {
world.addParticle(ParticleTypes.MYCELIUM, (double) pos.getX() + (double) random.nextFloat(),
(double) pos.getY() + (double) random.nextFloat(),
(double) pos.getZ() + (double) random.nextFloat(), 1.0D, -1.0D, 1.0D);
}
if (random.nextInt(10) == 0) {
world.addParticle(ParticleTypes.DRIPPING_WATER, (double) pos.getX() + (random.nextDouble() / 4) + 0.5,
(double) pos.getY(), (double) pos.getZ() + (random.nextDouble() / 4) + 0.5, 0.0D, 0.0D,
0.0D);
}
}
}
3 changes: 2 additions & 1 deletion src/main/java/net/ludocrypt/backrooms/blocks/Pipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando
}
if (random.nextInt(10) == 0) {
world.addParticle(ParticleTypes.DRIPPING_WATER, (double) pos.getX() + (random.nextDouble() / 4) + 0.5,
(double) pos.getY() + 0.18, (double) pos.getZ() + (random.nextDouble() / 4) + 0.5, 0.0D, 0.0D, 0.0D);
(double) pos.getY() + 0.18, (double) pos.getZ() + (random.nextDouble() / 4) + 0.5, 0.0D, 0.0D,
0.0D);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class Poolstone extends Block {
public Poolstone() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(6).resistance(6));
.hardness(4).resistance(4));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class Poolstone_Bricks extends Block {
public Poolstone_Bricks() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(6).resistance(6));
.hardness(4).resistance(4));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class Poolstone_Path extends Block {
public Poolstone_Path() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(6).resistance(6));
.hardness(4).resistance(4));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class Poolstone_Tile extends Block {
public Poolstone_Tile() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.STONE)
.hardness(6).resistance(6));
.hardness(4).resistance(4));
}
}
61 changes: 35 additions & 26 deletions src/main/java/net/ludocrypt/backrooms/blocks/VoidBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public long getRenderingSeed(BlockState state, BlockPos pos) {
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
Random rand = new Random();
int k = 0;
double t = 0.0;
entity.slowMovement(state, new Vec3d(0.25D, 0.05000000074505806D, 0.25D));
if (!world.isClient && !entity.hasVehicle() && !entity.hasPassengers() && entity.canUsePortals()
Expand All @@ -52,7 +51,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit
|| entity.dimension == BackroomsDimensionTypes.LEVEL0DOTTED
|| entity.dimension == BackroomsDimensionTypes.LEVEL0RED) {
t = rand.nextDouble();
if (t < 0.1) {
if (t < 0.001) {
Backrooms.teleportPlayer(entity, DimensionType.OVERWORLD);
} else if (t < 0.25) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL1);
Expand All @@ -64,40 +63,50 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL0);
}
}
if (entity.dimension == BackroomsDimensionTypes.LEVEL1) {
k = rand.nextInt(3);
switch (k) {
case 0:
else if (entity.dimension == BackroomsDimensionTypes.LEVEL1) {
t = rand.nextDouble();
if (t < 0.005) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL1);
} else if (t < 0.25) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL0);
break;
case 1:
} else if (t < 0.5) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL2);
} else if (t < 0.75) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL2);
} else {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL1);
break;
case 2:
}
}
else if (entity.dimension == BackroomsDimensionTypes.LEVEL2) {
t = rand.nextDouble();
if (t < 0.05) {
Backrooms.teleportPlayer(entity, DimensionType.OVERWORLD);
} else if (t < 0.25) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL2);
} else if (t < 0.5) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL3);
} else if (t < 0.75) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL2);
break;
} else {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL3);
}
}
if (entity.dimension == BackroomsDimensionTypes.LEVEL2) {
k = rand.nextInt(4);
switch (k) {
case 0:
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL0);
break;
case 1:
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL1);
break;
case 2:
else if (entity.dimension == BackroomsDimensionTypes.LEVEL3) {
t = rand.nextDouble();
if (t < 0.05) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL2);
break;
case 3:
} else if (t < 0.15) {
Backrooms.teleportPlayer(entity, DimensionType.OVERWORLD);
break;
} else if (t < 0.5) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL3);
} else if (t < 0.75) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL3);
} else {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL3);
}
}
if (entity.dimension == DimensionType.OVERWORLD) {
else if (entity.dimension == DimensionType.OVERWORLD) {
Backrooms.teleportPlayer(entity, BackroomsDimensionTypes.LEVEL0);

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

@Environment(EnvType.CLIENT)
public class EndPortalRenderer<T extends EndPortalBlockEntity> extends BlockEntityRenderer<T> {

private static final Random RANDOM = new Random(9500L);
private static final List<RenderLayer> renderLayers = IntStream.range(0, 16)
.mapToObj(i -> RenderLayer.getEndPortal(i + 1)).collect(ImmutableList.toImmutableList());
Expand All @@ -42,8 +41,8 @@ public void render(T blockEntity, float tickDelta, MatrixStack matrixStack,

private static void renderLayer(Matrix4f matrix, VertexConsumer vertexConsumer, float colourScalar) {
float red = (RANDOM.nextFloat() * 0.5F + 1.0F) * colourScalar;
float green = (RANDOM.nextFloat() * 0.5F + 0.54F) * colourScalar;
float blue = (RANDOM.nextFloat() * 0.5F + 0.54F) * colourScalar;
float green = (RANDOM.nextFloat() * 0.5F + 0.9F) * colourScalar;
float blue = (RANDOM.nextFloat() * 0.5F + 0.4F) * colourScalar;
renderFace(matrix, vertexConsumer, 0, 1, 1, 0, 0, 0, 0, 0, red, green, blue); // Direction.NORTH
renderFace(matrix, vertexConsumer, 1, 1, 1, 0, 0, 1, 1, 0, red, green, blue); // Direction.EAST
renderFace(matrix, vertexConsumer, 0, 1, 0, 1, 1, 1, 1, 1, red, green, blue); // Direction.SOUTH
Expand Down
Loading

0 comments on commit 5c3a015

Please sign in to comment.