mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-22 18:26:08 +01:00
Revert "Don't handle PortalTeleportEvent when target world is disabled in config"
This reverts commit b2b3b3d976
.
That event handler didn't affect players
This commit is contained in:
parent
b2b3b3d976
commit
1a2124fb2f
@ -20,6 +20,23 @@ public enum IslandWorld {
|
||||
return this.friendlyName;
|
||||
}
|
||||
|
||||
public static List<IslandWorld> getIslandWorlds() {
|
||||
List<IslandWorld> islandWorlds = new ArrayList<>(3);
|
||||
|
||||
WorldManager worldManager = SkyBlock.getPlugin(SkyBlock.class).getWorldManager();
|
||||
if (worldManager.getWorld(NORMAL) != null) {
|
||||
islandWorlds.add(NORMAL);
|
||||
}
|
||||
if (worldManager.getWorld(NETHER) != null) {
|
||||
islandWorlds.add(NETHER);
|
||||
}
|
||||
if (worldManager.getWorld(END) != null) {
|
||||
islandWorlds.add(END);
|
||||
}
|
||||
|
||||
return islandWorlds;
|
||||
}
|
||||
|
||||
public Environment getUncheckedEnvironment() {
|
||||
switch (this) {
|
||||
case NORMAL:
|
||||
@ -47,34 +64,4 @@ public enum IslandWorld {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<IslandWorld> getIslandWorlds() {
|
||||
List<IslandWorld> islandWorlds = new ArrayList<>(3);
|
||||
|
||||
WorldManager worldManager = SkyBlock.getPlugin(SkyBlock.class).getWorldManager();
|
||||
if (worldManager.getWorld(NORMAL) != null) {
|
||||
islandWorlds.add(NORMAL);
|
||||
}
|
||||
if (worldManager.getWorld(NETHER) != null) {
|
||||
islandWorlds.add(NETHER);
|
||||
}
|
||||
if (worldManager.getWorld(END) != null) {
|
||||
islandWorlds.add(END);
|
||||
}
|
||||
|
||||
return islandWorlds;
|
||||
}
|
||||
|
||||
public static IslandWorld getByEnvironment(Environment environment) {
|
||||
switch (environment) {
|
||||
case NORMAL:
|
||||
return IslandWorld.NORMAL;
|
||||
case NETHER:
|
||||
return IslandWorld.NETHER;
|
||||
case THE_END:
|
||||
return IslandWorld.END;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -194,14 +194,6 @@ public class TeleportListeners implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
IslandWorld toIslandWorld = IslandWorld.getByEnvironment(to.getWorld().getEnvironment());
|
||||
|
||||
FileConfiguration configLoad = this.plugin.getConfiguration();
|
||||
if (toIslandWorld == null || !configLoad.getBoolean("Island.World." + toIslandWorld.getFriendlyName() + ".Enable")) {
|
||||
// Skip any of our behavior if the target world is disabled (vanilla or third-party plugin might want to handle it)
|
||||
return;
|
||||
}
|
||||
|
||||
if (worldManager.getIslandWorld(e.getFrom().getWorld()) != null) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user