Skip to content

Commit

Permalink
Make Cauldron's fill chance for dripping lava and water configurable (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
12emin34 authored Mar 13, 2022
1 parent 36cc658 commit ad2bac1
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions patches/server/0224-Cauldron-fill-chances.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,51 @@ index dbae4f3b56d0290c6d28b9beaaa3b459754d43e3..676184c48c3abd8e2fb9a04ae3e165dc
}

@Override
diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
index 356b0cab78966f6b99396975c68042bff3526a9d..f512c958e157be21455adf5680d4c33d8a3dc8f8 100644
--- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
@@ -185,19 +185,19 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate

@VisibleForTesting
public static void maybeFillCauldron(BlockState state, ServerLevel world, BlockPos pos, float dripChance) {
- if (dripChance <= 0.17578125F || dripChance <= 0.05859375F) {
+ if (dripChance <= world.purpurConfig.cauldronDripstoneWaterFillChance || dripChance <= world.purpurConfig.cauldronDripstoneLavaFillChance) {
if (PointedDripstoneBlock.isStalactiteStartPos(state, world, pos)) {
Fluid fluidtype = PointedDripstoneBlock.getCauldronFillFluidType(world, pos);
float f1;

if (fluidtype == Fluids.WATER) {
- f1 = 0.17578125F;
+ f1 = world.purpurConfig.cauldronDripstoneWaterFillChance;
} else {
if (fluidtype != Fluids.LAVA) {
return;
}

- f1 = 0.05859375F;
+ f1 = world.purpurConfig.cauldronDripstoneLavaFillChance;
}

if (dripChance < f1) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 4ca41612b59a003189d12e1062688a6ba920d287..4c2b47abcb9f2f5d260cd5a07a01dac791462f69 100644
index 4ca41612b59a003189d12e1062688a6ba920d287..cb28c0dc5a5733e759fc728bb458aaa38452ebea 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2756,5 +2756,12 @@ public class PurpurWorldConfig {
@@ -2756,5 +2756,16 @@ public class PurpurWorldConfig {
});
conduitBlocks = conduitBlockList.toArray(Block[]::new);
}
+
+ public float cauldronRainChance = 0.05F;
+ public float cauldronPowderSnowChance = 0.1F;
+ public float cauldronDripstoneWaterFillChance = 0.17578125F;
+ public float cauldronDripstoneLavaFillChance = 0.05859375F;
+ private void cauldronSettings() {
+ cauldronRainChance = (float) getDouble("blocks.cauldron.fill-chances.rain", cauldronRainChance);
+ cauldronPowderSnowChance = (float) getDouble("blocks.cauldron.fill-chances.powder-snow", cauldronPowderSnowChance);
+ cauldronDripstoneWaterFillChance = (float) getDouble("blocks.cauldron.fill-chances.dripstone-water", cauldronDripstoneWaterFillChance);
+ cauldronDripstoneLavaFillChance = (float) getDouble("blocks.cauldron.fill-chances.dripstone-lava", cauldronDripstoneLavaFillChance);
+ }
}

0 comments on commit ad2bac1

Please sign in to comment.