diff --git a/patches/server/0005-Leaves-Server-Config-And-Command.patch b/patches/server/0005-Leaves-Server-Config-And-Command.patch index 437df473..df66a9fe 100644 --- a/patches/server/0005-Leaves-Server-Config-And-Command.patch +++ b/patches/server/0005-Leaves-Server-Config-And-Command.patch @@ -78,10 +78,10 @@ index dd95c9d931da5ee2cb3e620c71cc90d178c51fbc..d1ebe4f340c53f987a42fffcc462f2ea .withRequiredArg() diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..9b558395d65921b097fd1ab6230496c93f6c97c3 +index 0000000000000000000000000000000000000000..4eac1921b5cb8616881bcb56b889336ac559920e --- /dev/null +++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java -@@ -0,0 +1,873 @@ +@@ -0,0 +1,876 @@ +package top.leavesmc.leaves; + +import com.destroystokyo.paper.util.SneakyThrow; @@ -546,6 +546,9 @@ index 0000000000000000000000000000000000000000..9b558395d65921b097fd1ab6230496c9 + @GlobalConfig(name = "renewable-deepslate", category = "modify") + public static boolean renewableDeepslate = false; + ++ @GlobalConfig(name = "renewable-sponges", category = "modify") ++ public static boolean renewableSponges = false; ++ + // Leaves start - modify - removed + + @RemovedConfig diff --git a/patches/server/0131-Renewable-sponges.patch b/patches/server/0131-Renewable-sponges.patch new file mode 100644 index 00000000..477cc13d --- /dev/null +++ b/patches/server/0131-Renewable-sponges.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: violetc <58360096+s-yh-china@users.noreply.github.com> +Date: Mon, 22 Jan 2024 11:41:13 +0800 +Subject: [PATCH] Renewable sponges + + +diff --git a/src/main/java/net/minecraft/world/entity/monster/Guardian.java b/src/main/java/net/minecraft/world/entity/monster/Guardian.java +index fd41ef66e2e12ec3a888bb376ef4363343914fcd..2719623d856ad33fa1164c566fddd8bd24dfc8bd 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Guardian.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Guardian.java +@@ -364,6 +364,30 @@ public class Guardian extends Monster { + return new Vector3f(0.0F, dimensions.height + 0.125F * scaleFactor, 0.0F); + } + ++ // Leaves start - renewable sponges ++ ++ @Override ++ public void thunderHit(net.minecraft.server.level.ServerLevel world, net.minecraft.world.entity.LightningBolt lightning) { ++ if (top.leavesmc.leaves.LeavesConfig.renewableSponges && !this.isRemoved() && !(this instanceof ElderGuardian)) { ++ ElderGuardian elderGuardian = new ElderGuardian(EntityType.ELDER_GUARDIAN ,this.level()); ++ elderGuardian.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot()); ++ elderGuardian.finalizeSpawn(world ,this.level().getCurrentDifficultyAt(elderGuardian.blockPosition()), MobSpawnType.CONVERSION, null, null); ++ elderGuardian.setNoAi(this.isNoAi()); ++ ++ if (this.hasCustomName()) { ++ elderGuardian.setCustomName(this.getCustomName()); ++ elderGuardian.setCustomNameVisible(this.isCustomNameVisible()); ++ } ++ ++ this.level().addFreshEntity(elderGuardian); ++ this.discard(); ++ } else { ++ super.thunderHit(world, lightning); ++ } ++ } ++ ++ // Leaves end - renewable sponges ++ + private static class GuardianMoveControl extends MoveControl { + + private final Guardian guardian;