Fix HorseEquipper

This commit is contained in:
fullwall 2013-08-04 23:23:08 +08:00
parent cfcd046d4e
commit e68f4d2643
2 changed files with 5 additions and 3 deletions

View File

@ -10,6 +10,6 @@ public class HorseEquipper implements Equipper {
@Override
public void equip(Player equipper, NPC toEquip) {
Horse horse = (Horse) toEquip.getBukkitEntity();
NMS.equip(horse, equipper);
NMS.openHorseScreen(horse, equipper);
}
}

View File

@ -17,6 +17,7 @@ import net.minecraft.server.v1_6_R2.ControllerJump;
import net.minecraft.server.v1_6_R2.DamageSource;
import net.minecraft.server.v1_6_R2.EnchantmentManager;
import net.minecraft.server.v1_6_R2.Entity;
import net.minecraft.server.v1_6_R2.EntityHorse;
import net.minecraft.server.v1_6_R2.EntityHuman;
import net.minecraft.server.v1_6_R2.EntityInsentient;
import net.minecraft.server.v1_6_R2.EntityLiving;
@ -40,6 +41,7 @@ import org.bukkit.craftbukkit.v1_6_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_6_R2.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Horse;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginLoadOrder;
@ -116,8 +118,8 @@ public class NMS {
}
}
public static void equip(LivingEntity entity, Player equipper) {
getHandle(entity).a(NMS.getHandle(equipper));
public static void openHorseScreen(Horse horse, Player equipper) {
((EntityHorse) getHandle(horse)).f((EntityHuman) NMS.getHandle(equipper));
}
private static Constructor<?> getCustomEntityConstructor(Class<?> clazz, EntityType type) throws SecurityException,