mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-28 19:11:47 +01:00
Fix NMS#mount
This commit is contained in:
parent
47034e5212
commit
215efc1f5a
@ -832,9 +832,10 @@ 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(
|
||||
aliases = { "npc" },
|
||||
|
@ -177,6 +177,7 @@ public class PigController extends MobEntityController {
|
||||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void L() {
|
||||
if (npc == null) {
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user