Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old sculk spread option #6189

Merged
merged 1 commit into from
Sep 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
7 changes: 0 additions & 7 deletions src/com/palmergames/bukkit/config/ConfigNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"",
Expand Down
4 changes: 0 additions & 4 deletions src/com/palmergames/bukkit/towny/TownySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -458,6 +451,7 @@ public void onCauldronLevelChange(CauldronLevelChangeEvent event) {
}
}
}
default -> {}
}
}
}