Cloning works now, changed object list to hash map (significant performance increase)

This commit is contained in:
Light2
2013-09-21 19:02:35 +02:00
parent b676dffdec
commit c7bfc890bd
13 changed files with 145 additions and 59 deletions
@@ -1042,7 +1042,23 @@ public class CreatureObject extends TangibleObject implements IPersistent {
}
notifyObservers(messageBuilder.buildRemoveBuffDelta(buff), true);
}
public void updateBuff(Buff buff) {
buff.updateRemovalTask();
synchronized(objectMutex) {
setBuffListCounter(getBuffListCounter() + 1);
notifyObservers(messageBuilder.buildUpdateBuffDelta(buff), true);
}
}
public void updateAllBuffs() {
synchronized(objectMutex) {
for(Buff buff : buffList.get()) {
updateBuff(buff);
}
}
}
public int getBuffListCounter() {
synchronized(objectMutex) {
return buffListUpdateCounter;