mirror of
https://github.com/Rogiel/l2jserver2
synced 2026-02-01 07:22:51 +00:00
@@ -3,6 +3,14 @@ package com.l2jserver.model.world.player;
|
||||
import com.l2jserver.model.world.Player;
|
||||
import com.l2jserver.model.world.actor.ActorEvent;
|
||||
|
||||
/**
|
||||
* Base event for {@link Player} objects
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface PlayerEvent extends ActorEvent {
|
||||
/**
|
||||
* @return the player
|
||||
*/
|
||||
Player getPlayer();
|
||||
}
|
||||
|
||||
@@ -5,6 +5,11 @@ import com.l2jserver.model.world.actor.ActorListener;
|
||||
import com.l2jserver.model.world.event.WorldEvent;
|
||||
import com.l2jserver.model.world.event.WorldListener;
|
||||
|
||||
/**
|
||||
* Listener for {@link PlayerEvent}
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public abstract class PlayerListener implements ActorListener {
|
||||
@Override
|
||||
public boolean dispatch(ActorEvent e) {
|
||||
|
||||
@@ -7,10 +7,29 @@ import com.l2jserver.model.world.capability.Spawnable;
|
||||
import com.l2jserver.model.world.event.SpawnEvent;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
/**
|
||||
* Event dispatcher once an player has spawned in the world
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class PlayerSpawnEvent implements PlayerEvent, SpawnEvent {
|
||||
/**
|
||||
* The spawned player
|
||||
*/
|
||||
private final Player player;
|
||||
/**
|
||||
* The spawning coordinate
|
||||
*/
|
||||
private final Coordinate coordinate;
|
||||
|
||||
/**
|
||||
* Creates a new instance
|
||||
*
|
||||
* @param player
|
||||
* the spawned player
|
||||
* @param coordinate
|
||||
* the spawn coordinate
|
||||
*/
|
||||
public PlayerSpawnEvent(Player player, Coordinate coordinate) {
|
||||
this.player = player;
|
||||
this.coordinate = coordinate;
|
||||
|
||||
@@ -3,7 +3,20 @@ package com.l2jserver.model.world.player;
|
||||
import com.l2jserver.model.world.Player;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
/**
|
||||
* Event dispatched once an player is teleported.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class PlayerTeleportEvent extends PlayerSpawnEvent {
|
||||
/**
|
||||
* Creates a new instance
|
||||
*
|
||||
* @param player
|
||||
* the teleported player
|
||||
* @param coordinate
|
||||
* the coordinate
|
||||
*/
|
||||
public PlayerTeleportEvent(Player player, Coordinate coordinate) {
|
||||
super(player, coordinate);
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.l2jserver.model.world.player;
|
||||
|
||||
import com.l2jserver.model.world.event.WorldEvent;
|
||||
|
||||
public interface TestEvent extends WorldEvent {
|
||||
}
|
||||
Reference in New Issue
Block a user