|
3 | 3 | import com.google.common.collect.Lists; |
4 | 4 | import com.google.gson.JsonParseException; |
5 | 5 | import net.minecraft.core.NonNullList; |
6 | | -import net.minecraft.nbt.ByteArrayTag; |
7 | | -import net.minecraft.nbt.CompoundTag; |
8 | | -import net.minecraft.nbt.EndTag; |
9 | | -import net.minecraft.nbt.IntArrayTag; |
10 | | -import net.minecraft.nbt.ListTag; |
11 | | -import net.minecraft.nbt.NbtOps; |
12 | | -import net.minecraft.nbt.NumericTag; |
13 | | -import net.minecraft.nbt.StringTag; |
14 | | -import net.minecraft.nbt.Tag; |
| 6 | +import net.minecraft.nbt.*; |
15 | 7 | import net.minecraft.network.FriendlyByteBuf; |
16 | 8 | import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket; |
17 | 9 | import net.minecraft.server.level.ServerPlayer; |
@@ -254,7 +246,7 @@ public void updateCraftingInventory(ServerPlayer player, List<ItemStack> allItem |
254 | 246 | CompoundTag tag = new CompoundTag(); |
255 | 247 | tag.putInt("slot", i); |
256 | 248 | try { |
257 | | - tag.put("stack", ItemStack.OPTIONAL_CODEC.encodeStart(NbtOps.INSTANCE, itemStack) |
| 249 | + tag.put("stack", ItemStack.OPTIONAL_CODEC.encodeStart(player.registryAccess().createSerializationContext(NbtOps.INSTANCE), itemStack) |
258 | 250 | .getOrThrow(JsonParseException::new)); |
259 | 251 | } catch (JsonParseException e) { |
260 | 252 | ColossalChestsInstance.MOD.log(Level.ERROR, "Error while attempting to send a stack to a client " + itemStack); |
|
0 commit comments