Fix for messy inventory add system.

This commit is contained in:
Brianna 2019-06-25 20:35:18 -04:00
parent cd58e83711
commit aa8b924244
2 changed files with 3 additions and 6 deletions

View File

@ -4,7 +4,7 @@ stages:
variables: variables:
name: "UltimateRepairing" name: "UltimateRepairing"
path: "/builds/$CI_PROJECT_PATH" path: "/builds/$CI_PROJECT_PATH"
version: "1.2.3" version: "1.2.4"
build: build:
stage: build stage: build

View File

@ -330,12 +330,9 @@ public class RepairHandler {
player.getWorld().playEffect(location, effect, blockTypeFinal); player.getWorld().playEffect(location, effect, blockTypeFinal);
player.getWorld().playEffect(location, effect, Material.ANVIL); player.getWorld().playEffect(location, effect, Material.ANVIL);
player.sendMessage(Methods.formatText(instance.references.getPrefix() + instance.getLocale().getMessage("event.repair.success"))); 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<Integer, ItemStack> items = player.getInventory().addItem(playerData.getToBeRepaired());
playerData.getToBeRepaired().setDurability((short) 0);
HashMap<Integer, ItemStack> items = player.getInventory().addItem(playerData.getToBeRepaired());
for (ItemStack item : items.values()) { for (ItemStack item : items.values()) {
player.getWorld().dropItemNaturally(player.getLocation(), item); player.getWorld().dropItemNaturally(player.getLocation(), item);
} }