Store most popular IBaseEvent to reduce object creation.

This commit is contained in:
MobiusDevelopment
2021-10-25 00:52:51 +00:00
parent 4b302b66db
commit 64223af7fd
216 changed files with 5815 additions and 1727 deletions

View File

@@ -66,7 +66,11 @@ public class LargeCocoon extends AbstractNpcAI
{
case "attack":
{
onCreatureAttacked(new OnCreatureAttacked(player, npc, null));
final OnCreatureAttacked attackEvent = new OnCreatureAttacked();
attackEvent.setAttacker(player);
attackEvent.setTarget(npc);
attackEvent.setSkill(null);
onCreatureAttacked(attackEvent);
break;
}
case "attackPowerful":