From 5e21c8e8f65b16a4d24a65f09f0f0ee691f474f1 Mon Sep 17 00:00:00 2001 From: Sen Date: Mon, 14 Apr 2025 18:03:23 +0200 Subject: [PATCH] add blackwood --- java/src/game/biome/BiomeBlackened.java | 19 ++++++++++++++++++- java/src/game/init/Blocks.java | 2 ++ java/src/game/init/WoodType.java | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/java/src/game/biome/BiomeBlackened.java b/java/src/game/biome/BiomeBlackened.java index d21cbb3..996197e 100644 --- a/java/src/game/biome/BiomeBlackened.java +++ b/java/src/game/biome/BiomeBlackened.java @@ -1,17 +1,34 @@ package game.biome; +import game.block.BlockFlower; +import game.entity.npc.EntityMetalhead; import game.init.Blocks; +import game.rng.Random; import game.rng.WeightedList; +import game.world.BlockPos; +import game.worldgen.tree.WorldGenBaseTree; +import game.worldgen.tree.WorldGenTree; public class BiomeBlackened extends Biome { + protected final WorldGenTree treeGen = new WorldGenBaseTree(false, Blocks.blackwood_log.getState(), Blocks.blackwood_leaves.getState()); + public BiomeBlackened(int id) { super(id); this.topBlock = Blocks.blackened_soil.getState(); this.fillerBlock = Blocks.blackened_dirt.getState(); - this.treesPerChunk = -999; + this.treesPerChunk = 3; this.generateLakes = false; } protected void addMobs(WeightedList mobs) { + mobs.add(new RngSpawn(EntityMetalhead.class, 50, 1, 1)); + } + + public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { + return BlockFlower.EnumFlowerType.BLACK_LOTUS; + } + + public WorldGenTree genBigTreeChance(Random rand) { + return this.treeGen; } } diff --git a/java/src/game/init/Blocks.java b/java/src/game/init/Blocks.java index b8b5828..a9092c8 100755 --- a/java/src/game/init/Blocks.java +++ b/java/src/game/init/Blocks.java @@ -86,6 +86,7 @@ public abstract class Blocks { public static final Block cherry_log = get("cherry_log"); public static final Block maple_log = get("maple_log"); public static final Block tian_log = get("tian_log"); + public static final Block blackwood_log = get("blackwood_log"); public static final Block oak_slab = get("oak_slab"); public static final Block spruce_slab = get("spruce_slab"); public static final Block birch_slab = get("birch_slab"); @@ -281,6 +282,7 @@ public abstract class Blocks { public static final BlockLeaves cherry_leaves = (BlockLeaves)get("cherry_leaves"); public static final BlockLeaves maple_leaves = (BlockLeaves)get("maple_leaves"); public static final BlockLeaves tian_leaves = (BlockLeaves)get("tian_leaves"); + public static final BlockLeaves blackwood_leaves = (BlockLeaves)get("blackwood_leaves"); public static final Block cherry_stairs = get("cherry_stairs"); public static final Block maple_stairs = get("maple_stairs"); public static final Block cherry_door = get("cherry_door"); diff --git a/java/src/game/init/WoodType.java b/java/src/game/init/WoodType.java index 3b1f7c5..53105c9 100755 --- a/java/src/game/init/WoodType.java +++ b/java/src/game/init/WoodType.java @@ -11,7 +11,8 @@ public enum WoodType { DARK_OAK("dark_oak", "Schwarzeichen", null, 20), CHERRY("cherry", "Kirsch", Colorizer.NONE, 20), MAPLE("maple", "Ahorn", Colorizer.NONE, 20), - TIAN("tian", "Tian", Colorizer.NONE, 80); + TIAN("tian", "Tian", Colorizer.NONE, 80), + BLACKWOOD("blackwood", "Schwarz", Colorizer.NONE, 60); private final String name; private final Colorizer tintType;