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:
parent
77021cf042
commit
b713263a66
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.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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user