25w07a
This commit is contained in:
1 parent
4079ef1419
commit
9be8d5c77b
7 files changed
+30
-26
No files matched your search
@@ -43,6 +43,7 @@ import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.level.DistanceManager;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -887,7 +888,7 @@ public class WorldAccess
|
||||
ItemStack tool;
|
||||
if (tag != null)
|
||||
{
|
||||
tool = ItemStack.parseOptional(regs, tag);
|
||||
tool = ItemStack.CODEC.parse(regs.createSerializationContext(NbtOps.INSTANCE), tag).result().orElse(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -955,7 +956,7 @@ public class WorldAccess
|
||||
{
|
||||
return Value.NULL;
|
||||
}
|
||||
return new NBTSerializableValue(() -> tool.saveOptional(regs));
|
||||
return new NBTSerializableValue(() -> ItemStack.CODEC.encodeStart(regs.createSerializationContext(NbtOps.INSTANCE), tool).getOrThrow());
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user