mirror of
https://github.com/shansen/EggCatcher.git
synced 2025-01-08 00:38:23 +01:00
Added permission to allow free catches despite costs in configuration file.
This commit is contained in:
parent
e37b52523e
commit
4e8010aa00
@ -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);
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user