mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-01-21 23:25:05 +01:00
prevent item stack size from going outside normal bounds
Some checks failed
EpicKnarvik97/mcMMO/pipeline/head There was a failure building this commit
Some checks failed
EpicKnarvik97/mcMMO/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -3,6 +3,7 @@ Version 2.2.049
|
|||||||
Sweet berry bushes now work with Herbalism (thanks dnocturne)
|
Sweet berry bushes now work with Herbalism (thanks dnocturne)
|
||||||
(Codebase) Fixed unit tests for Java 25 (thanks Warriorrrr)
|
(Codebase) Fixed unit tests for Java 25 (thanks Warriorrrr)
|
||||||
Fixed copper items not giving XP for Repair (thanks Remski01)
|
Fixed copper items not giving XP for Repair (thanks Remski01)
|
||||||
|
Fixed edge case where mcMMO could drop items with stack size set outside normal bounds
|
||||||
|
|
||||||
NOTES:
|
NOTES:
|
||||||
As a semi-permanent work around, mcMMO keeps track of when players swing their weapon, if they have swung it recently enough combat skills will work even if you have a spear in your off-hand.
|
As a semi-permanent work around, mcMMO keeps track of when players swing their weapon, if they have swung it recently enough combat skills will work even if you have a spear in your off-hand.
|
||||||
|
|||||||
@@ -147,12 +147,14 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int amountToAddFromBonus = bonusDropMeta.asInt();
|
int amountToAddFromBonus = bonusDropMeta.asInt();
|
||||||
final McMMOModifyBlockDropItemEvent modifyBlockDropItemEvent
|
final McMMOModifyBlockDropItemEvent modifyDropEvent
|
||||||
= new McMMOModifyBlockDropItemEvent(event, item, amountToAddFromBonus);
|
= new McMMOModifyBlockDropItemEvent(event, item, amountToAddFromBonus);
|
||||||
plugin.getServer().getPluginManager().callEvent(modifyBlockDropItemEvent);
|
plugin.getServer().getPluginManager().callEvent(modifyDropEvent);
|
||||||
if (!modifyBlockDropItemEvent.isCancelled()
|
if (!modifyDropEvent.isCancelled()
|
||||||
&& modifyBlockDropItemEvent.getModifiedItemStackQuantity() > originalAmount) {
|
&& modifyDropEvent.getModifiedItemStackQuantity() > originalAmount) {
|
||||||
eventItemStack.setAmount(modifyBlockDropItemEvent.getModifiedItemStackQuantity());
|
eventItemStack.setAmount(
|
||||||
|
Math.min(modifyDropEvent.getModifiedItemStackQuantity(),
|
||||||
|
item.getItemStack().getMaxStackSize()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user