mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-27 00:45:40 +01:00
Fixed infinite smithing xp bug
This commit is contained in:
parent
1d6da836e5
commit
3978f765c9
@ -6,6 +6,7 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
import org.bukkit.inventory.AnvilInventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.Damageable;
|
import org.bukkit.inventory.meta.Damageable;
|
||||||
|
|
||||||
@ -47,6 +48,13 @@ public class RepairItemExperienceSource extends ExperienceSource<ItemStack> {
|
|||||||
|
|
||||||
for (RepairItemExperienceSource source : getSources())
|
for (RepairItemExperienceSource source : getSources())
|
||||||
if (source.matches(data, item)) {
|
if (source.matches(data, item)) {
|
||||||
|
|
||||||
|
if(!(event.getInventory() instanceof AnvilInventory))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(((AnvilInventory) event.getInventory()).getRepairCost() >
|
||||||
|
((Player) event.getWhoClicked()).getLevel()) return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* make sure the items can actually be repaired
|
* make sure the items can actually be repaired
|
||||||
* before getting the amount of durability repaired
|
* before getting the amount of durability repaired
|
||||||
|
Loading…
Reference in New Issue
Block a user