25w07a
This commit is contained in:
1 parent
4079ef1419
commit
9be8d5c77b
7 files changed
+30
-26
No files matched your search
@@ -108,7 +108,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
||||
public static Value fromStack(ItemStack stack, RegistryAccess regs)
|
||||
{
|
||||
NBTSerializableValue value = new NBTSerializableValue();
|
||||
value.nbtSupplier = () -> stack.saveOptional(regs);
|
||||
value.nbtSupplier = () -> ItemStack.CODEC.encodeStart(regs.createSerializationContext(NbtOps.INSTANCE), stack).getOrThrow();
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
|
||||
public static ItemStack parseItem(String itemString, @Nullable CompoundTag customTag, RegistryAccess regs)
|
||||
{
|
||||
if (customTag != null) {
|
||||
return ItemStack.parseOptional(regs, customTag);
|
||||
return ItemStack.CODEC.parse(regs.createSerializationContext(NbtOps.INSTANCE), customTag).resultOrPartial().orElse(null);
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user