Sha256: 143e97095263ae71be68ed2e025dd5f54ece75707b199cd3ecb014c19fca0882

Contents?: true

Size: 449 Bytes

Versions: 3

Compression:

Stored size: 449 Bytes

Contents

module NBTUtils
  class TagName < ::BinData::Record
    # Spec says this is a TAG_Short, which is signed. Staying strict
    # though this may really be unsigned in practice.
    int16be :len, :value => Proc.new { data.length }
    string :data, :read_length => :len

    # things break for some reason if you just call the string :value
    def value
      data
    end

    def value=(other_value)
      self.data = (other_value)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nbt_utils-0.0.4 lib/nbt_utils/tag_name.rb
nbt_utils-0.0.3 lib/nbt_utils/tag_name.rb
nbt_utils-0.0.2 lib/nbt_utils/tag_name.rb