Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-258210

NBT sizes are calculated inconsistently

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.19.3 Pre-release 3
    • Plausible
    • Commands

      The bug

      Since 1.19.3 Pre-release 3, a finite upper limit has been added to the NBT size. This limit is 2097152 bits in one place and 2097152 bytes in another. This is probably unintentional, and either one is correct. (It seems that bytes are correct, considering that the limit comes from the max NBT size of FriendlyByteBuf.)

      Code analysis

      In net.minecraft.commands.arguments.NbtPathArgument#set and net.minecraft.commands.arguments.NbtPathArgument#insert, NBT sizes are calculated in bits by sizeInBits. On the other hand, in net.minecraft.server.commands.data.DataCommands#register and net.minecraft.server.commands.data.DataCommands#mergeData, NBT sizes are calculated in bytes by sizeInBytes.

            Unassigned Unassigned
            intsuc intsuc
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: