From 01492c67926c2fcd5ba2122ce54476d99345d9e6 Mon Sep 17 00:00:00 2001
From: Warrior <50800980+Warriorrrr@users.noreply.github.com>
Date: Fri, 23 Sep 2022 17:45:59 +0200
Subject: [PATCH] Remove old sculk spread option
---
pom.xml | 2 +-
src/com/palmergames/bukkit/config/ConfigNodes.java | 7 -------
src/com/palmergames/bukkit/towny/TownySettings.java | 4 ----
.../bukkit/towny/listeners/TownyBlockListener.java | 8 +-------
4 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/pom.xml b/pom.xml
index 09c2392f62..2f6b654fc7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -95,7 +95,7 @@
org.spigotmc
spigot-api
- 1.19-R0.1-SNAPSHOT
+ 1.19.2-R0.1-SNAPSHOT
provided
diff --git a/src/com/palmergames/bukkit/config/ConfigNodes.java b/src/com/palmergames/bukkit/config/ConfigNodes.java
index f614c29eb5..c25ab85b79 100644
--- a/src/com/palmergames/bukkit/config/ConfigNodes.java
+++ b/src/com/palmergames/bukkit/config/ConfigNodes.java
@@ -1488,13 +1488,6 @@ public enum ConfigNodes {
"",
"# When set to true, players will never trample crops. When false, players will still",
"# have to be able to break the crop by hand in order to be able to trample crops."),
- PROT_SCULK_SPREAD(
- "protection.prevent_sculk_spread_in_mobs_off_locations",
- "true",
- "",
- "# When set to true, sculk will not spread into areas which have mobs disabled.",
- "# This uses the wildernessmobs world setting when in the Towny wilderness.",
- "# This setting is not used if your spigot is up to date. (They fixed the API after June 19, 2022.)"),
UNCLAIMED_ZONE(
"unclaimed",
"",
diff --git a/src/com/palmergames/bukkit/towny/TownySettings.java b/src/com/palmergames/bukkit/towny/TownySettings.java
index f6555b48fa..f47f6e11ba 100644
--- a/src/com/palmergames/bukkit/towny/TownySettings.java
+++ b/src/com/palmergames/bukkit/towny/TownySettings.java
@@ -3100,10 +3100,6 @@ public static boolean isPlayerCropTramplePrevented() {
return getBoolean(ConfigNodes.PROT_CROP_TRAMPLE);
}
- public static boolean isSculkSpreadPreventWhereMobsAreDisabled() {
- return getBoolean(ConfigNodes.PROT_SCULK_SPREAD);
- }
-
public static boolean isNotificationsAppearingOnBossbar() {
return getString(ConfigNodes.NOTIFICATION_NOTIFICATIONS_APPEAR_AS).equalsIgnoreCase("bossbar");
}
diff --git a/src/com/palmergames/bukkit/towny/listeners/TownyBlockListener.java b/src/com/palmergames/bukkit/towny/listeners/TownyBlockListener.java
index 6ddf9e530c..9d621ed6ec 100644
--- a/src/com/palmergames/bukkit/towny/listeners/TownyBlockListener.java
+++ b/src/com/palmergames/bukkit/towny/listeners/TownyBlockListener.java
@@ -421,16 +421,9 @@ public void onSculkSpread(BlockSpreadEvent event) {
// Check if the sculk is passing across a border with differing owners, allowing
// sculk to spread from a town into the wilderness.
event.setCancelled(!canBlockMove(event.getSource(), event.getBlock(), true));
- } else if (TownySettings.isSculkSpreadPreventWhereMobsAreDisabled()) {
- // Early 1.19 versions of spigot did not correctly report the source as
- // sculk_catalyst. We use a config setting that will cancel based on
- // mobs-spawning plot perms.
- // TODO: remove this when 1.19.1 is out.
- event.setCancelled(!TownyAPI.getInstance().areMobsEnabled(event.getBlock().getLocation()));
}
}
- @SuppressWarnings("incomplete-switch")
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
public void onCauldronLevelChange(CauldronLevelChangeEvent event) {
if (!(event.getEntity() instanceof Player player))
@@ -458,6 +451,7 @@ public void onCauldronLevelChange(CauldronLevelChangeEvent event) {
}
}
}
+ default -> {}
}
}
}