Added permission to allow free catches despite costs in configuration file.

This commit is contained in:
Alexander Krivács Schrøder 2013-09-29 10:31:29 +02:00 committed by shansen
parent e37b52523e
commit 4e8010aa00
2 changed files with 8 additions and 3 deletions

View File

@ -188,8 +188,10 @@ public class EggCatcherEntityListener implements Listener {
return;
}
}
boolean freeCatch = player.hasPermission("eggcatcher.free");
if (this.useVaultCost) {
if (this.useVaultCost && !freeCatch) {
vaultCost = config.getDouble("VaultCost." + eggType.getFriendlyName());
if (!EggCatcher.economy.has(player.getName(), vaultCost)) {
player.sendMessage(String.format(config.getString("Messages.VaultFail"), vaultCost));
@ -209,7 +211,7 @@ public class EggCatcherEntityListener implements Listener {
}
}
if (this.useItemCost) {
if (this.useItemCost && !freeCatch) {
int itemId = config.getInt("ItemCost.ItemId", 266);
int itemData = config.getInt("ItemCost.ItemData", 0);
int itemAmount = config.getInt("ItemCost.Amount." + eggType.getFriendlyName(), 0);

View File

@ -33,4 +33,7 @@ permissions:
eggcatcher.catch.ocelot: true
eggcatcher.catch.bat: true
eggcatcher.catch.witch: true
eggcatcher.catch.horse: true
eggcatcher.catch.horse: true
eggcatcher.free:
description: Makes catching a mob free.
default: false