diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java index bc39f40ed..387fb8da6 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -480,6 +480,11 @@ private void migrate22Values() { this.getMVConfig().setTeleportIntercept(this.multiverseConfig.getBoolean("teleportintercept")); this.multiverseConfig.set("teleportintercept", null); } + if (this.multiverseConfig.isSet("portalintercept")) { + Logging.config("Migrating 'portalintercept'..."); + this.getMVConfig().setPortalIntercept(this.multiverseConfig.getBoolean("portalintercept")); + this.multiverseConfig.set("portalintercept", null); + } if (this.multiverseConfig.isSet("firstspawnoverride")) { Logging.config("Migrating 'firstspawnoverride'..."); this.getMVConfig().setFirstSpawnOverride(this.multiverseConfig.getBoolean("firstspawnoverride")); diff --git a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java index a5fa94791..478520e24 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MultiverseCoreConfiguration.java @@ -52,6 +52,8 @@ public static MultiverseCoreConfiguration getInstance() { @Property private volatile boolean teleportintercept; @Property + private volatile boolean portalintercept; + @Property private volatile boolean firstspawnoverride; @Property private volatile boolean displaypermerrors; @@ -99,6 +101,7 @@ protected void setDefaults() { prefixchat = false; prefixchatformat = "[%world%]%chat%"; teleportintercept = true; + portalintercept = true; firstspawnoverride = true; displaypermerrors = true; enablebuscript = true; @@ -192,6 +195,22 @@ public void setTeleportIntercept(boolean teleportIntercept) { this.teleportintercept = teleportIntercept; } + /** + * {@inheritDoc} + */ + @Override + public boolean getPortalIntercept() { + return this.portalintercept; + } + + /** + * {@inheritDoc} + */ + @Override + public void setPortalIntercept(boolean portalIntercept) { + this.portalintercept = portalIntercept; + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java b/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java index 07b2bb91d..f12d432bc 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java +++ b/src/main/java/com/onarandombox/MultiverseCore/api/MultiverseCoreConfig.java @@ -122,6 +122,18 @@ public interface MultiverseCoreConfig extends ConfigurationSerializable { */ boolean getTeleportIntercept(); + /** + * Sets portalIntercept. + * @param portalIntercept The new value. + */ + void setPortalIntercept(boolean portalIntercept); + + /** + * Gets portalIntercept. + * @return portalIntercept. + */ + boolean getPortalIntercept(); + /** * Sets prefixChat. * @param prefixChat The new value. diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 2921f9c56..f3c362b92 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -128,6 +128,7 @@ public void playerJoin(PlayerJoinEvent event) { } else { Logging.finer("Player joined AGAIN!"); if (this.plugin.getMVConfig().getEnforceAccess() // check this only if we're enforcing access! + && (this.plugin.getMVConfig().getTeleportIntercept() && this.plugin.getMVConfig().getPortalIntercept()) // only all method Intercept will force send && !this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + p.getWorld().getName(), false)) { p.sendMessage("[MV] - Sorry you can't be in this world anymore!"); this.sendPlayerToDefaultWorld(p); @@ -300,7 +301,7 @@ public void playerPortal(PlayerPortalEvent event) { + "' because they don't have the FUNDS required to enter."); return; } - if (plugin.getMVConfig().getEnforceAccess()) { + if (plugin.getMVConfig().getEnforceAccess() && plugin.getMVConfig().getPortalIntercept()) { event.setCancelled(!pt.playerCanGoFromTo(fromWorld, toWorld, event.getPlayer(), event.getPlayer())); if (event.isCancelled()) { Logging.fine("Player '" + event.getPlayer().getName()