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

end up in a player's inventory, losing items forever.
testdev
sigonasr2 8 years ago
parent 77021cf042
commit b713263a66
  1. BIN
      TwosideKeeper.jar
  2. 1
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java
  3. 7
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -80,6 +80,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.EliteMonsterLocationFinder;
import sig.plugin.TwosideKeeper.HelperStructures.ItemSet;
import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode;
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.SoundUtils;

@ -5894,8 +5894,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
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();
GenericFunctions.giveItem(p, ev.getItem().getItemStack());
return;
}

Loading…
Cancel
Save