尝试修复一个null导致的问题

This commit is contained in:
17146 2025-04-07 22:04:25 +08:00 committed by Light_Quanta
parent 7e239a2e9f
commit bd7fda211c
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -129,7 +129,8 @@ public abstract class ContainerMobileVehicleEntity extends MobileVehicleEntity i
* @param item 物品类型
* @return 物品数量
*/
public int countItem(@NotNull Item item) {
public int countItem(@Nullable Item item) {
if (item == null) return 0;
return InventoryTool.countItem(this.getItemStacks(), item);
}