mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Store interacting mob instead of disposing of.
This commit is contained in:
@@ -57,6 +57,11 @@ public abstract class Mob extends Entity {
|
||||
*/
|
||||
protected int index = -1;
|
||||
|
||||
/**
|
||||
* The mob this mob is interacting with.
|
||||
*/
|
||||
protected Mob interactingMob;
|
||||
|
||||
/**
|
||||
* This mob's inventory.
|
||||
*/
|
||||
@@ -419,8 +424,18 @@ public abstract class Mob extends Entity {
|
||||
*
|
||||
* @param index The index of the interacting mob.
|
||||
*/
|
||||
public void updateInteractingMob(int index) {
|
||||
blockSet.add(SynchronizationBlock.createInteractingMobBlock(index));
|
||||
public void updateInteractingMob(final Mob mob) {
|
||||
blockSet.add(SynchronizationBlock.createInteractingMobBlock(mob.index));
|
||||
this.interactingMob = mob;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the mob this mob is interacting with.
|
||||
*
|
||||
* @return The mob.
|
||||
*/
|
||||
public Mob getInteractingMob() {
|
||||
return interactingMob;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user