mirror of
https://github.com/Rogiel/l2jserver2
synced 2026-02-01 15:32:48 +00:00
Change-Id: I0cca627373c68d94025647f802a7fa6b419e0aad
This commit is contained in:
@@ -5,10 +5,10 @@ import com.l2jserver.model.world.actor.ActorListener;
|
||||
|
||||
public abstract class PlayerListener implements ActorListener {
|
||||
@Override
|
||||
public void dispatch(ActorEvent e) {
|
||||
public boolean dispatch(ActorEvent e) {
|
||||
if (!(e instanceof PlayerEvent))
|
||||
return;
|
||||
dispatch((PlayerEvent) e);
|
||||
return false;
|
||||
return dispatch((PlayerEvent) e);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,5 +18,5 @@ public abstract class PlayerListener implements ActorListener {
|
||||
* @param e
|
||||
* the event
|
||||
*/
|
||||
protected abstract void dispatch(PlayerEvent e);
|
||||
protected abstract boolean dispatch(PlayerEvent e);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.l2jserver.model.world.player;
|
||||
|
||||
import com.l2jserver.model.world.Player;
|
||||
import com.l2jserver.model.world.capability.Actor;
|
||||
import com.l2jserver.model.world.capability.Listenable;
|
||||
import com.l2jserver.model.world.capability.Spawnable;
|
||||
import com.l2jserver.model.world.event.SpawnEvent;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
@@ -14,12 +15,6 @@ public class PlayerSpawnEvent implements PlayerEvent, SpawnEvent {
|
||||
this.player = player;
|
||||
this.coordinate = coordinate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatch() {
|
||||
if (player != null)
|
||||
player.dispatch(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Spawnable getObject() {
|
||||
@@ -40,4 +35,9 @@ public class PlayerSpawnEvent implements PlayerEvent, SpawnEvent {
|
||||
public Actor getActor() {
|
||||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Listenable<?, ?>[] getDispatchableObjects() {
|
||||
return new Listenable<?, ?>[] { player };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user