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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user