尝试修复一个null导致的问题
This commit is contained in:
parent
7e239a2e9f
commit
bd7fda211c
1 changed files with 2 additions and 1 deletions
|
@ -129,7 +129,8 @@ public abstract class ContainerMobileVehicleEntity extends MobileVehicleEntity i
|
||||||
* @param item 物品类型
|
* @param item 物品类型
|
||||||
* @return 物品数量
|
* @return 物品数量
|
||||||
*/
|
*/
|
||||||
public int countItem(@NotNull Item item) {
|
public int countItem(@Nullable Item item) {
|
||||||
|
if (item == null) return 0;
|
||||||
return InventoryTool.countItem(this.getItemStacks(), item);
|
return InventoryTool.countItem(this.getItemStacks(), item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue