Skip to content

Commit

Permalink
Set event priorty to MONITOR for right click entity events
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Nov 5, 2013
1 parent 923d078 commit f3c6cdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/citizensnpcs/EventListen.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public void onPlayerCreateNPC(PlayerCreateNPCEvent event) {
checkCreationEvent(event);
}

@EventHandler(ignoreCancelled = true)
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerInteractEntity(PlayerInteractEntityEvent event) {
NPC npc = npcRegistry.getNPC(event.getRightClicked());
if (npc == null) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/net/citizensnpcs/trait/Controllable.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public boolean toggle() {
return enabled;
}

private double updateHorizontralSpeed(EntityLiving handle, double speed, float speedMod) {
private double updateHorizontalSpeed(EntityLiving handle, double speed, float speedMod) {
double oldSpeed = Math.sqrt(handle.motX * handle.motX + handle.motZ * handle.motZ);
double horizontal = ((EntityLiving) handle.passenger).bf;
if (horizontal > 0.0D) {
Expand Down Expand Up @@ -253,7 +253,7 @@ public void run(Player rider) {
boolean onGround = handle.onGround;
float speedMod = npc.getNavigator().getDefaultParameters()
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
this.speed = updateHorizontralSpeed(handle, speed, speedMod);
this.speed = updateHorizontalSpeed(handle, speed, speedMod);

boolean shouldJump = NMS.shouldJump(handle.passenger);
if (shouldJump) {
Expand All @@ -275,7 +275,7 @@ public void run(Player rider) {
}

public class LookAirController implements MovementController {
boolean paused = false;
private boolean paused = false;

@Override
public void leftClick(PlayerInteractEvent event) {
Expand Down Expand Up @@ -319,7 +319,7 @@ public static interface MovementController {
}

public class PlayerInputAirController implements MovementController {
boolean paused = false;
private boolean paused = false;
private double speed;

@Override
Expand All @@ -344,7 +344,7 @@ public void run(Player rider) {
return;
}
EntityLiving handle = getHandle();
this.speed = updateHorizontralSpeed(handle, this.speed, 1F);
this.speed = updateHorizontalSpeed(handle, this.speed, 1F);
boolean shouldJump = NMS.shouldJump(handle.passenger);
if (shouldJump) {
handle.motY = 0.3F;
Expand Down

0 comments on commit f3c6cdc

Please sign in to comment.