From 5f062dbb3acc39adfe97a0c87407105b14a63d99 Mon Sep 17 00:00:00 2001 From: fullwall Date: Thu, 15 Mar 2018 16:41:30 +0800 Subject: [PATCH] Fix horse/llama equipping --- main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java | 4 ++-- .../main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java | 2 +- .../main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java | 2 +- .../main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java b/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java index 48a90e9e2..98e1f195b 100644 --- a/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java +++ b/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java @@ -1,7 +1,7 @@ package net.citizensnpcs.editor; -import org.bukkit.entity.Horse; import org.bukkit.entity.Player; +import org.bukkit.entity.Tameable; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.util.NMS; @@ -9,7 +9,7 @@ import net.citizensnpcs.util.NMS; public class HorseEquipper implements Equipper { @Override public void equip(Player equipper, NPC toEquip) { - Horse horse = (Horse) toEquip.getEntity(); + Tameable horse = (Tameable) toEquip.getEntity(); NMS.openHorseScreen(horse, equipper); } } diff --git a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java index 273a0d493..0fc5647f4 100644 --- a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java +++ b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/util/NMSImpl.java @@ -699,7 +699,7 @@ public class NMSImpl implements NMSBridge { return; boolean wasTamed = horse.isTamed(); horse.setTamed(true); - ((EntityHorse) handle).a((EntityHuman) equipperHandle); + ((EntityHorse) handle).f((EntityHuman) equipperHandle); horse.setTamed(wasTamed); } diff --git a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java index d3d821d40..7658199e8 100644 --- a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java +++ b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/util/NMSImpl.java @@ -760,7 +760,7 @@ public class NMSImpl implements NMSBridge { return; boolean wasTamed = horse.isTamed(); horse.setTamed(true); - ((EntityHorseAbstract) handle).a((EntityHuman) equipperHandle); + ((EntityHorseAbstract) handle).f((EntityHuman) equipperHandle); horse.setTamed(wasTamed); } diff --git a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java index 38e8a345c..61545f03c 100644 --- a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java +++ b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/util/NMSImpl.java @@ -767,7 +767,7 @@ public class NMSImpl implements NMSBridge { return; boolean wasTamed = horse.isTamed(); horse.setTamed(true); - ((EntityHorseAbstract) handle).a((EntityHuman) equipperHandle); + ((EntityHorseAbstract) handle).c((EntityHuman) equipperHandle); horse.setTamed(wasTamed); }