diff --git a/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java b/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java index b628c8a..daa4379 100644 --- a/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java +++ b/api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java @@ -272,12 +272,12 @@ public class EntityMeta implements EntityMetadataProvider { } @Override - public List entityData(ClientVersion clientVersion) { + public @NotNull List> entityData(@NotNull ClientVersion clientVersion) { return metadata.getEntries(); // TODO: Atm this is useless cause of the way the api works. Might change in the future } @Override - public List entityData() { + public @NotNull List> entityData() { return metadata.getEntries(); } 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 5f91115..d93666f 100644 --- a/api/src/main/java/me/tofaa/entitylib/meta/Metadata.java +++ b/api/src/main/java/me/tofaa/entitylib/meta/Metadata.java @@ -19,8 +19,8 @@ public class Metadata { private final int entityId; private volatile boolean notifyAboutChanges = true; - private final HashMap notNotifiedChanges = new HashMap<>(); - private final ConcurrentHashMap metadataMap = new ConcurrentHashMap<>(); + private final HashMap> notNotifiedChanges = new HashMap<>(); + private final ConcurrentHashMap> metadataMap = new ConcurrentHashMap<>(); public Metadata(int entityId) { this.entityId = entityId; @@ -47,13 +47,13 @@ public class Metadata { } public T getIndex(byte index, @Nullable T defaultValue) { - EntityData value = this.metadataMap.get(index); + EntityData value = this.metadataMap.get(index); return value != null ? (T) value.getValue() : defaultValue; } public void setIndex(byte index, @NotNull EntityDataType dataType, T value) { - final EntityData entry = new EntityData(index, dataType, value); + final EntityData entry = new EntityData<>(index, dataType, value); this.metadataMap.put(index, entry); final Optional> optionalApi = EntityLib.getOptionalApi(); @@ -75,7 +75,7 @@ public class Metadata { return; } - List entries = null; + List> entries = null; synchronized (this.notNotifiedChanges) { this.notifyAboutChanges = notifyAboutChanges; if (notifyAboutChanges) { @@ -96,7 +96,7 @@ public class Metadata { } public void setMetaFromPacket(WrapperPlayServerEntityMetadata wrapper) { - for (EntityData data : wrapper.getEntityMetadata()) { + for (EntityData data : wrapper.getEntityMetadata()) { metadataMap.put((byte) data.getIndex(), data); } } @@ -105,7 +105,7 @@ public class Metadata { return notifyAboutChanges; } - @NotNull List getEntries() { + @NotNull List> getEntries() { return Collections.unmodifiableList(new ArrayList<>(metadataMap.values())); } diff --git a/libs.versions.toml b/libs.versions.toml index 4b2c87a..7b89472 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -1,8 +1,8 @@ [versions] -adventure = "4.16.0" -jetbrains-annotations = "24.0.0" -gson = "2.11.0" -packetevents = "2.7.0" +adventure = "4.22.0" +jetbrains-annotations = "26.0.2" +gson = "2.13.1" +packetevents = "2.9.1" paper = "1.21-R0.1-SNAPSHOT" velocity = "3.3.0-SNAPSHOT" run-paper = "2.3.0"