9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-06 15:52:03 +00:00

允许传递 null 玩家

This commit is contained in:
jhqwqmc
2025-10-25 22:48:48 +08:00
parent e650cfaa02
commit 3f559012b4
5 changed files with 60 additions and 11 deletions

View File

@@ -504,7 +504,7 @@ public class AbstractItem<W extends ItemWrapper<I>, I> implements Item<I> {
}
@Override
public void hurtAndBreak(int amount, @NotNull Player player, @Nullable EquipmentSlot slot) {
public void hurtAndBreak(int amount, @Nullable Player player, @Nullable EquipmentSlot slot) {
this.item.hurtAndBreak(amount, player, slot);
}
}

View File

@@ -216,7 +216,7 @@ public interface Item<I> {
void shrink(int amount);
void hurtAndBreak(int amount, @NotNull Player player, @Nullable EquipmentSlot slot);
void hurtAndBreak(int amount, @Nullable Player player, @Nullable EquipmentSlot slot);
default Item<I> transmuteCopy(Key another) {
return transmuteCopy(another, this.count());

View File

@@ -2,7 +2,6 @@ package net.momirealms.craftengine.core.item;
import net.momirealms.craftengine.core.entity.EquipmentSlot;
import net.momirealms.craftengine.core.entity.player.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface ItemWrapper<I> {
@@ -19,5 +18,5 @@ public interface ItemWrapper<I> {
void shrink(int amount);
void hurtAndBreak(int amount, @NotNull Player player, @Nullable EquipmentSlot slot);
void hurtAndBreak(int amount, @Nullable Player player, @Nullable EquipmentSlot slot);
}