diff --git a/api/src/main/java/de/erethon/dungeonsxl/api/dungeon/GameRule.java b/api/src/main/java/de/erethon/dungeonsxl/api/dungeon/GameRule.java index 07bc1d2c..4f66e23a 100644 --- a/api/src/main/java/de/erethon/dungeonsxl/api/dungeon/GameRule.java +++ b/api/src/main/java/de/erethon/dungeonsxl/api/dungeon/GameRule.java @@ -33,6 +33,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import org.bukkit.Difficulty; import org.bukkit.GameMode; import org.bukkit.configuration.ConfigurationSection; @@ -69,9 +70,13 @@ public class GameRule { */ public static final GameRule GAME_GOAL = new GameRule<>(GameGoal.class, "gameGoal", GameGoal.END); /** - * The game mode. + * The Vanilla game mode. */ public static final GameRule GAME_MODE = new GameRule<>(GameMode.class, "gameMode", GameMode.SURVIVAL); + /** + * The Vanilla difficulty. + */ + public static final GameRule DIFFICULTY = new GameRule<>(Difficulty.class, "difficulty", Difficulty.NORMAL); /** * If players may fly. */ 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 a42abe83..37e8fa08 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java +++ b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java @@ -405,11 +405,12 @@ public class DGameWorld extends DInstanceWorld implements GameWorld { public void startGame() { GameWorldStartGameEvent event = new GameWorldStartGameEvent(this, (DGame) getGame()); Bukkit.getPluginManager().callEvent(event); - if (event.isCancelled()) { return; } + world.setDifficulty(getRules().getState(GameRule.DIFFICULTY)); + isPlaying = true; for (DungeonSign sign : getDungeonSigns()) {