diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d67dbee..e62d9fa 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,9 +5,10 @@
-
+
+
-
+
@@ -88,39 +89,39 @@
- {
+ "keyToString": {
+ "Downloaded.Files.Path.Enabled": "false",
+ "Gradle.Build EntityLib.executor": "Run",
+ "Gradle.EntityLib [dependencies].executor": "Run",
+ "Gradle.EntityLib [publish].executor": "Run",
+ "Gradle.EntityLib:code-gen [:code-gen:Main.main()].executor": "Run",
+ "Gradle.EntityLib:test-plugin [publish].executor": "Run",
+ "Gradle.EntityLib:test-plugin [runServer].executor": "Run",
+ "Gradle.EntityLib:test-plugin [shadowJar].executor": "Run",
+ "Repository.Attach.Annotations": "false",
+ "Repository.Attach.JavaDocs": "false",
+ "Repository.Attach.Sources": "false",
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "WebServerToolWindowFactoryState": "false",
+ "git-widget-placeholder": "master",
+ "ignore.virus.scanning.warn.message": "true",
+ "jdk.selected.JAVA_MODULE": "corretto-17",
+ "kotlin-language-version-configured": "true",
+ "last_opened_file_path": "D:/Github/EntityLib/api/src/main/java/me/tofaa/entitylib/extras",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "project.structure.last.edited": "Project",
+ "project.structure.proportion": "0.15",
+ "project.structure.side.proportion": "0.2",
+ "settings.editor.selected.configurable": "preferences.pluginManager",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
@@ -304,7 +305,7 @@
-
+
diff --git a/api/src/main/java/me/tofaa/entitylib/meta/Metadata.java b/api/src/main/java/me/tofaa/entitylib/meta/Metadata.java
index b8f8a4e..18d8c06 100644
--- a/api/src/main/java/me/tofaa/entitylib/meta/Metadata.java
+++ b/api/src/main/java/me/tofaa/entitylib/meta/Metadata.java
@@ -35,7 +35,7 @@ public class Metadata {
this.metadataMap.put(index, entry);
final WrapperEntity entity = EntityLib.getApi().getEntity(entityId);
- if (entity == null || entity.isSpawned()) return; // Not EntityLib entity then, the user must send the packet manually. OR not spawned.
+ if (entity == null || !entity.isSpawned()) return; // Not EntityLib entity then, the user must send the packet manually. OR not spawned.
if (!this.notifyAboutChanges) {
synchronized (this.notNotifiedChanges) {
this.notNotifiedChanges.put(index, entry);
diff --git a/api/src/main/java/me/tofaa/entitylib/utils/ConcurrentWeakIdentityHashMap.java b/api/src/main/java/me/tofaa/entitylib/utils/ConcurrentWeakIdentityHashMap.java
new file mode 100644
index 0000000..f7dd347
--- /dev/null
+++ b/api/src/main/java/me/tofaa/entitylib/utils/ConcurrentWeakIdentityHashMap.java
@@ -0,0 +1,232 @@
+package me.tofaa.entitylib.utils;
+
+import java.lang.ref.Reference;
+import java.lang.ref.ReferenceQueue;
+import java.util.AbstractMap.SimpleEntry;
+import java.util.AbstractSet;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * @author Alex Snaps
+ */
+public class ConcurrentWeakIdentityHashMap implements ConcurrentMap {
+
+ private final ConcurrentMap, V> map = new ConcurrentHashMap, V>();
+ private final ReferenceQueue queue = new ReferenceQueue();
+
+ @Override
+ public V putIfAbsent(final K key, final V value) {
+ purgeKeys();
+ return map.putIfAbsent(newKey(key), value);
+ }
+
+ @Override
+ public boolean remove(final Object key, final Object value) {
+ purgeKeys();
+ return map.remove(new WeakReference