From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 12emin34 <macanovic.emin@gmail.com>
Date: Sat, 7 Aug 2021 20:23:31 +0200
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 5b10e1110f938745c8f9ed0b55960566bc720c30..c97fddfc680a9d1934c751e0e87e287dd9b9c640 100644
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
@@ -74,7 +74,7 @@ public class SpongeBlock extends Block {
                 // CraftBukkit end
                 Material material = iblockdata.getMaterial();
 
-                if (fluid.is((Tag) FluidTags.WATER)) {
+                if (fluid.is(FluidTags.WATER) || (world.purpurConfig.spongeAbsorbsLava && fluid.is(FluidTags.LAVA))) {
                     if (iblockdata.getBlock() instanceof BucketPickup && !((BucketPickup) iblockdata.getBlock()).pickupBlock(blockList, blockposition2, iblockdata).isEmpty()) { // CraftBukkit
                         ++i;
                         if (j < world.purpurConfig.spongeAbsorptionRadius) { // Purpur
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 4a8ce59f40985d4742ba69f54e259cd8504e4fec..b384899bff3948cbddcd7263077c182cb2b442bf 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -935,9 +935,11 @@ public class PurpurWorldConfig {
 
     public int spongeAbsorptionArea = 64;
     public int spongeAbsorptionRadius = 6;
+    public boolean spongeAbsorbsLava = false;
     private void spongeSettings() {
         spongeAbsorptionArea = getInt("blocks.sponge.absorption.area", spongeAbsorptionArea);
         spongeAbsorptionRadius = getInt("blocks.sponge.absorption.radius", spongeAbsorptionRadius);
+        spongeAbsorbsLava = getBoolean("blocks.sponge.absorbs-lava", spongeAbsorbsLava);
     }
 
     public float stonecutterDamage = 0.0F;
