mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-23 08:59:23 +00:00
64 lines
3.5 KiB
Diff
64 lines
3.5 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 e0f97f0072232fb4aa45e0cebc98860418c63215..8b17256c03682f54f1c22c59e16ea7d282574626 100644
|
|
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
|
@@ -256,4 +256,11 @@ public class LeafConfig {
|
|
compassItemShowsBossBar = getBoolean("gameplay-mechanics.item.compass.holding-shows-bossbar", compassItemShowsBossBar);
|
|
allowWaterPlacementInTheEnd = getBoolean("gameplay-mechanics.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
|
}
|
|
+
|
|
+ public static int spongeAbsorptionArea = 64;
|
|
+ public static int spongeAbsorptionRadius = 6;
|
|
+ private static void blockSettings() {
|
|
+ spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
|
|
+ spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
|
|
+ }
|
|
}
|