Skip to content

Commit

Permalink
actually use spongeAbsorptionArea option
Browse files Browse the repository at this point in the history
  • Loading branch information
granny committed Aug 8, 2023
1 parent e1e566a commit 98f1077
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions patches/server/0155-Configurable-sponge-absorption.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ Allows the total area and radius of water blocks the sponge can absorb to be cha
Co-authored by: granny <granny@purpurmc.org>

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 4bce895268542531598a01a1bccd8ac1ed703b7d..e4e926dc89f843886d0df5da31e00053284f5dae 100644
index 4bce895268542531598a01a1bccd8ac1ed703b7d..709dd0af07f2439d7c7e8b5cd0677580dc3f6278 100644
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
@@ -48,7 +48,7 @@ public class SpongeBlock extends Block {

private boolean removeWaterBreadthFirstSearch(Level world, BlockPos pos) {
BlockStateListPopulator blockList = new BlockStateListPopulator(world); // CraftBukkit - Use BlockStateListPopulator
- BlockPos.breadthFirstTraversal(pos, 6, 65, (blockposition1, consumer) -> {
+ BlockPos.breadthFirstTraversal(pos, world.purpurConfig.spongeAbsorptionRadius, 65, (blockposition1, consumer) -> { // Purpur
+ BlockPos.breadthFirstTraversal(pos, world.purpurConfig.spongeAbsorptionRadius, world.purpurConfig.spongeAbsorptionArea, (blockposition1, consumer) -> { // Purpur
Direction[] aenumdirection = SpongeBlock.ALL_DIRECTIONS;
int i = aenumdirection.length;

diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index a89b8de2c5aad1d9b7cade9aa4e15ea1a80444a9..1bcedb8d45c745e8261b59340decf70976de0d4b 100644
index a89b8de2c5aad1d9b7cade9aa4e15ea1a80444a9..450eacf1cc38e51b2d3c16f3bd677a76640774c0 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -634,6 +634,13 @@ public class PurpurWorldConfig {
spawnerDeactivateByRedstone = getBoolean("blocks.spawner.deactivate-by-redstone", spawnerDeactivateByRedstone);
}

+ public int spongeAbsorptionArea = 64;
+ public int spongeAbsorptionArea = 65;
+ public int spongeAbsorptionRadius = 6;
+ private void spongeSettings() {
+ spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0204-Option-for-sponges-to-work-on-lava.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Option for sponges to work on lava


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 e4e926dc89f843886d0df5da31e00053284f5dae..a08d72fdf36435be890bb385d28510a1c78c9934 100644
index 709dd0af07f2439d7c7e8b5cd0677580dc3f6278..71aec16774943b6c87ddab0d888640224c2f02cb 100644
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
@@ -67,7 +67,7 @@ public class SpongeBlock extends Block {
Expand All @@ -18,12 +18,12 @@ index e4e926dc89f843886d0df5da31e00053284f5dae..a08d72fdf36435be890bb385d28510a1
} else {
Block block = iblockdata.getBlock();
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index b2451d579db682dbb83dbdfb7854ed6181a1b649..9c88029ebfcc1fd487265ed0b3265f6a5fdab4ba 100644
index e93efa6315cab1c83296a918cbdb049497231acb..cacb0304102e0096f609cd59478b2f0c529482e0 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -930,9 +930,11 @@ public class PurpurWorldConfig {

public int spongeAbsorptionArea = 64;
public int spongeAbsorptionArea = 65;
public int spongeAbsorptionRadius = 6;
+ public boolean spongeAbsorbsLava = false;
private void spongeSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index cd2ce5bcb8c30e4657cd0e340d80544c7e805905..c8c6fed3f93903bb5c6145930538d415
}
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index a57bb89d44f0587a0c62ec39342a155f7db58a43..75bc33a9803eb0b192b287aa72f50a9db83a89f0 100644
index 24dafbd6958a556036b97e295e8f160865937fe2..19c037241d4dde879305fa838d895d47e67389a5 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -979,8 +979,10 @@ public class PurpurWorldConfig {
Expand All @@ -30,4 +30,4 @@ index a57bb89d44f0587a0c62ec39342a155f7db58a43..75bc33a9803eb0b192b287aa72f50a9d
+ spawnerFixMC238526 = getBoolean("blocks.spawner.fix-mc-238526", spawnerFixMC238526);
}

public int spongeAbsorptionArea = 64;
public int spongeAbsorptionArea = 65;

0 comments on commit 98f1077

Please sign in to comment.