mirror of
https://github.com/trainerlord/WorldSystem.git
synced 2024-12-02 13:23:21 +01:00
Fixed #17
This commit is contained in:
parent
4c96334d15
commit
92a99e53da
@ -13,6 +13,7 @@ import java.util.List;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.Difficulty;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
@ -70,6 +71,15 @@ public class SettingsConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix for #17
|
||||||
|
String diff = cfg.getString("difficulty");
|
||||||
|
try {
|
||||||
|
Difficulty difficulty = Difficulty.valueOf(diff.toUpperCase());
|
||||||
|
w.setDifficulty(difficulty);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
Bukkit.getConsoleSender().sendMessage(PluginConfig.getPrefix() + "§cUnknown difficulty \"" + diff + "\" in settings.yml");
|
||||||
|
}
|
||||||
|
|
||||||
if (w.isGameRule("announceAdvancements"))
|
if (w.isGameRule("announceAdvancements"))
|
||||||
w.setGameRuleValue("announceAdvancements", cfg.getString("announceAdvancements"));
|
w.setGameRuleValue("announceAdvancements", cfg.getString("announceAdvancements"));
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ worldborder:
|
|||||||
y: 20
|
y: 20
|
||||||
z: 0
|
z: 0
|
||||||
|
|
||||||
|
difficulty: EASY
|
||||||
|
|
||||||
|
|
||||||
# Commands that should be executed on /ws get when it is ready
|
# Commands that should be executed on /ws get when it is ready
|
||||||
# Placeholders: %player: Name of player, %world: Name of world, %uuid: UUID of player
|
# Placeholders: %player: Name of player, %world: Name of world, %uuid: UUID of player
|
||||||
|
Loading…
Reference in New Issue
Block a user