mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-24 19:45:43 +01:00
Add fireTick game rule
This commit is contained in:
parent
f23e14cf01
commit
790e925e5c
@ -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>
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user