mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-08 09:17:38 +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.MultiverseCore;
|
||||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
||||||
|
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -50,11 +51,17 @@ public class MVWorldListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void loadWorld(WorldLoadEvent event) {
|
public void loadWorld(WorldLoadEvent event) {
|
||||||
if (event.getWorld() instanceof World) {
|
World world = event.getWorld();
|
||||||
World world = (World) event.getWorld();
|
if (world != null) {
|
||||||
if (world != null && this.plugin.getMVWorldManager().getUnloadedWorlds().contains(world.getName())) {
|
if (this.plugin.getMVWorldManager().getUnloadedWorlds().contains(world.getName())) {
|
||||||
this.plugin.getMVWorldManager().loadWorld(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