Prohibit triggering onCreatureSee when regions are inactive.

This commit is contained in:
MobiusDevelopment
2021-06-24 00:21:39 +00:00
parent 00eb8fb2ce
commit 6cb552f3de
22 changed files with 132 additions and 44 deletions
@@ -5461,10 +5461,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5461,10 +5461,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5461,10 +5461,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5461,10 +5461,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5470,10 +5470,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5470,10 +5470,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5470,10 +5470,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5469,10 +5469,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5469,10 +5469,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5469,10 +5469,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -6794,10 +6794,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -6796,10 +6796,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5460,10 +5460,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5460,10 +5460,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5469,10 +5469,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5494,10 +5494,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5494,10 +5494,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5493,10 +5493,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5460,10 +5460,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5503,10 +5503,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5510,10 +5510,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}
@@ -5510,10 +5510,14 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
World.getInstance().forEachVisibleObjectInRange(this, Creature.class, _seenCreatureRange, creature ->
{
if (!creature.isInvisible() && _seenCreatures.add(creature))
if (!creature.isInvisible())
{
final WorldRegion worldRegion = getWorldRegion();
if ((worldRegion != null) && worldRegion.areNeighborsActive() && _seenCreatures.add(creature))
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureSee(this, creature), this);
}
}
});
}