mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
Merge branch 'master' of bitbucket.org:Major-/apollo.
This commit is contained in:
@@ -15,7 +15,7 @@ public final class LoginDispatcher {
|
||||
/**
|
||||
* A {@link List} of login listeners.
|
||||
*/
|
||||
private List<LoginListener> listeners = new ArrayList<>();
|
||||
private final List<LoginListener> listeners = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Dispatches a player to the appropriate login listener.
|
||||
@@ -23,9 +23,7 @@ public final class LoginDispatcher {
|
||||
* @param player The player.
|
||||
*/
|
||||
public void dispatch(Player player) {
|
||||
for (LoginListener listener : listeners) {
|
||||
listener.execute(player);
|
||||
}
|
||||
listeners.forEach(listener -> listener.execute(player));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,6 @@ public interface LoginListener {
|
||||
*
|
||||
* @param player The player.
|
||||
*/
|
||||
public abstract void execute(Player player);
|
||||
public void execute(Player player);
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public final class LogoutDispatcher {
|
||||
/**
|
||||
* A {@link List} of logout listeners.
|
||||
*/
|
||||
private List<LogoutListener> listeners = new ArrayList<>();
|
||||
private final List<LogoutListener> listeners = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Dispatches a player to the appropriate logout listener.
|
||||
@@ -23,9 +23,7 @@ public final class LogoutDispatcher {
|
||||
* @param player The player.
|
||||
*/
|
||||
public void dispatch(Player player) {
|
||||
for (LogoutListener listen : listeners) {
|
||||
listen.execute(player);
|
||||
}
|
||||
listeners.forEach(listener -> listener.execute(player));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,6 @@ public interface LogoutListener {
|
||||
*
|
||||
* @param player The player.
|
||||
*/
|
||||
public abstract void execute(Player player);
|
||||
public void execute(Player player);
|
||||
|
||||
}
|
||||
@@ -402,6 +402,15 @@ public abstract class Mob extends Entity {
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this mobs interacting index.
|
||||
*
|
||||
* @return The interaction index of this mob.
|
||||
*/
|
||||
public int getInteractionIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates this mob's interacting mob.
|
||||
@@ -410,7 +419,7 @@ public abstract class Mob extends Entity {
|
||||
*/
|
||||
public final void setInteractingMob(Mob mob) {
|
||||
interactingMob = mob;
|
||||
blockSet.add(SynchronizationBlock.createInteractingMobBlock(mob.index));
|
||||
blockSet.add(SynchronizationBlock.createInteractingMobBlock(mob.getInteractionIndex()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -355,6 +355,11 @@ public final class Player extends Mob {
|
||||
return EntityType.PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInteractionIndex() {
|
||||
return getIndex() | 0x8000;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets this player's friend chat {@link PrivacyState}.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user