mirror of
https://github.com/shansen/EggCatcher.git
synced 2025-02-19 20:12:20 +01:00
Fix itemstack call
This commit is contained in:
parent
f7e71f302e
commit
3493e0b84f
@ -225,11 +225,11 @@ public class EggCatcherEntityListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.useItemCost && !freeCatch) {
|
if (this.useItemCost && !freeCatch) {
|
||||||
int itemId = config.getInt("ItemCost.ItemId", 266);
|
Material itemMaterial = Material.matchMaterial(config.getString("ItemCost.ItemId", "gold_nugget"));
|
||||||
int itemData = config.getInt("ItemCost.ItemData", 0);
|
int itemData = config.getInt("ItemCost.ItemData", 0);
|
||||||
int itemAmount = config.getInt("ItemCost.Amount." + eggType.getFriendlyName(), 0);
|
int itemAmount = config.getInt("ItemCost.Amount." + eggType.getFriendlyName(), 0);
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
ItemStack itemStack = new ItemStack(itemId, itemAmount, (short) itemData);
|
ItemStack itemStack = new ItemStack(itemMaterial, itemAmount, (short) itemData);
|
||||||
if (player.getInventory().containsAtLeast(itemStack, itemStack.getAmount())) {
|
if (player.getInventory().containsAtLeast(itemStack, itemStack.getAmount())) {
|
||||||
player.sendMessage(String.format(config.getString("Messages.ItemCostSuccess"),
|
player.sendMessage(String.format(config.getString("Messages.ItemCostSuccess"),
|
||||||
String.valueOf(itemAmount)));
|
String.valueOf(itemAmount)));
|
||||||
|
@ -136,7 +136,7 @@ VaultCost:
|
|||||||
ZombieHorse: 0.0
|
ZombieHorse: 0.0
|
||||||
ZombieVillager: 0.0
|
ZombieVillager: 0.0
|
||||||
ItemCost:
|
ItemCost:
|
||||||
ItemId: 371
|
ItemId: gold_nugget
|
||||||
ItemData: 0
|
ItemData: 0
|
||||||
Amount:
|
Amount:
|
||||||
Bat: 0.0
|
Bat: 0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user