Move getItemInUse up to LivingEntity

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2024-03-30 12:54:26 +11:00
parent dd0e55721d
commit 3f9e7c4e39
2 changed files with 6 additions and 6 deletions

View file

@ -456,12 +456,6 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
return getHandle().isUsingItem();
}
@Override
public ItemStack getItemInUse() {
net.minecraft.world.item.ItemStack item = getHandle().getUseItem();
return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item);
}
@Override
public boolean setWindowProperty(InventoryView.Property prop, int value) {
return false;

View file

@ -258,6 +258,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
getHandle().maxAirTicks = ticks;
}
@Override
public ItemStack getItemInUse() {
net.minecraft.world.item.ItemStack item = getHandle().getUseItem();
return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item);
}
@Override
public int getItemInUseTicks() {
return getHandle().getUseItemRemainingTicks();