mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-28 11:09:11 +00:00
Add additional cast checking to PDC tag fetching, cast via complex type (#118)
This commit is contained in:
@@ -37,8 +37,8 @@ public record BukkitPersistentTypeMapping<T, Z>(PersistentDataTagType type, Pers
|
||||
}
|
||||
|
||||
public void setContainerValue(@NotNull PersistentDataContainerData container, @NotNull Player player, @NotNull NamespacedKey key) throws NullPointerException {
|
||||
container.getTagValue(key.toString(), bukkitType.getPrimitiveType())
|
||||
.ifPresent(value -> player.getPersistentDataContainer().set(key, bukkitType, (Z) value));
|
||||
container.getTagValue(key.toString(), bukkitType.getComplexType())
|
||||
.ifPresent(value -> player.getPersistentDataContainer().set(key, bukkitType, value));
|
||||
}
|
||||
|
||||
public static Optional<BukkitPersistentTypeMapping<?, ?>> getMapping(@NotNull PersistentDataTagType type) {
|
||||
|
||||
Reference in New Issue
Block a user