mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-21 18:15:26 +01:00
add PortalIntercept option
This commit is contained in:
parent
fc6796e20f
commit
126d9ed7f6
@ -480,6 +480,11 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
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"));
|
||||
|
@ -52,6 +52,8 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
@Property
|
||||
private volatile boolean teleportintercept;
|
||||
@Property
|
||||
private volatile boolean portalintercept;
|
||||
@Property
|
||||
private volatile boolean firstspawnoverride;
|
||||
@Property
|
||||
private volatile boolean displaypermerrors;
|
||||
@ -99,6 +101,7 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
prefixchat = false;
|
||||
prefixchatformat = "[%world%]%chat%";
|
||||
teleportintercept = true;
|
||||
portalintercept = true;
|
||||
firstspawnoverride = true;
|
||||
displaypermerrors = true;
|
||||
enablebuscript = true;
|
||||
@ -192,6 +195,22 @@ public class MultiverseCoreConfiguration extends SerializationConfig implements
|
||||
this.teleportintercept = teleportIntercept;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public boolean getPortalIntercept() {
|
||||
return this.portalintercept;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void setPortalIntercept(boolean portalIntercept) {
|
||||
this.portalintercept = portalIntercept;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -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.
|
||||
|
@ -300,7 +300,7 @@ public class MVPlayerListener implements Listener {
|
||||
+ "' 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()
|
||||
|
Loading…
Reference in New Issue
Block a user