mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-27 10:31:21 +01:00
Fix NMS#mount
This commit is contained in:
parent
47034e5212
commit
215efc1f5a
@ -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(
|
||||
|
@ -176,6 +176,7 @@ public class PigController extends MobEntityController {
|
||||
}
|
||||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void L() {
|
||||
|
@ -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