Fixes #153. Switching to creative didn't stop damage that had started

This commit is contained in:
tastybento 2024-05-16 21:20:55 -07:00
parent 7b232294ed
commit eb1d21fee1

View File

@ -234,6 +234,7 @@ public class AcidEffect implements Listener {
*/ */
private boolean isSafeFromRain(Player player) { private boolean isSafeFromRain(Player player) {
if (isEssentialsGodMode(player) || player.getWorld().getEnvironment().equals(Environment.NETHER) if (isEssentialsGodMode(player) || player.getWorld().getEnvironment().equals(Environment.NETHER)
|| player.getGameMode() != GameMode.SURVIVAL
|| player.getWorld().getEnvironment().equals(Environment.THE_END) || player.getWorld().getEnvironment().equals(Environment.THE_END)
|| (addon.getSettings().isHelmetProtection() && (player.getInventory().getHelmet() != null || (addon.getSettings().isHelmetProtection() && (player.getInventory().getHelmet() != null
&& player.getInventory().getHelmet().getType().name().contains("HELMET"))) && player.getInventory().getHelmet().getType().name().contains("HELMET")))
@ -264,7 +265,7 @@ public class AcidEffect implements Listener {
*/ */
boolean isSafeFromAcid(Player player) { boolean isSafeFromAcid(Player player) {
// Check for GodMode // Check for GodMode
if (isEssentialsGodMode(player) if (isEssentialsGodMode(player) || player.getGameMode() != GameMode.SURVIVAL
// Protect visitors // Protect visitors
|| (addon.getPlugin().getIWM().getIvSettings(player.getWorld()).contains(DamageCause.CUSTOM.name()) || (addon.getPlugin().getIWM().getIvSettings(player.getWorld()).contains(DamageCause.CUSTOM.name())
&& !addon.getIslands().userIsOnIsland(player.getWorld(), User.getInstance(player)))) { && !addon.getIslands().userIsOnIsland(player.getWorld(), User.getInstance(player)))) {