mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-28 19:39:17 +00:00
64 lines
3.4 KiB
Diff
64 lines
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Encode42 <me@encode42.dev>
|
|
Date: Wed, 24 Mar 2021 20:30:37 -0400
|
|
Subject: [PATCH] Purpur: Configurable sponge absorption
|
|
|
|
Original license: MIT
|
|
Original project: https://github.com/PurpurMC/Purpur
|
|
|
|
Allows the total area and radius of water blocks the sponge can absorb to be changed.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
|
|
index 7304b2659eb45bc4bc9fa7c43e6ca07221d0fc73..35a69bb50bc0575dd4f285cc9499d085fe6512ea 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
|
|
@@ -76,13 +76,13 @@ public class SpongeBlock extends Block {
|
|
if (fluid.is(FluidTags.WATER)) {
|
|
if (iblockdata.getBlock() instanceof BucketPickup && !((BucketPickup) iblockdata.getBlock()).pickupBlock(blockList, blockposition2, iblockdata).isEmpty()) { // CraftBukkit
|
|
++i;
|
|
- if (j < 6) {
|
|
+ if (j < org.dreeam.leaf.LeafConfig.spongeAbsorptionRadius) { // Purpur
|
|
queue.add(new Tuple<>(blockposition2, j + 1));
|
|
}
|
|
} else if (iblockdata.getBlock() instanceof LiquidBlock) {
|
|
blockList.setBlock(blockposition2, Blocks.AIR.defaultBlockState(), 3); // CraftBukkit
|
|
++i;
|
|
- if (j < 6) {
|
|
+ if (j < org.dreeam.leaf.LeafConfig.spongeAbsorptionRadius) { // Purpur
|
|
queue.add(new Tuple<>(blockposition2, j + 1));
|
|
}
|
|
} else if (material == Material.WATER_PLANT || material == Material.REPLACEABLE_WATER_PLANT) {
|
|
@@ -93,14 +93,14 @@ public class SpongeBlock extends Block {
|
|
blockList.setBlock(blockposition2, Blocks.AIR.defaultBlockState(), 3);
|
|
// CraftBukkit end
|
|
++i;
|
|
- if (j < 6) {
|
|
+ if (j < org.dreeam.leaf.LeafConfig.spongeAbsorptionRadius) { // Purpur
|
|
queue.add(new Tuple<>(blockposition2, j + 1));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
- if (i > 64) {
|
|
+ if (i > org.dreeam.leaf.LeafConfig.spongeAbsorptionArea) { // Purpur
|
|
break;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
index 06664bb40fe4b55998e7a0957cbb4b9fa4f8b05f..680ada855140ad86c5c953c7357fc745b308b334 100644
|
|
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
@@ -237,4 +237,11 @@ public class LeafConfig {
|
|
private static void allowWaterPlacementInEnd() {
|
|
allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
|
}
|
|
+
|
|
+ public static int spongeAbsorptionArea = 64;
|
|
+ public static int spongeAbsorptionRadius = 6;
|
|
+ private static void spongeSettings() {
|
|
+ spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
|
|
+ spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
|
|
+ }
|
|
}
|