fix: apply gamerules in every world

This commit is contained in:
Simon Giesel 2020-05-07 16:43:20 +02:00
parent bc6074436c
commit cea3366164

View file

@ -8,7 +8,6 @@ import org.bukkit.Difficulty;
import org.bukkit.GameRule; import org.bukkit.GameRule;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
@ -67,13 +66,11 @@ public class Varo extends JavaPlugin {
getCommand("varo").setExecutor(new VaroCommand(this)); getCommand("varo").setExecutor(new VaroCommand(this));
for (World world : getServer().getWorlds()) { for (World world : getServer().getWorlds()) {
if (world.getEnvironment() == Environment.NORMAL) {
// world.setDifficulty(Difficulty.HARD); // world.setDifficulty(Difficulty.HARD);
world.setDifficulty(Difficulty.PEACEFUL); // TODO: REMOVE AFTER DEBUG!! world.setDifficulty(Difficulty.PEACEFUL); // TODO: REMOVE AFTER DEBUG!!
world.setGameRule(GameRule.ANNOUNCE_ADVANCEMENTS, false); world.setGameRule(GameRule.ANNOUNCE_ADVANCEMENTS, false);
world.setGameRule(GameRule.REDUCED_DEBUG_INFO, true); world.setGameRule(GameRule.REDUCED_DEBUG_INFO, true);
} }
}
getServer().removeRecipe(NamespacedKey.minecraft("fishing_rod")); getServer().removeRecipe(NamespacedKey.minecraft("fishing_rod"));
} }