From 3e7841afc927fa40fa4c000557f2581097daf3f3 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Tue, 3 Jul 2012 16:25:56 -0400 Subject: [PATCH] Don't bother checking economy stuff if it doesn't even cost to enter. --- .../onarandombox/MultiverseCore/utils/PermissionTools.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java b/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java index 1e404265..780f0a89 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java @@ -7,7 +7,6 @@ package com.onarandombox.MultiverseCore.utils; -import java.util.logging.Level; import com.fernferret.allpay.GenericBank; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.api.MultiverseWorld; @@ -16,6 +15,8 @@ import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; import org.bukkit.permissions.Permission; +import java.util.logging.Level; + /** * Utility-class for permissions. */ @@ -134,6 +135,10 @@ public class PermissionTools { // Only check payments if it's a different world: 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 (this.plugin.getMVPerms().hasPermission(teleporter, toWorld.getExemptPermission().getName(), true)) { return true;