diff --git a/plugin.yml b/plugin.yml index b6d0e06..8b1a7e2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,5 +1,5 @@ name: SimplePortals -version: 1.6.5 +version: 1.6.6 api-version: 1.13 main: xzot1k.plugins.sp.SimplePortals author: XZot1K diff --git a/src/xzot1k/plugins/sp/SimplePortals.java b/src/xzot1k/plugins/sp/SimplePortals.java index 4bd02e3..7cb6d88 100644 --- a/src/xzot1k/plugins/sp/SimplePortals.java +++ b/src/xzot1k/plugins/sp/SimplePortals.java @@ -98,9 +98,7 @@ private void updateConfigs() { if (name.equalsIgnoreCase("config")) { String createSound = getConfig().getString("teleport-sound"); - if (!getServerVersion().startsWith("v1_9") && !getServerVersion().startsWith("v1_10") && !getServerVersion().startsWith("v1_11") - && !getServerVersion().startsWith("v1_12") && !getServerVersion().startsWith("v1_13") && !getServerVersion().startsWith("v1_14") - && !getServerVersion().startsWith("v1_15") && !getServerVersion().startsWith("v1_16")) { + if (getServerVersion().startsWith("v1_8") || getServerVersion().startsWith("v1_7")) { if (createSound != null && createSound.equalsIgnoreCase("ENTITY_GHAST_SHOOT")) { getConfig().set("teleport-sound", "GHAST_CHARGE"); updateCount++; diff --git a/src/xzot1k/plugins/sp/api/Manager.java b/src/xzot1k/plugins/sp/api/Manager.java index c2c9189..c9bf61e 100644 --- a/src/xzot1k/plugins/sp/api/Manager.java +++ b/src/xzot1k/plugins/sp/api/Manager.java @@ -148,8 +148,7 @@ public void loadPortals() { Portal portal = getPortalFromFile(file.getName().toLowerCase().replace(".yml", "")); getPortalMap().put(portal.getPortalId(), portal); } catch (PortalFormException e) { - getPluginInstance().log(Level.WARNING, "The file \"" + file.getName() - + "\" has a portal within that was unable to be parsed. Please check this portal."); + getPluginInstance().log(Level.WARNING, e.getMessage()); } } } @@ -408,6 +407,10 @@ public Portal getPortalFromFile(String portalId) throws PortalFormException { throw new PortalFormException("The portal's point one and point two have mismatching world names ('" + pointTwo.getWorldName() + "' does NOT equal '" + pointTwo.getWorldName() + "')."); + World world = getPluginInstance().getServer().getWorld(pointOne.getWorldName()); + if (world == null) + throw new PortalFormException("The portal \"" + portalId + "\" has a world assigned to it that no longer exists."); + final Region region = new Region(getPluginInstance(), pointOne, pointTwo); final Portal portal = new Portal(getPluginInstance(), file.getName().toLowerCase().replace(".yml", ""), region); portal.setTeleportLocation(teleportLocation); @@ -510,7 +513,6 @@ public void teleportWithEntity(Entity entity, Location location) { }, 5); } else { Vector newDirection = entity.getVelocity().clone(); - entity.teleport(location); if (entityVelocity) entity.setVelocity(newDirection); else entity.setVelocity(new Vector(0, 0, 0));