mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-06 00:08:04 +01:00
Possibly fixed the pvp/difficulty property issue!
This commit is contained in:
parent
63af4370b5
commit
34c8b7cf0b
@ -9,6 +9,7 @@ package com.onarandombox.MultiverseCore.listeners;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
@ -50,11 +51,17 @@ public class MVWorldListener implements Listener {
|
||||
*/
|
||||
@EventHandler
|
||||
public void loadWorld(WorldLoadEvent event) {
|
||||
if (event.getWorld() instanceof World) {
|
||||
World world = (World) event.getWorld();
|
||||
if (world != null && this.plugin.getMVWorldManager().getUnloadedWorlds().contains(world.getName())) {
|
||||
World world = event.getWorld();
|
||||
if (world != null) {
|
||||
if (this.plugin.getMVWorldManager().getUnloadedWorlds().contains(world.getName())) {
|
||||
this.plugin.getMVWorldManager().loadWorld(world.getName());
|
||||
}
|
||||
MultiverseWorld mvWorld = plugin.getMVWorldManager().getMVWorld(world);
|
||||
if (mvWorld != null) {
|
||||
// This is where we can temporarily fix those pesky property issues!
|
||||
world.setPVP(mvWorld.isPVPEnabled());
|
||||
world.setDifficulty(mvWorld.getDifficulty());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user