Fixed a major item dropping bug. Items collected were not guaranteed to

end up in a player's inventory, losing items forever.
This commit is contained in:
sigonasr2 2016-12-13 23:56:45 -06:00
parent 77021cf042
commit b713263a66
3 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@ -80,6 +80,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.EliteMonsterLocationFinder;
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet; import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
import sig.plugin.TwosideKeeper.HelperStructures.WorldShop; import sig.plugin.TwosideKeeper.HelperStructures.WorldShop;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ArrayUtils;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.ItemUtils;
import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.SoundUtils;

View File

@ -5894,8 +5894,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
ev.setCancelled(true); ev.setCancelled(true);
ItemStack givenitem = ev.getItem().getItemStack().clone();
GenericFunctions.giveItem(p, givenitem);
if (ev.getRemaining()>0) {
givenitem.setAmount(ev.getRemaining());
GenericFunctions.giveItem(p, givenitem);
}
ev.getItem().remove(); ev.getItem().remove();
GenericFunctions.giveItem(p, ev.getItem().getItemStack());
return; return;
} }