mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
refactor: Flip boolean for custom portal search config
This commit is contained in:
parent
6cc169cb55
commit
9ae2cddfda
@ -68,14 +68,14 @@ public interface MVConfig {
|
|||||||
*
|
*
|
||||||
* @param useDefaultPortalSearch True to let Bukkit determine portal search radius on its own.
|
* @param useDefaultPortalSearch True to let Bukkit determine portal search radius on its own.
|
||||||
*/
|
*/
|
||||||
void setUseDefaultPortalSearch(boolean useDefaultPortalSearch);
|
void setUseCustomPortalSearch(boolean useDefaultPortalSearch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether or not Bukkit will be determining portal search radius on its own or if Multiverse should help.
|
* Gets whether or not Bukkit will be determining portal search radius on its own or if Multiverse should help.
|
||||||
*
|
*
|
||||||
* @return True means Bukkit will use its own default values.
|
* @return True means Bukkit will use its own default values.
|
||||||
*/
|
*/
|
||||||
boolean isUsingDefaultPortalSearch();
|
boolean isUsingCustomPortalSearch();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the radius at which vanilla style portals will be searched for to connect to worlds together.
|
* Sets the radius at which vanilla style portals will be searched for to connect to worlds together.
|
||||||
|
@ -126,13 +126,13 @@ public class DefaultMVConfig implements MVConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setUseDefaultPortalSearch(boolean useDefaultPortalSearch) {
|
public void setUseCustomPortalSearch(boolean useDefaultPortalSearch) {
|
||||||
settings.set(MVConfigNodes.USE_CUSTOM_PORTAL_SEARCH, !useDefaultPortalSearch);
|
settings.set(MVConfigNodes.USE_CUSTOM_PORTAL_SEARCH, useDefaultPortalSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUsingDefaultPortalSearch() {
|
public boolean isUsingCustomPortalSearch() {
|
||||||
return !settings.get(MVConfigNodes.USE_CUSTOM_PORTAL_SEARCH);
|
return settings.get(MVConfigNodes.USE_CUSTOM_PORTAL_SEARCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -115,7 +115,7 @@ public class MVEntityListener implements Listener {
|
|||||||
if (event.isCancelled() || event.getTo() == null) {
|
if (event.isCancelled() || event.getTo() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.plugin.getMVConfig().isUsingDefaultPortalSearch()) {
|
if (this.plugin.getMVConfig().isUsingCustomPortalSearch()) {
|
||||||
event.setSearchRadius(this.plugin.getMVConfig().getPortalSearchRadius());
|
event.setSearchRadius(this.plugin.getMVConfig().getPortalSearchRadius());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ public class MVPlayerListener implements Listener {
|
|||||||
+ "' was allowed to go to '" + event.getTo().getWorld().getName()
|
+ "' was allowed to go to '" + event.getTo().getWorld().getName()
|
||||||
+ "' because enforceaccess is off.");
|
+ "' because enforceaccess is off.");
|
||||||
}
|
}
|
||||||
if (!this.plugin.getMVConfig().isUsingDefaultPortalSearch()) {
|
if (this.plugin.getMVConfig().isUsingCustomPortalSearch()) {
|
||||||
event.setSearchRadius(this.plugin.getMVConfig().getPortalSearchRadius());
|
event.setSearchRadius(this.plugin.getMVConfig().getPortalSearchRadius());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user