mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fixed bug where Berserk deletes items
when the players inventory is full. Fixes #1947
This commit is contained in:
parent
037022b175
commit
1c30146491
@ -29,6 +29,7 @@ Version 1.5.01-dev
|
|||||||
= Fixed bug which would cause a NullPointerException with getFlowerAndGrassXp()
|
= Fixed bug which would cause a NullPointerException with getFlowerAndGrassXp()
|
||||||
= Fixed bug which could cause and SQLException regarding the connection property 'maxReconnects'.
|
= Fixed bug which could cause and SQLException regarding the connection property 'maxReconnects'.
|
||||||
= Fixed bug where falling blocks were incorrectly tracked
|
= Fixed bug where falling blocks were incorrectly tracked
|
||||||
|
= Fixed bug where items would get deleted when in Berserk with a full inventory
|
||||||
! Changed SecondaryAbilityEvent to implement Cancellable and it now gets fired for damage related secondary abilities
|
! Changed SecondaryAbilityEvent to implement Cancellable and it now gets fired for damage related secondary abilities
|
||||||
! Changed the way mcMMO handles bonus damage, updated for the new damage event API
|
! Changed the way mcMMO handles bonus damage, updated for the new damage event API
|
||||||
! Changed player data saving. Save tasks are now asynchronous
|
! Changed player data saving. Save tasks are now asynchronous
|
||||||
|
@ -332,9 +332,10 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mcMMOPlayer.isUsingUnarmed() && ItemUtils.isSharable(dropStack)) || mcMMOPlayer.getAbilityMode(AbilityType.BERSERK)) {
|
if ((mcMMOPlayer.isUsingUnarmed() && ItemUtils.isSharable(dropStack)) || mcMMOPlayer.getAbilityMode(AbilityType.BERSERK)) {
|
||||||
event.setCancelled(Unarmed.handleItemPickup(player.getInventory(), drop));
|
boolean pickupSuccess = Unarmed.handleItemPickup(player.getInventory(), drop);
|
||||||
|
event.setCancelled(pickupSuccess);
|
||||||
|
|
||||||
if (event.isCancelled()) {
|
if (pickupSuccess) {
|
||||||
player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
|
player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
return;
|
return;
|
||||||
|
@ -69,6 +69,9 @@ public class Unarmed {
|
|||||||
|
|
||||||
nextSlot++;
|
nextSlot++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Inventory is full - cancel the item pickup
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else if (firstEmpty != -1) {
|
else if (firstEmpty != -1) {
|
||||||
drop.remove();
|
drop.remove();
|
||||||
|
Loading…
Reference in New Issue
Block a user