Skip to content
Permalink
Browse files

Correctly handle multiple definitions for the same command item that …

…can be kept on death.
  • Loading branch information...
me4502 committed Jul 22, 2019
1 parent 3ac3c2d commit 07241afa22835d0461bd2bed975cf6eb0be658d3
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/main/java/com/sk89q/craftbook/mechanics/items/CommandItems.java
@@ -317,11 +317,12 @@ public void onPlayerDeath(PlayerDeathEvent event) {
performCommandItems(stack, event.getEntity(), event);
for(CommandItemDefinition def : definitions) {
if(ItemUtil.areItemsIdentical(stack, def.getItem()) && def.keepOnDeath) {
stackIt.remove();
List<ItemStack> items = deathPersistItems.get(event.getEntity().getUniqueId());
if (items == null) items = Lists.newArrayList();
items.add(stack);
deathPersistItems.put(event.getEntity().getUniqueId(), items);
stackIt.remove();
break;
}
}
}

0 comments on commit 07241af

Please sign in to comment.
You can’t perform that action at this time.