#778: Added get/set ItemStack methods to trident

By: Auxilor <will@willfp.com>
This commit is contained in:
CraftBukkit/Spigot 2021-01-02 08:49:22 +11:00
parent 5868631388
commit 904d0ddd37

View file

@ -2,8 +2,10 @@ package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityThrownTrident;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Trident;
import org.bukkit.inventory.ItemStack;
public class CraftTrident extends CraftArrow implements Trident {
@ -16,6 +18,16 @@ public class CraftTrident extends CraftArrow implements Trident {
return (EntityThrownTrident) super.getHandle();
}
@Override
public ItemStack getItem() {
return CraftItemStack.asBukkitCopy(getHandle().trident);
}
@Override
public void setItem(ItemStack itemStack) {
getHandle().trident = CraftItemStack.asNMSCopy(itemStack);
}
@Override
public String toString() {
return "CraftTrident";