mirror of
https://github.com/shansen/EggCatcher.git
synced 2025-02-16 10:41:19 +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) {
|
||||
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 itemAmount = config.getInt("ItemCost.Amount." + eggType.getFriendlyName(), 0);
|
||||
@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())) {
|
||||
player.sendMessage(String.format(config.getString("Messages.ItemCostSuccess"),
|
||||
String.valueOf(itemAmount)));
|
||||
|
@ -136,7 +136,7 @@ VaultCost:
|
||||
ZombieHorse: 0.0
|
||||
ZombieVillager: 0.0
|
||||
ItemCost:
|
||||
ItemId: 371
|
||||
ItemId: gold_nugget
|
||||
ItemData: 0
|
||||
Amount:
|
||||
Bat: 0.0
|
||||
|
Loading…
Reference in New Issue
Block a user