Fix NMS#mount

This commit is contained in:
fullwall 2016-03-12 12:29:11 +08:00
parent 47034e5212
commit 215efc1f5a
4 changed files with 4 additions and 3 deletions

View File

@ -832,8 +832,9 @@ public class NPCCommands {
return;
}
boolean success = npc.getTrait(Controllable.class).mount(player);
if (!success)
if (!success) {
Messaging.sendTr(player, Messages.FAILED_TO_MOUNT_NPC, npc.getName());
}
}
@Command(

View File

@ -176,6 +176,7 @@ public class PigController extends MobEntityController {
}
return false; // shouldLeash
}
@Override
protected void L() {

View File

@ -136,7 +136,6 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
public void onPlayerInteract(PlayerInteractEvent event) {
if (!npc.isSpawned() || !enabled)
return;
EntityPlayer handle = ((CraftPlayer) event.getPlayer()).getHandle();
Action performed = event.getAction();
if (!getHandle().passengers.contains(getHandle()))
return;

View File

@ -550,7 +550,7 @@ public class NMS {
public static void mount(org.bukkit.entity.Entity entity, org.bukkit.entity.Entity passenger) {
if (NMS.getHandle(passenger) == null)
return;
NMS.getHandle(passenger).startRiding(NMS.getHandle(entity));
NMS.getHandle(entity).startRiding(NMS.getHandle(passenger));
}
public static void openHorseScreen(Horse horse, Player equipper) {