@Override public synchronized void loadFromRemoteFixed(String id, Entry<JsonObject, Long> remoteEntry) { if (!Factions.get().isDatabaseInitialized()) { super.loadFromRemoteFixed(id, remoteEntry); return; } MPlayer mplayer = null; // Before String beforeId = null; if (mplayer == null) mplayer = this.id2entity.get(id); if (mplayer != null) beforeId = mplayer.getFactionId(); // Super super.loadFromRemoteFixed(id, remoteEntry); // After String afterId = null; if (mplayer == null) mplayer = this.id2entity.get(id); if (mplayer != null) afterId = mplayer.getFactionId(); // Perform if (mplayer != null) mplayer.updateFactionIndexes(beforeId, afterId); }
@Override public synchronized MPlayer removeAtLocalFixed(String id) { if (!Factions.get().isDatabaseInitialized()) return super.removeAtLocalFixed(id); MPlayer mplayer = this.id2entity.get(id); if (mplayer != null) { String beforeId = mplayer.getFactionId(); String afterId = null; mplayer.updateFactionIndexes(beforeId, afterId); } return super.removeAtLocalFixed(id); }