From e30ecbff97f48bbb60d12fe3f345d5851c97bf64 Mon Sep 17 00:00:00 2001 From: Max Hyper Date: Tue, 26 Nov 2024 20:36:53 -0300 Subject: [PATCH] Fixed saplings dropping when setting was set to false --- gradle.properties | 2 +- .../dynamictrees/block/DynamicSaplingBlock.java | 6 ++++-- .../com/ferreusveritas/dynamictrees/init/DTConfigs.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 556200942..f131e50b2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ modName=DynamicTrees modId=dynamictrees -modVersion=1.3.4 +modVersion=1.3.5 group=com.ferreusveritas.dynamictrees diff --git a/src/main/java/com/ferreusveritas/dynamictrees/block/DynamicSaplingBlock.java b/src/main/java/com/ferreusveritas/dynamictrees/block/DynamicSaplingBlock.java index 866ff22b7..649e7347a 100644 --- a/src/main/java/com/ferreusveritas/dynamictrees/block/DynamicSaplingBlock.java +++ b/src/main/java/com/ferreusveritas/dynamictrees/block/DynamicSaplingBlock.java @@ -132,8 +132,10 @@ public void neighborChanged(BlockState state, Level level, BlockPos pos, Block b } protected void dropBlock(Level level, BlockState state, BlockPos pos) { - level.addFreshEntity(new ItemEntity(level, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, getSpecies().getSeedStack(1))); - level.removeBlock(pos, false); + if (level instanceof ServerLevel serverLevel){ + getDrops(state, new LootParams.Builder(serverLevel)).forEach((drop) -> popResource(level, pos, drop)); + level.removeBlock(pos, false); + } } @Nonnull diff --git a/src/main/java/com/ferreusveritas/dynamictrees/init/DTConfigs.java b/src/main/java/com/ferreusveritas/dynamictrees/init/DTConfigs.java index 0313828de..89e48c076 100644 --- a/src/main/java/com/ferreusveritas/dynamictrees/init/DTConfigs.java +++ b/src/main/java/com/ferreusveritas/dynamictrees/init/DTConfigs.java @@ -111,7 +111,7 @@ public class DTConfigs { MAX_TREE_HARDNESS = SERVER_BUILDER.comment("Maximum harvesting hardness that can be calculated. Regardless of tree thickness."). defineInRange("maxTreeHardness", 20f, 1f, 200f); TREE_HARDNESS_MULTIPLIER = SERVER_BUILDER.comment("A multiplier of tree hardness. Higher values make trees slower to chop, lower values makes them faster to chop."). - defineInRange("maxTreeHardness", 1, 0.05f, 20f); + defineInRange("treeHardnessMultiplier", 1, (1/128f), 32f); TREE_GROWTH_FOLDING = SERVER_BUILDER.comment("Do X growth cycles at once while ignoring (X-1)/X attempts. Higher numbers can improve client side performance but too high can make trees grow wierd."). defineInRange("growthFolding", 2, 1, 8); DROP_STICKS = SERVER_BUILDER.comment("If enabled then sticks will be dropped for partial logs").