From aa8b92424471435691da0a6137e9a2e08650fc7d Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 25 Jun 2019 20:35:18 -0400 Subject: [PATCH] Fix for messy inventory add system. --- .gitlab-ci.yml | 2 +- .../songoda/ultimaterepairing/handlers/RepairHandler.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 32bf937..3187dee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: variables: name: "UltimateRepairing" path: "/builds/$CI_PROJECT_PATH" - version: "1.2.3" + version: "1.2.4" build: stage: build diff --git a/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java b/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java index 0699450..31089a0 100644 --- a/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java +++ b/src/main/java/com/songoda/ultimaterepairing/handlers/RepairHandler.java @@ -330,12 +330,9 @@ public class RepairHandler { player.getWorld().playEffect(location, effect, blockTypeFinal); player.getWorld().playEffect(location, effect, Material.ANVIL); player.sendMessage(Methods.formatText(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.success"))); - ItemStack repairedi = playerData.getToBeRepaired(); - repairedi.setDurability((short) 0); - Item repaired = player.getWorld().dropItemNaturally(player.getLocation(), repairedi); - repaired.remove(); - HashMap items = player.getInventory().addItem(playerData.getToBeRepaired()); + playerData.getToBeRepaired().setDurability((short) 0); + HashMap items = player.getInventory().addItem(playerData.getToBeRepaired()); for (ItemStack item : items.values()) { player.getWorld().dropItemNaturally(player.getLocation(), item); }