From 3ed39ba92f7dfa3dc01347f3d38e0d6805e5832f Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Sun, 3 May 2020 20:19:19 +0200 Subject: [PATCH] Use fireTick game rule only in 1.13+; resolves #785 --- .../main/java/de/erethon/dungeonsxl/world/DGameWorld.java | 5 ++++- .../java/de/erethon/dungeonsxl/world/DResourceWorld.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java index ab053d70..37334f94 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java +++ b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java @@ -19,6 +19,7 @@ package de.erethon.dungeonsxl.world; import de.erethon.caliburn.CaliburnAPI; import de.erethon.caliburn.item.ExItem; import de.erethon.caliburn.item.VanillaItem; +import de.erethon.commons.compatibility.Internals; import de.erethon.commons.compatibility.Version; import de.erethon.commons.misc.BlockUtil; import de.erethon.commons.misc.FileUtil; @@ -407,7 +408,9 @@ public class DGameWorld extends DInstanceWorld implements GameWorld { } getWorld().setDifficulty(getRules().getState(GameRule.DIFFICULTY)); - getWorld().setGameRule(org.bukkit.GameRule.DO_FIRE_TICK, getRules().getState(GameRule.FIRE_TICK)); + if (Internals.isAtLeast(Internals.v1_13_R1)) { + getWorld().setGameRule(org.bukkit.GameRule.DO_FIRE_TICK, getRules().getState(GameRule.FIRE_TICK)); + } isPlaying = true; diff --git a/core/src/main/java/de/erethon/dungeonsxl/world/DResourceWorld.java b/core/src/main/java/de/erethon/dungeonsxl/world/DResourceWorld.java index 9560276a..41e62004 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/world/DResourceWorld.java +++ b/core/src/main/java/de/erethon/dungeonsxl/world/DResourceWorld.java @@ -17,6 +17,7 @@ package de.erethon.dungeonsxl.world; import de.erethon.commons.chat.MessageUtil; +import de.erethon.commons.compatibility.Internals; import de.erethon.commons.compatibility.Version; import de.erethon.commons.misc.FileUtil; import de.erethon.dungeonsxl.DungeonsXL; @@ -201,7 +202,9 @@ public class DResourceWorld implements ResourceWorld { FileUtil.copyDir(folder, instanceFolder, DungeonsXL.EXCLUDED_FILES); instance.world = Bukkit.createWorld(WorldCreator.name(name).environment(getWorldEnvironment())).getName(); - instance.getWorld().setGameRule(GameRule.DO_FIRE_TICK, false); + if (Internals.isAtLeast(Internals.v1_13_R1)) { + instance.getWorld().setGameRule(GameRule.DO_FIRE_TICK, false); + } if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) { Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "dynmap pause all"); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "dmap worldset " + name + " enabled:false");