mirror of
https://github.com/plexusorg/Plex.git
synced 2025-07-03 08:26:42 +00:00
Add global gamerules
This commit is contained in:
@ -3,6 +3,7 @@ package dev.plex.services.impl;
|
||||
import dev.plex.services.AbstractService;
|
||||
import dev.plex.util.PlexLog;
|
||||
import dev.plex.util.PlexUtils;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
|
||||
@ -18,8 +19,17 @@ public class GameRuleService extends AbstractService
|
||||
{
|
||||
for (World world : Bukkit.getWorlds())
|
||||
{
|
||||
PlexUtils.commitGameRules(world);
|
||||
PlexLog.debug("Set gamerules for world: " + world.getName());
|
||||
PlexUtils.commitGlobalGameRules(world);
|
||||
PlexLog.log("Set global gamerules for world: " + world.getName());
|
||||
}
|
||||
for (String world : plugin.config.getConfigurationSection("worlds").getKeys(false))
|
||||
{
|
||||
World bukkitWorld = Bukkit.getWorld(world);
|
||||
if (bukkitWorld != null)
|
||||
{
|
||||
PlexUtils.commitSpecificGameRules(bukkitWorld);
|
||||
PlexLog.log("Set specific gamerules for world: " + world.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user