mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 23:26:45 +01:00
Fix issue with trying to remove all of the item in hand.
This commit is contained in:
parent
ab138bdba2
commit
8ed2696315
@ -1,6 +1,7 @@
|
|||||||
package com.gmail.nossr50.skills.taming;
|
package com.gmail.nossr50.skills.taming;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
@ -68,8 +69,15 @@ public class CallOfTheWildEventHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void processResourceCost() {
|
protected void processResourceCost() {
|
||||||
|
int newAmount = inHand.getAmount() - summonAmount;
|
||||||
|
|
||||||
|
if (newAmount == 0) {
|
||||||
|
player.setItemInHand(new ItemStack(Material.AIR));
|
||||||
|
}
|
||||||
|
else {
|
||||||
player.getItemInHand().setAmount(inHand.getAmount() - summonAmount);
|
player.getItemInHand().setAmount(inHand.getAmount() - summonAmount);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void sendSuccessMessage() {
|
protected void sendSuccessMessage() {
|
||||||
player.sendMessage(LocaleLoader.getString("Taming.Summon.Complete"));
|
player.sendMessage(LocaleLoader.getString("Taming.Summon.Complete"));
|
||||||
|
Loading…
Reference in New Issue
Block a user