From 904d0ddd37943e490637bea78b699e2d83f98d6c Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 2 Jan 2021 08:49:22 +1100 Subject: [PATCH] #778: Added get/set ItemStack methods to trident By: Auxilor --- .../org/bukkit/craftbukkit/entity/CraftTrident.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java index 0518e6c683..d84b78dbab 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java @@ -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";