diff --git a/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java b/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java index f11b4591a..48a90e9e2 100644 --- a/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java +++ b/main/src/main/java/net/citizensnpcs/editor/HorseEquipper.java @@ -1,11 +1,11 @@ package net.citizensnpcs.editor; -import net.citizensnpcs.api.npc.NPC; -import net.citizensnpcs.util.NMS; - import org.bukkit.entity.Horse; import org.bukkit.entity.Player; +import net.citizensnpcs.api.npc.NPC; +import net.citizensnpcs.util.NMS; + public class HorseEquipper implements Equipper { @Override public void equip(Player equipper, NPC toEquip) { diff --git a/main/src/main/java/net/citizensnpcs/util/NMS.java b/main/src/main/java/net/citizensnpcs/util/NMS.java index aca04ea18..11f6148ad 100644 --- a/main/src/main/java/net/citizensnpcs/util/NMS.java +++ b/main/src/main/java/net/citizensnpcs/util/NMS.java @@ -10,7 +10,6 @@ import org.bukkit.block.Block; import org.bukkit.boss.BossBar; import org.bukkit.entity.Entity; import org.bukkit.entity.FishHook; -import org.bukkit.entity.Horse; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Shulker; @@ -189,7 +188,7 @@ public class NMS { BRIDGE.mount(entity, passenger); } - public static void openHorseScreen(Horse horse, Player equipper) { + public static void openHorseScreen(Tameable horse, Player equipper) { BRIDGE.openHorseScreen(horse, equipper); } diff --git a/main/src/main/java/net/citizensnpcs/util/NMSBridge.java b/main/src/main/java/net/citizensnpcs/util/NMSBridge.java index 6b36d19d4..182f100b1 100644 --- a/main/src/main/java/net/citizensnpcs/util/NMSBridge.java +++ b/main/src/main/java/net/citizensnpcs/util/NMSBridge.java @@ -9,7 +9,6 @@ import org.bukkit.block.Block; import org.bukkit.boss.BossBar; import org.bukkit.entity.Entity; import org.bukkit.entity.FishHook; -import org.bukkit.entity.Horse; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Shulker; @@ -90,7 +89,7 @@ public interface NMSBridge { public void mount(Entity entity, Entity passenger); - public void openHorseScreen(Horse horse, Player equipper); + public void openHorseScreen(Tameable horse, Player equipper); public void playAnimation(PlayerAnimation animation, Player player, int radius); 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 07b1e60b8..0ec37541a 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 @@ -32,7 +32,6 @@ import org.bukkit.craftbukkit.v1_10_R1.entity.CraftWither; import org.bukkit.craftbukkit.v1_10_R1.event.CraftEventFactory; import org.bukkit.entity.EntityType; import org.bukkit.entity.FishHook; -import org.bukkit.entity.Horse; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Shulker; @@ -689,8 +688,8 @@ public class NMSImpl implements NMSBridge { } @Override - public void openHorseScreen(Horse horse, Player equipper) { - EntityLiving handle = NMSImpl.getHandle(horse); + public void openHorseScreen(Tameable horse, Player equipper) { + EntityLiving handle = NMSImpl.getHandle((LivingEntity) horse); EntityLiving equipperHandle = NMSImpl.getHandle(equipper); if (handle == null || equipperHandle == null) return; 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 eb597b3c2..8144d172b 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 @@ -32,7 +32,6 @@ import org.bukkit.craftbukkit.v1_11_R1.entity.CraftWither; import org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory; import org.bukkit.entity.EntityType; import org.bukkit.entity.FishHook; -import org.bukkit.entity.Horse; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Shulker; @@ -182,6 +181,7 @@ import net.minecraft.server.v1_11_R1.Entity; import net.minecraft.server.v1_11_R1.EntityEnderDragon; import net.minecraft.server.v1_11_R1.EntityFishingHook; import net.minecraft.server.v1_11_R1.EntityHorse; +import net.minecraft.server.v1_11_R1.EntityHorseAbstract; import net.minecraft.server.v1_11_R1.EntityHuman; import net.minecraft.server.v1_11_R1.EntityInsentient; import net.minecraft.server.v1_11_R1.EntityLiving; @@ -748,14 +748,14 @@ public class NMSImpl implements NMSBridge { } @Override - public void openHorseScreen(Horse horse, Player equipper) { - EntityLiving handle = NMSImpl.getHandle(horse); + public void openHorseScreen(Tameable horse, Player equipper) { + EntityLiving handle = NMSImpl.getHandle((LivingEntity) horse); EntityLiving equipperHandle = NMSImpl.getHandle(equipper); if (handle == null || equipperHandle == null) return; boolean wasTamed = horse.isTamed(); horse.setTamed(true); - ((EntityHorse) handle).a((EntityHuman) equipperHandle); + ((EntityHorseAbstract) handle).a((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 8e99d3a29..232557d9a 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 @@ -32,7 +32,6 @@ import org.bukkit.craftbukkit.v1_12_R1.entity.CraftWither; import org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory; import org.bukkit.entity.EntityType; import org.bukkit.entity.FishHook; -import org.bukkit.entity.Horse; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Shulker; @@ -186,6 +185,7 @@ import net.minecraft.server.v1_12_R1.EntityBird; import net.minecraft.server.v1_12_R1.EntityEnderDragon; import net.minecraft.server.v1_12_R1.EntityFishingHook; import net.minecraft.server.v1_12_R1.EntityHorse; +import net.minecraft.server.v1_12_R1.EntityHorseAbstract; import net.minecraft.server.v1_12_R1.EntityHuman; import net.minecraft.server.v1_12_R1.EntityInsentient; import net.minecraft.server.v1_12_R1.EntityLiving; @@ -755,14 +755,14 @@ public class NMSImpl implements NMSBridge { } @Override - public void openHorseScreen(Horse horse, Player equipper) { - EntityLiving handle = NMSImpl.getHandle(horse); + public void openHorseScreen(Tameable horse, Player equipper) { + EntityLiving handle = NMSImpl.getHandle((LivingEntity) horse); EntityLiving equipperHandle = NMSImpl.getHandle(equipper); if (handle == null || equipperHandle == null) return; boolean wasTamed = horse.isTamed(); horse.setTamed(true); - ((EntityHorse) handle).a((EntityHuman) equipperHandle); + ((EntityHorseAbstract) handle).a((EntityHuman) equipperHandle); horse.setTamed(wasTamed); }