From c83a8b8b119672348446429a829e68d583c2fc65 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 5 Mar 2015 18:37:29 +0100 Subject: [PATCH] Bad Cayor :P --- .../massivecraft/massivecore/MassiveCoreEngineMain.java | 2 +- src/com/massivecraft/massivecore/store/Coll.java | 7 ++++++- src/com/massivecraft/massivecore/store/Entity.java | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/massivecore/MassiveCoreEngineMain.java b/src/com/massivecraft/massivecore/MassiveCoreEngineMain.java index 6484c4f9..babf663b 100644 --- a/src/com/massivecraft/massivecore/MassiveCoreEngineMain.java +++ b/src/com/massivecraft/massivecore/MassiveCoreEngineMain.java @@ -394,7 +394,7 @@ public class MassiveCoreEngineMain extends EngineAbstract // double ms = (double)duration / 1000000D; // String message = Txt.parse("AsyncPlayerPreLoginEvent for %s took %.2f ms.", event.getName(), ms); // MassiveCore.get().log(message); - // NOTE: I get values between 5 and 20 ms. + // NOTE: I get values between 5 and 55 ms! } // Can not be cancelled. diff --git a/src/com/massivecraft/massivecore/store/Coll.java b/src/com/massivecraft/massivecore/store/Coll.java index 94d687d6..b9064f24 100644 --- a/src/com/massivecraft/massivecore/store/Coll.java +++ b/src/com/massivecraft/massivecore/store/Coll.java @@ -674,6 +674,11 @@ public class Coll implements CollInterface // Otherwise newly attached entities would be removed thinking it was a remote detach. // Otherwise newly detached entities would be loaded thinking it was a remote attach. Modification ret = this.identifiedModifications.get(id); + // DEBUG + // if (Bukkit.isPrimaryThread()) + // { + // MassiveCore.get().log(Txt.parse("examineId Coll: %s Entity: %s Modification: %s", this.getName(), id, ret)); + // } if (ret == Modification.LOCAL_ATTACH || ret == Modification.LOCAL_DETACH) return ret; E localEntity = this.id2entity.get(id); @@ -762,7 +767,7 @@ public class Coll implements CollInterface } // DEBUG - // MassiveCore.get().log(Txt.parse("Coll: %s Entity: %s Modification: %s", this.getName(), id, modification)); + // MassiveCore.get().log(Txt.parse("syncId Coll: %s Entity: %s Modification: %s", this.getName(), id, modification)); switch (modification) { diff --git a/src/com/massivecraft/massivecore/store/Entity.java b/src/com/massivecraft/massivecore/store/Entity.java index ad094f3d..4f9e11d6 100644 --- a/src/com/massivecraft/massivecore/store/Entity.java +++ b/src/com/massivecraft/massivecore/store/Entity.java @@ -111,7 +111,12 @@ public abstract class Entity> implements Comparable if ( ! coll.inited()) return; - coll.identifiedModifications.put(id, Modification.UNKNOWN); + // UNKNOWN is very unimportant really. + // LOCAL_ATTACH is for example much more important and should not be replaced. + if ( ! coll.identifiedModifications.containsKey(id)) + { + coll.identifiedModifications.put(id, Modification.UNKNOWN); + } } public Modification sync()