Use fireTick game rule only in 1.13+; resolves #785

This commit is contained in:
Daniel Saukel 2020-05-03 20:19:19 +02:00
parent ca8ded0788
commit 3ed39ba92f
2 changed files with 8 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package de.erethon.dungeonsxl.world;
import de.erethon.caliburn.CaliburnAPI; import de.erethon.caliburn.CaliburnAPI;
import de.erethon.caliburn.item.ExItem; import de.erethon.caliburn.item.ExItem;
import de.erethon.caliburn.item.VanillaItem; import de.erethon.caliburn.item.VanillaItem;
import de.erethon.commons.compatibility.Internals;
import de.erethon.commons.compatibility.Version; import de.erethon.commons.compatibility.Version;
import de.erethon.commons.misc.BlockUtil; import de.erethon.commons.misc.BlockUtil;
import de.erethon.commons.misc.FileUtil; import de.erethon.commons.misc.FileUtil;
@ -407,7 +408,9 @@ public class DGameWorld extends DInstanceWorld implements GameWorld {
} }
getWorld().setDifficulty(getRules().getState(GameRule.DIFFICULTY)); getWorld().setDifficulty(getRules().getState(GameRule.DIFFICULTY));
if (Internals.isAtLeast(Internals.v1_13_R1)) {
getWorld().setGameRule(org.bukkit.GameRule.DO_FIRE_TICK, getRules().getState(GameRule.FIRE_TICK)); getWorld().setGameRule(org.bukkit.GameRule.DO_FIRE_TICK, getRules().getState(GameRule.FIRE_TICK));
}
isPlaying = true; isPlaying = true;

View File

@ -17,6 +17,7 @@
package de.erethon.dungeonsxl.world; package de.erethon.dungeonsxl.world;
import de.erethon.commons.chat.MessageUtil; import de.erethon.commons.chat.MessageUtil;
import de.erethon.commons.compatibility.Internals;
import de.erethon.commons.compatibility.Version; import de.erethon.commons.compatibility.Version;
import de.erethon.commons.misc.FileUtil; import de.erethon.commons.misc.FileUtil;
import de.erethon.dungeonsxl.DungeonsXL; import de.erethon.dungeonsxl.DungeonsXL;
@ -201,7 +202,9 @@ public class DResourceWorld implements ResourceWorld {
FileUtil.copyDir(folder, instanceFolder, DungeonsXL.EXCLUDED_FILES); FileUtil.copyDir(folder, instanceFolder, DungeonsXL.EXCLUDED_FILES);
instance.world = Bukkit.createWorld(WorldCreator.name(name).environment(getWorldEnvironment())).getName(); instance.world = Bukkit.createWorld(WorldCreator.name(name).environment(getWorldEnvironment())).getName();
if (Internals.isAtLeast(Internals.v1_13_R1)) {
instance.getWorld().setGameRule(GameRule.DO_FIRE_TICK, false); instance.getWorld().setGameRule(GameRule.DO_FIRE_TICK, false);
}
if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) { if (Bukkit.getPluginManager().isPluginEnabled("dynmap")) {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "dynmap pause all"); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "dynmap pause all");
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "dmap worldset " + name + " enabled:false"); Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "dmap worldset " + name + " enabled:false");