mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-28 05:35:45 +01:00
Fix?
This commit is contained in:
parent
1b3d81f019
commit
47c5775a95
@ -115,15 +115,14 @@ public class EventListen implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityTarget(EntityTargetEvent event) {
|
public void onEntityTarget(EntityTargetEvent event) {
|
||||||
if (!npcRegistry.isNPC(event.getEntity()) || !(event.getTarget() instanceof Player))
|
if (npcRegistry.isNPC(event.getEntity()) && event.getTarget() instanceof Player) {
|
||||||
return;
|
NPC npc = npcRegistry.getNPC(event.getEntity());
|
||||||
|
Player player = (Player) event.getTarget();
|
||||||
|
|
||||||
NPC npc = npcRegistry.getNPC(event.getEntity());
|
// Call right-click event
|
||||||
Player player = (Player) event.getTarget();
|
NPCRightClickEvent rightClickEvent = new NPCRightClickEvent(npc, player);
|
||||||
|
Bukkit.getPluginManager().callEvent(rightClickEvent);
|
||||||
// Call right-click event
|
}
|
||||||
NPCRightClickEvent rightClickEvent = new NPCRightClickEvent(npc, player);
|
|
||||||
Bukkit.getPluginManager().callEvent(rightClickEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -110,6 +110,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
|||||||
getControllerMove().c();
|
getControllerMove().c();
|
||||||
getControllerLook().a();
|
getControllerLook().a();
|
||||||
getControllerJump().b();
|
getControllerJump().b();
|
||||||
|
e(npc.getNavigator().getDefaultParameters().speed());
|
||||||
|
|
||||||
// taken from EntityLiving update method
|
// taken from EntityLiving update method
|
||||||
if (bu) {
|
if (bu) {
|
||||||
|
@ -72,7 +72,7 @@ public class Controllable extends Trait implements Toggleable {
|
|||||||
boolean onGround = handle.onGround;
|
boolean onGround = handle.onGround;
|
||||||
handle.motX += handle.passenger.motX * (onGround ? GROUND_SPEED : AIR_SPEED);
|
handle.motX += handle.passenger.motX * (onGround ? GROUND_SPEED : AIR_SPEED);
|
||||||
handle.motZ += handle.passenger.motZ * (onGround ? GROUND_SPEED : AIR_SPEED);
|
handle.motZ += handle.passenger.motZ * (onGround ? GROUND_SPEED : AIR_SPEED);
|
||||||
handle.e(npc.getNavigator().getSpeed());
|
handle.e(npc.getNavigator().getDefaultParameters().speed());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user