Skip to content

Commit

Permalink
Actually fixed spawning on top of level 2 roof when using portal bloc…
Browse files Browse the repository at this point in the history
…k. Speaking of level 2, it now has a bedrock bricks roof. Office and plate doors no longer have invisible outline in fast mode rendering. Also quiet a few blocks got new sounds(for example crate now has wood sounds instead of cobblestone sounds(???), all the blocks which were meant to be mineable are now mineable.

Fixed respawn rule.
  • Loading branch information
MegDuck committed Sep 15, 2024
1 parent 8a86269 commit 36de091
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 46 deletions.
11 changes: 0 additions & 11 deletions src/main/java/com/kpabr/backrooms/block/PlateDoor.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/com/kpabr/backrooms/block/PortalBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit

int y = 30;
if(state.get(LEVEL) == 2) {
y = 10;
y = 5;
}

EntityHelper.teleportToLevel((ServerPlayerEntity) entity, portalBlockWorld, y);
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/kpabr/backrooms/client/BackroomsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public void onInitializeClient() {
BackroomsFluids.STILL_ALMOND_WATER,
BackroomsFluids.FLOWING_ALMOND_WATER);

BlockRenderLayerMap.INSTANCE.putBlock(BackroomsBlocks.PLATE_DOOR, RenderLayer.getCutout());
BlockRenderLayerMap.INSTANCE.putBlock(BackroomsBlocks.OFFICE_DOOR, RenderLayer.getCutout());


EntityRendererRegistry.register(BackroomsEntities.HOUND, HoundEntityRenderer::new);
EntityRendererRegistry.register(BackroomsEntities.WRETCH, WretchEntityRenderer::new);
}
Expand Down
23 changes: 11 additions & 12 deletions src/main/java/com/kpabr/backrooms/init/BackroomsBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ public class BackroomsBlocks {

public static final Block MACHINERY_BLOCK = add("machinery",
new MachineryBlock(
FabricBlockSettings.copyOf(Blocks.STONE).mapColor(DyeColor.GRAY).sounds(BlockSoundGroup.TUFF)),
FabricBlockSettings.copyOf(Blocks.SHROOMLIGHT).mapColor(DyeColor.GRAY).sounds(BlockSoundGroup.TUFF)),
ItemGroups.BUILDING_BLOCKS);

public static final Block ROOF_WIRING = add(
"roof_wiring", new RoofWiringBlock(FabricBlockSettings.copyOf(Blocks.STONE).mapColor(DyeColor.BROWN)
.strength(0F).noCollision().sounds(BlockSoundGroup.SMALL_DRIPLEAF).nonOpaque()),
ItemGroups.BUILDING_BLOCKS);

public static final Block CRATE = add("crate", new CrateBlock(FabricBlockSettings.copyOf(CEMENT).nonOpaque()),
public static final Block CRATE = add("crate", new CrateBlock(FabricBlockSettings.copyOf(Blocks.CHEST).nonOpaque()),
ItemGroups.FUNCTIONAL);

public static final BlockEntityType<CrateBlockEntity> CRATE_BLOCK_ENTITY = add("crate",
Expand Down Expand Up @@ -220,19 +220,19 @@ public class BackroomsBlocks {


public static final Block RED_PATTERNED_WALLPAPER = add("red_patterned_wallpaper",
new WallpaperBlock(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).mapColor(DyeColor.YELLOW)
new WallpaperBlock(FabricBlockSettings.copyOf(PATTERNED_WALLPAPER).mapColor(DyeColor.RED)
.sounds(BlockSoundGroup.STEM)),
ItemGroups.BUILDING_BLOCKS);

public static final Block RED_STRIPED_WALLPAPER = add("red_striped_wallpaper",
new WallpaperBlock(FabricBlockSettings.copyOf(PATTERNED_WALLPAPER).sounds(BlockSoundGroup.STEM)),
new WallpaperBlock(FabricBlockSettings.copyOf(RED_PATTERNED_WALLPAPER)),
ItemGroups.BUILDING_BLOCKS);

public static final Block RED_DOTTED_WALLPAPER = add("red_dotted_wallpaper",
new WallpaperBlock(FabricBlockSettings.copyOf(PATTERNED_WALLPAPER)), ItemGroups.BUILDING_BLOCKS);
new WallpaperBlock(FabricBlockSettings.copyOf(RED_PATTERNED_WALLPAPER)), ItemGroups.BUILDING_BLOCKS);

public static final Block RED_BLANK_WALLPAPER = add("red_blank_wallpaper",
new WallpaperBlock(FabricBlockSettings.copyOf(PATTERNED_WALLPAPER)), ItemGroups.BUILDING_BLOCKS);
new WallpaperBlock(FabricBlockSettings.copyOf(RED_PATTERNED_WALLPAPER)), ItemGroups.BUILDING_BLOCKS);


public static final Block FANCY_PILLAR = add("fancy_pillar", new PillarBlock(
Expand All @@ -255,16 +255,15 @@ public class BackroomsBlocks {


public static final Block OFFICE_DOOR = add("office_door",
new BackroomsDoorBlock(FabricBlockSettings.copyOf(Blocks.DARK_OAK_DOOR).nonOpaque(), BlockSetType.DARK_OAK),
new DoorBlock(FabricBlockSettings.copyOf(Blocks.DARK_OAK_DOOR), BlockSetType.DARK_OAK),
ItemGroups.BUILDING_BLOCKS);

public static final Block PLATE_DOOR = add("plate_door",
new PlateDoor(FabricBlockSettings.copyOf(Blocks.IRON_DOOR)), ItemGroups.BUILDING_BLOCKS);
new DoorBlock(FabricBlockSettings.copyOf(Blocks.IRON_DOOR), BlockSetType.IRON), ItemGroups.BUILDING_BLOCKS);


public static final Block FIRESALT_BLOCK = add("firesalt_block",
new Block(FabricBlockSettings.copyOf(Blocks.COBBLESTONE).mapColor(DyeColor.ORANGE).collidable(true)
.sounds(BlockSoundGroup.DRIPSTONE_BLOCK)),
new Block(FabricBlockSettings.copyOf(Blocks.AMETHYST_BLOCK).mapColor(DyeColor.ORANGE)),
ItemGroups.BUILDING_BLOCKS);

public static final Block FIRESALT_CRYSTAL = add("firesalt_crystal",
Expand Down Expand Up @@ -312,10 +311,10 @@ public class BackroomsBlocks {
ItemGroups.BUILDING_BLOCKS);
public static final Block PORTAL_BLOCK = add("portal_block", new PortalBlock(), ItemGroups.BUILDING_BLOCKS);
public static final Block NOCLIP_CARPETING = add("noclip_carpeting",
new NoclipBlock(FabricBlockSettings.copyOf(Blocks.WHITE_WOOL).noCollision()),
new NoclipBlock(FabricBlockSettings.copyOf(Blocks.WHITE_WOOL).noCollision().dropsNothing()),
ItemGroups.FUNCTIONAL);
public static final Block NOCLIP_WALL = add("noclip_wall",
new NoclipBlock(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).noCollision()),
new NoclipBlock(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).noCollision().dropsNothing()),
ItemGroups.FUNCTIONAL);

private static <T extends BlockEntity> BlockEntityType<T> add(String name, BlockEntityType<T> blockEntity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public static void init() {
setPlayerSpawnpoint((ServerPlayerEntity) LivingEntity);
}
}

});
}

Expand All @@ -82,8 +81,7 @@ private static void setPlayerSpawnpoint(ServerPlayerEntity player) {
if (player.getWorld().getRegistryKey().getValue().toString().contains("backrooms")
&& respawnPolicy == Respawn.in_current_level) {
setSpawnpointToCurrentLevel(player);
} else if (player.getWorld().getRegistryKey().getValue().toString().contains("backrooms")
&& respawnPolicy == Respawn.in_level_zero) {
} else if (respawnPolicy == Respawn.in_level_zero) {
setSpawnpointToLevel0(player);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ else if (isHot)
fillRectZX(chunk, chunk, pos, 3, 1, 11, 7, FLOOR_Y + 7,
random.nextBoolean() ? fluorescentLightOn : fluorescentLightOff);


// Generate hot and cold pipes biomes features(magma and ice)
if (isCold) {
// Generate on floor
Expand Down Expand Up @@ -389,6 +390,8 @@ else if (isHot)
fillRectZX(chunk, chunk, pos, 16, 16, 0, 0, FLOOR_Y + i, Blocks.LIGHT_GRAY_TERRACOTTA);
}
}
// generate roof and floor of the 2nd level.
fillRectZX(chunk, chunk, pos, 16, 16, 0, 0, FLOOR_Y+8, BackroomsBlocks.BEDROCK_BRICKS);
fillRectZX(chunk, chunk, pos, 16, 16, 0, 0, FLOOR_Y, BackroomsBlocks.BEDROCK_BRICKS);
return CompletableFuture.completedFuture(chunk);
}
Expand Down
27 changes: 27 additions & 0 deletions src/main/resources/data/backrooms/loot_tables/blocks/crate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:copy_name",
"source": "block_entity"
}
],
"name": "backrooms:crate"
}
],
"rolls": 1.0
}
],
"random_sequence": "backrooms:blocks/crate"
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"type": "minecraft:block",
"pools": [
"rolls": 1,
"entries": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "backrooms:magenta_carpeting"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
"type": "minecraft:item",
"name": "backrooms:magenta_carpeting"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"block": "backrooms:office_door",
"condition": "minecraft:block_state_property",
"properties": {
"half": "lower"
}
}
],
"name": "backrooms:office_door"
}
],
"rolls": 1.0
}
],
"random_sequence": "backrooms:blocks/office_door"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"conditions": [
{
"block": "backrooms:plate_door",
"condition": "minecraft:block_state_property",
"properties": {
"half": "lower"
}
}
],
"name": "backrooms:plate_door"
}
],
"rolls": 1.0
}
],
"random_sequence": "backrooms:blocks/plate_door"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "backrooms:repaired_fluorescent_light"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
6 changes: 6 additions & 0 deletions src/main/resources/data/minecraft/tags/blocks/doors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"backrooms:plate_door"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
"values": [
"backrooms:patterned_wallpaper",
"backrooms:red_patterned_wallpaper",
"backrooms:red_striped_wallpaper",
"backrooms:red_dotted_wallpaper",
"backrooms:red_blank_wallpaper",
"backrooms:fake_wall",
"backrooms:striped_wallpaper",
"backrooms:dotted_wallpaper",
"backrooms:blank_wallpaper",
"backrooms:red_striped_wallpaper",
"backrooms:red_dotted_wallpaper"
"backrooms:noclip_wall",
"backrooms:office_door",
"backrooms:crate"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
"backrooms:fancy_pillar",
"backrooms:pipe",
"backrooms:parking_cement_pillar",
"backrooms:cement_pillar"
"backrooms:cement_pillar",
"backrooms:plate_door",
"backrooms:repaired_fluorescent_light",
"backrooms:machinery"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"backrooms:office_door"
]
}
4 changes: 3 additions & 1 deletion src/main/resources/data/minecraft/tags/blocks/wool.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"backrooms:pink_carpeting",
"backrooms:purple_carpeting",
"backrooms:white_carpeting",
"backrooms:red_carpeting"
"backrooms:red_carpeting",
"backrooms:noclip_carpeting",
"backrooms:hotel_carpet"
]
}

0 comments on commit 36de091

Please sign in to comment.