mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-01-19 14:15:04 +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)
|
||||
(Codebase) Fixed unit tests for Java 25 (thanks Warriorrrr)
|
||||
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:
|
||||
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();
|
||||
final McMMOModifyBlockDropItemEvent modifyBlockDropItemEvent
|
||||
final McMMOModifyBlockDropItemEvent modifyDropEvent
|
||||
= new McMMOModifyBlockDropItemEvent(event, item, amountToAddFromBonus);
|
||||
plugin.getServer().getPluginManager().callEvent(modifyBlockDropItemEvent);
|
||||
if (!modifyBlockDropItemEvent.isCancelled()
|
||||
&& modifyBlockDropItemEvent.getModifiedItemStackQuantity() > originalAmount) {
|
||||
eventItemStack.setAmount(modifyBlockDropItemEvent.getModifiedItemStackQuantity());
|
||||
plugin.getServer().getPluginManager().callEvent(modifyDropEvent);
|
||||
if (!modifyDropEvent.isCancelled()
|
||||
&& modifyDropEvent.getModifiedItemStackQuantity() > originalAmount) {
|
||||
eventItemStack.setAmount(
|
||||
Math.min(modifyDropEvent.getModifiedItemStackQuantity(),
|
||||
item.getItemStack().getMaxStackSize()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user