Class: CraftBook::NBT::LongTag
- Defined in:
- lib/craftbook/nbt/long_tag.rb
Overview
Represents a signed 64-bit integer in the range of -9223372036854775808
and 9223372036854775807
inclusive.
Constant Summary collapse
- MIN =
The minimum permissible value for this type.
-0x8000000000000000
- MAX =
The maximum permissible value for this type.
0x7FFFFFFFFFFFFFFF
Constants inherited from Tag
Tag::TYPE_BYTE, Tag::TYPE_BYTE_ARRAY, Tag::TYPE_COMPOUND, Tag::TYPE_DOUBLE, Tag::TYPE_END, Tag::TYPE_FLOAT, Tag::TYPE_INT, Tag::TYPE_INT_ARRAY, Tag::TYPE_LIST, Tag::TYPE_LONG, Tag::TYPE_LONG_ARRAY, Tag::TYPE_SHORT, Tag::TYPE_STRING
Instance Attribute Summary collapse
-
#value ⇒ Numeric
The value of the tag.
Attributes inherited from Tag
Instance Method Summary collapse
-
#initialize(name, value = 0) ⇒ LongTag
constructor
Creates a new instance of the LongTag class.
-
#stringify ⇒ String
The NBT tag as an SNBT string.
-
#to_s ⇒ String
The NBT tag as a formatted and human-readable string.
Methods inherited from ValueTag
Methods inherited from Tag
parse, #pretty, #pretty_print, #to_h, #to_json
Constructor Details
#initialize(name, value = 0) ⇒ LongTag
Creates a new instance of the CraftBook::NBT::LongTag class.
28 29 30 |
# File 'lib/craftbook/nbt/long_tag.rb', line 28 def initialize(name, value = 0) super(TYPE_LONG, name, value) end |
Instance Attribute Details
#value ⇒ Numeric
Returns the value of the tag.
|
# File 'lib/craftbook/nbt/long_tag.rb', line 18
|
Instance Method Details
#stringify ⇒ String
Returns the NBT tag as an SNBT string.
45 46 47 |
# File 'lib/craftbook/nbt/long_tag.rb', line 45 def stringify "#{snbt_prefix}#{@value}L" end |
#to_s ⇒ String
Returns the NBT tag as a formatted and human-readable string.
39 40 41 |
# File 'lib/craftbook/nbt/long_tag.rb', line 39 def to_s "TAG_Long(#{@name ? "\"#{@name}\"" : 'None'}): #{@value}" end |