This commit is contained in:
fullwall 2012-02-28 15:39:00 +08:00
parent 0d3d667f19
commit 1f74e7c244
2 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,8 @@ public class LinearWaypointProvider implements WaypointProvider {
@EventHandler
@SuppressWarnings("unused")
public void onPlayerInteract(PlayerInteractEvent event) {
if (!event.getPlayer().equals(player))
return;
if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
waypoints.add(new Waypoint(event.getClickedBlock().getLocation()));
player.sendMessage(ChatColor.GREEN + "Added a waypoint.");

View File

@ -50,4 +50,8 @@ public class Waypoints extends Trait {
}
private static final InstanceFactory<WaypointProvider> providers = DefaultInstanceFactory.create();
static {
providers.register(LinearWaypointProvider.class, "linear");
}
}