mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Fix item cost type reading
This commit is contained in:
parent
d068822143
commit
5f90bcbbaf
@ -22,6 +22,7 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.api.minecraft.data;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.data.FullMappings;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
@ -44,7 +45,7 @@ public final class StructuredDataContainer {
|
||||
public StructuredDataContainer(final StructuredData<?>[] dataArray) {
|
||||
this(new Reference2ObjectOpenHashMap<>(dataArray.length));
|
||||
for (final StructuredData<?> data : dataArray) {
|
||||
add(data);
|
||||
this.data.put(data.key(), data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,6 +139,7 @@ public final class StructuredDataContainer {
|
||||
*/
|
||||
public void setIdLookup(final Protocol<?, ?, ?, ?> protocol, final boolean mappedNames) {
|
||||
this.lookup = protocol.getMappingData().getDataComponentSerializerMappings();
|
||||
Preconditions.checkNotNull(this.lookup, "Data component serializer mappings are null");
|
||||
this.mappedNames = mappedNames;
|
||||
}
|
||||
|
||||
@ -159,10 +161,6 @@ public final class StructuredDataContainer {
|
||||
return data;
|
||||
}
|
||||
|
||||
private <T> void add(final StructuredData<T> data) {
|
||||
set(data.key(), data.value());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "StructuredDataContainer{" +
|
||||
|
Loading…
Reference in New Issue
Block a user