Don't bother checking economy stuff if it doesn't even cost to enter.

This commit is contained in:
Jeremy Wood 2012-07-03 16:25:56 -04:00
parent 1427671a8c
commit 3e7841afc9

View File

@ -7,7 +7,6 @@
package com.onarandombox.MultiverseCore.utils; package com.onarandombox.MultiverseCore.utils;
import java.util.logging.Level;
import com.fernferret.allpay.GenericBank; import com.fernferret.allpay.GenericBank;
import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.MultiverseCore;
import com.onarandombox.MultiverseCore.api.MultiverseWorld; import com.onarandombox.MultiverseCore.api.MultiverseWorld;
@ -16,6 +15,8 @@ import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission; import org.bukkit.permissions.Permission;
import java.util.logging.Level;
/** /**
* Utility-class for permissions. * Utility-class for permissions.
*/ */
@ -134,6 +135,10 @@ public class PermissionTools {
// Only check payments if it's a different world: // Only check payments if it's a different world:
if (!toWorld.equals(fromWorld)) { if (!toWorld.equals(fromWorld)) {
// Don't bother checking economy stuff if it doesn't even cost to enter.
if (toWorld.getPrice() == 0D) {
return true;
}
// If the player does not have to pay, return now. // If the player does not have to pay, return now.
if (this.plugin.getMVPerms().hasPermission(teleporter, toWorld.getExemptPermission().getName(), true)) { if (this.plugin.getMVPerms().hasPermission(teleporter, toWorld.getExemptPermission().getName(), true)) {
return true; return true;