Skip to content

Commit

Permalink
Fix horse equipping
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jan 31, 2014
1 parent cf5739f commit 335af20
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/net/citizensnpcs/util/NMS.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.craftbukkit.v1_7_R1.CraftSound;
import org.bukkit.craftbukkit.v1_7_R1.CraftServer;
import org.bukkit.craftbukkit.v1_7_R1.CraftSound;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_7_R1.entity.CraftLivingEntity;
Expand Down Expand Up @@ -174,7 +174,7 @@ public static void flyingMoveLogic(EntityLiving entity, float f, float f1) {
}

private static Constructor<?> getCustomEntityConstructor(Class<?> clazz, EntityType type) throws SecurityException,
NoSuchMethodException {
NoSuchMethodException {
Constructor<?> constructor = ENTITY_CONSTRUCTOR_CACHE.get(clazz);
if (constructor == null) {
constructor = clazz.getConstructor(World.class);
Expand Down Expand Up @@ -287,7 +287,10 @@ public static void mount(org.bukkit.entity.Entity entity, org.bukkit.entity.Enti
}

public static void openHorseScreen(Horse horse, Player equipper) {
((EntityHorse) getHandle(horse)).f((EntityHuman) NMS.getHandle(equipper));
boolean wasTamed = horse.isTamed();
horse.setTamed(true);
((EntityHorse) getHandle(horse)).a((EntityHuman) NMS.getHandle(equipper));
horse.setTamed(wasTamed);
}

public static void registerEntityClass(Class<?> clazz) {
Expand Down

0 comments on commit 335af20

Please sign in to comment.