Skip to content

Commit 4682ddd

Browse files
authored
Merge pull request #36 from fantasyorg/master
feat: packet-events 2.9.1
2 parents 49943c9 + a4ce058 commit 4682ddd

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

api/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,12 @@ public void setMaskBit(int index, byte bit, boolean value) {
272272
}
273273

274274
@Override
275-
public List<EntityData> entityData(ClientVersion clientVersion) {
275+
public @NotNull List<EntityData<?>> entityData(@NotNull ClientVersion clientVersion) {
276276
return metadata.getEntries(); // TODO: Atm this is useless cause of the way the api works. Might change in the future
277277
}
278278

279279
@Override
280-
public List<EntityData> entityData() {
280+
public @NotNull List<EntityData<?>> entityData() {
281281
return metadata.getEntries();
282282
}
283283

api/src/main/java/me/tofaa/entitylib/meta/Metadata.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public class Metadata {
1919

2020
private final int entityId;
2121
private volatile boolean notifyAboutChanges = true;
22-
private final HashMap<Byte, EntityData> notNotifiedChanges = new HashMap<>();
23-
private final ConcurrentHashMap<Byte, EntityData> metadataMap = new ConcurrentHashMap<>();
22+
private final HashMap<Byte, EntityData<?>> notNotifiedChanges = new HashMap<>();
23+
private final ConcurrentHashMap<Byte, EntityData<?>> metadataMap = new ConcurrentHashMap<>();
2424

2525
public Metadata(int entityId) {
2626
this.entityId = entityId;
@@ -47,13 +47,13 @@ public void clear() {
4747
}
4848

4949
public <T> T getIndex(byte index, @Nullable T defaultValue) {
50-
EntityData value = this.metadataMap.get(index);
50+
EntityData<?> value = this.metadataMap.get(index);
5151
return value != null ? (T) value.getValue() : defaultValue;
5252
}
5353

5454
public <T> void setIndex(byte index, @NotNull EntityDataType<T> dataType, T value) {
5555

56-
final EntityData entry = new EntityData(index, dataType, value);
56+
final EntityData<?> entry = new EntityData<>(index, dataType, value);
5757
this.metadataMap.put(index, entry);
5858

5959
final Optional<EntityLibAPI<?>> optionalApi = EntityLib.getOptionalApi();
@@ -75,7 +75,7 @@ public void setNotifyAboutChanges(boolean notifyAboutChanges) {
7575
return;
7676
}
7777

78-
List<EntityData> entries = null;
78+
List<EntityData<?>> entries = null;
7979
synchronized (this.notNotifiedChanges) {
8080
this.notifyAboutChanges = notifyAboutChanges;
8181
if (notifyAboutChanges) {
@@ -96,7 +96,7 @@ public void setNotifyAboutChanges(boolean notifyAboutChanges) {
9696
}
9797

9898
public void setMetaFromPacket(WrapperPlayServerEntityMetadata wrapper) {
99-
for (EntityData data : wrapper.getEntityMetadata()) {
99+
for (EntityData<?> data : wrapper.getEntityMetadata()) {
100100
metadataMap.put((byte) data.getIndex(), data);
101101
}
102102
}
@@ -105,7 +105,7 @@ public boolean isNotifyingChanges() {
105105
return notifyAboutChanges;
106106
}
107107

108-
@NotNull List<EntityData> getEntries() {
108+
@NotNull List<EntityData<?>> getEntries() {
109109
return Collections.unmodifiableList(new ArrayList<>(metadataMap.values()));
110110
}
111111

libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[versions]
2-
adventure = "4.16.0"
3-
jetbrains-annotations = "24.0.0"
4-
gson = "2.11.0"
5-
packetevents = "2.7.0"
2+
adventure = "4.22.0"
3+
jetbrains-annotations = "26.0.2"
4+
gson = "2.13.1"
5+
packetevents = "2.9.1"
66
paper = "1.21-R0.1-SNAPSHOT"
77
velocity = "3.3.0-SNAPSHOT"
88
run-paper = "2.3.0"

0 commit comments

Comments
 (0)