Add fireTick game rule

This commit is contained in:
Daniel Saukel 2020-04-16 22:17:16 +02:00
parent f23e14cf01
commit 790e925e5c
3 changed files with 7 additions and 0 deletions

View File

@ -151,6 +151,10 @@ public class GameRule<V> {
* A whitelist of placeable blocks. placeBlocks is supposed to be set to "true" if this should be used.
*/
public static final GameRule<Set<ExItem>> PLACE_WHITELIST = new CollectionGameRule<>("placeWhitelist", null, ConfigReader.EX_ITEM_SET_READER, HashSet::new);
/**
* This does what the doFireTick Vanilla game rule does.
*/
public static final GameRule<Boolean> FIRE_TICK = new GameRule<>(Boolean.class, "fireTick", false);
/**
* If it should rain permanently in the dungeon.
* <p>

View File

@ -411,6 +411,7 @@ public class DGameWorld extends DInstanceWorld implements GameWorld {
}
world.setDifficulty(getRules().getState(GameRule.DIFFICULTY));
world.setGameRule(org.bukkit.GameRule.DO_FIRE_TICK, getRules().getState(GameRule.FIRE_TICK));
isPlaying = true;

View File

@ -30,6 +30,7 @@ import de.erethon.dungeonsxl.event.editworld.EditWorldGenerateEvent;
import java.io.File;
import java.io.IOException;
import org.bukkit.Bukkit;
import org.bukkit.GameRule;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.World.Environment;
@ -200,6 +201,7 @@ public class DResourceWorld implements ResourceWorld {
FileUtil.copyDir(folder, instanceFolder, DungeonsXL.EXCLUDED_FILES);
instance.world = Bukkit.createWorld(WorldCreator.name(name).environment(getWorldEnvironment()));
instance.world.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");