Skip to content

Commit

Permalink
clean teleports event a little
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 17, 2016
1 parent 2477079 commit 62acf68
Showing 1 changed file with 2 additions and 5 deletions.
Expand Up @@ -137,9 +137,8 @@ else if (name.equals("cause")) {
return super.getContext(name);
}

@EventHandler(ignoreCancelled = true)
@EventHandler
public void onEntityTeleports(EntityTeleportEvent event) {
// TODO: cuboids?
to = new dLocation(event.getTo());
from = new dLocation(event.getFrom());
entity = new dEntity(event.getEntity());
Expand All @@ -153,13 +152,11 @@ public void onEntityTeleports(EntityTeleportEvent event) {
event.setTo(to);
}

@EventHandler(ignoreCancelled = true)
@EventHandler
public void onPlayerTeleports(PlayerTeleportEvent event) {

if (dEntity.isNPC(event.getPlayer())) {
return;
}

from = new dLocation(event.getFrom());
to = new dLocation(event.getTo());
entity = new dEntity(event.getPlayer());
Expand Down

0 comments on commit 62acf68

Please sign in to comment.