修复换弹时物品未正确消耗的问题
This commit is contained in:
parent
4822382dc7
commit
9c2c02f07c
2 changed files with 3 additions and 3 deletions
|
@ -354,7 +354,7 @@ public class GunEventHandler {
|
|||
case ITEM -> {
|
||||
data.ammo.set(1);
|
||||
player.getInventory().clearOrCountMatchingItems(
|
||||
p -> p.getItem().getDescriptionId().equals(ammoTypeInfo.value()),
|
||||
p -> p.getItem().toString().equals(ammoTypeInfo.value()),
|
||||
1,
|
||||
player.inventoryMenu.getCraftSlots()
|
||||
);
|
||||
|
@ -606,7 +606,7 @@ public class GunEventHandler {
|
|||
type.add(cap, -1);
|
||||
}
|
||||
case ITEM -> player.getInventory().clearOrCountMatchingItems(
|
||||
p -> p.getItem().getDescriptionId().equals(ammoTypeInfo.value()),
|
||||
p -> p.getItem().toString().equals(ammoTypeInfo.value()),
|
||||
1,
|
||||
player.inventoryMenu.getCraftSlots()
|
||||
);
|
||||
|
|
|
@ -126,7 +126,7 @@ public class PlayerEventHandler {
|
|||
if (data.ammo.get() == 0 && data.maxAmmo.get() == 0) {
|
||||
data.ammo.set(1);
|
||||
player.getInventory().clearOrCountMatchingItems(
|
||||
p -> p.getItem().getDescriptionId().equals(ammoTypeInfo.value()),
|
||||
p -> p.getItem().toString().equals(ammoTypeInfo.value()),
|
||||
1,
|
||||
player.inventoryMenu.getCraftSlots()
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue