mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Fix #4234
This commit is contained in:
parent
a28d1cd537
commit
ed9521d4a0
@ -128,6 +128,9 @@ public class RepairManager extends SkillManager {
|
|||||||
int baseRepairAmount = repairable.getBaseRepairDurability(item); // Did they send me daughters?
|
int baseRepairAmount = repairable.getBaseRepairDurability(item); // Did they send me daughters?
|
||||||
short newDurability = repairCalculate(startDurability, baseRepairAmount); // When I asked for sons?
|
short newDurability = repairCalculate(startDurability, baseRepairAmount); // When I asked for sons?
|
||||||
|
|
||||||
|
// toRemove should be refreshed before the event call.
|
||||||
|
toRemove = inventory.getItem(inventory.first(repairMaterial)).clone();
|
||||||
|
|
||||||
// Call event
|
// Call event
|
||||||
if (EventUtils.callRepairCheckEvent(player, (short) (startDurability - newDurability), toRemove, item).isCancelled()) {
|
if (EventUtils.callRepairCheckEvent(player, (short) (startDurability - newDurability), toRemove, item).isCancelled()) {
|
||||||
return;
|
return;
|
||||||
@ -139,7 +142,6 @@ public class RepairManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove the item
|
// Remove the item
|
||||||
toRemove = inventory.getItem(inventory.first(repairMaterial)).clone();
|
|
||||||
toRemove.setAmount(1);
|
toRemove.setAmount(1);
|
||||||
|
|
||||||
inventory.removeItem(toRemove);
|
inventory.removeItem(toRemove);
|
||||||
|
Loading…
Reference in New Issue
Block a user