add EntityMetadataLoop handling
This commit is contained in:
@@ -2,10 +2,11 @@ package v1_21_11
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"io"
|
||||
|
||||
"github.com/admin-else/strom/nbt"
|
||||
"github.com/admin-else/strom/proto_base"
|
||||
"github.com/google/uuid"
|
||||
"io"
|
||||
)
|
||||
|
||||
type ArmorTrimMaterial struct {
|
||||
@@ -3016,7 +3017,7 @@ type SlotComponentType struct {
|
||||
Val string
|
||||
}
|
||||
|
||||
var SlotComponentTypeMap = map[int32]string{0: "custom_data", 1: "max_stack_size", 10: "item_model", 100: "cat/variant", 101: "cat/collar", 102: "sheep/color", 103: "shulker/color", 11: "lore", 12: "rarity", 13: "enchantments", 14: "can_place_on", 15: "can_break", 16: "attribute_modifiers", 17: "custom_model_data", 18: "tooltip_display", 19: "repair_cost", 2: "max_damage", 20: "creative_slot_lock", 21: "enchantment_glint_override", 22: "intangible_projectile", 23: "food", 24: "consumable", 25: "use_remainder", 26: "use_cooldown", 27: "damage_resistant", 28: "tool", 29: "weapon", 3: "damage", 30: "attack_range", 31: "enchantable", 32: "equippable", 33: "repairable", 34: "glider", 35: "tooltip_style", 36: "death_protection", 37: "blocks_attacks", 38: "piercing_weapon", 39: "kinetic_weapon", 4: "unbreakable", 40: "swing_animation", 41: "stored_enchantments", 42: "dyed_color", 43: "map_color", 44: "map_id", 45: "map_decorations", 46: "map_post_processing", 47: "charged_projectiles", 48: "bundle_contents", 49: "potion_contents", 5: "use_effects", 50: "potion_duration_scale", 51: "suspicious_stew_effects", 52: "writable_book_content", 53: "written_book_content", 54: "trim", 55: "debug_stick_state", 56: "entity_data", 57: "bucket_entity_data", 58: "block_entity_data", 59: "instrument", 6: "custom_name", 60: "provides_trim_material", 61: "ominous_bottle_amplifier", 62: "jukebox_playable", 63: "provides_banner_patterns", 64: "recipes", 65: "lodestone_tracker", 66: "firework_explosion", 67: "fireworks", 68: "profile", 69: "note_block_sound", 7: "minimum_attack_charge", 70: "banner_patterns", 71: "base_color", 72: "pot_decorations", 73: "container", 74: "block_state", 75: "bees", 76: "lock", 77: "container_loot", 78: "break_sound", 79: "villager/variant", 8: "damage_type", 80: "wolf/variant", 81: "wolf/sound_variant", 82: "wolf/collar", 83: "fox/variant", 84: "salmon/size", 85: "parrot/variant", 86: "tropical_fish/pattern", 87: "tropical_fish/base_color", 88: "tropical_fish/pattern_color", 89: "mooshroom/variant", 9: "item_name", 90: "rabbit/variant", 91: "pig/variant", 92: "cow/variant", 93: "chicken/variant", 94: "zomie_nautilus/variant", 95: "frog/variant", 96: "horse/variant", 97: "painting/variant", 98: "llama/variant", 99: "axolotl/variant"}
|
||||
var SlotComponentTypeMap = map[int32]string{0: "custom_data", 1: "max_stack_size", 10: "item_model", 100: "cat/variant", 101: "cat/collar", 102: "sheep/color", 103: "shulker/color", 11: "lore", 12: "rarity", 13: "enchantments", 14: "can_place_on", 15: "can_break", 16: "attribute_modifiers", 17: "custom_model_data", 18: "tooltip_display", 19: "repair_cost", 2: "max_damage", 20: "creative_slot_lock", 21: "enchantment_glint_override", 22: "intangible_projectile", 23: "food", 24: "consumable", 25: "use_remainder", 26: "use_cooldown", 27: "damage_resistant", 28: "tool", 29: "weapon", 3: "damage", 30: "attack_range", 31: "enchantable", 32: "equippable", 33: "repairable", 34: "glider", 35: "tooltip_style", 36: "death_protection", 37: "blocks_attacks", 38: "piercing_weapon", 39: "kinetic_weapon", 4: "unbreakable", 40: "swing_animation", 41: "stored_enchantments", 42: "dyed_color", 43: "map_color", 44: "map_id", 45: "map_decorations", 46: "map_post_processing", 47: "charged_projectiles", 48: "bundle_contents", 49: "potion_contents", 5: "use_effects", 50: "potion_duration_scale", 51: "suspicious_stew_effects", 52: "writable_book_content", 53: "written_book_content", 54: "trim", 55: "debug_stick_state", 56: "entity_data", 57: "bucket_entity_data", 58: "block_entity_data", 59: "instrument", 6: "custom_name", 60: "provides_trim_material", 61: "ominous_bottle_amplifier", 62: "jukebox_playable", 63: "provides_banner_patterns", 64: "recipes", 65: "lodestone_tracker", 66: "firework_explosion", 67: "fireworks", 68: "profile", 69: "note_block_sound", 7: "minimum_attack_charge", 70: "banner_patterns", 71: "base_color", 72: "pot_decorations", 73: "container", 74: "block_state", 75: "bees", 76: "lock", 77: "container_loot", 78: "break_sound", 79: "villager/variant", 8: "damage_type", 80: "wolf/variant", 81: "wolf/sound_variant", 82: "wolf/collar", 83: "fox/variant", 84: "salmon/size", 85: "parrot/variant", 86: "tropical_fish/pattern", 87: "tropical_fish/base_color", 88: "tropical_fish/pattern_color", 89: "mooshroom/variant", 9: "item_name", 90: "rabbit/variant", 91: "pig/variant", 92: "cow/variant", 93: "chicken/variant", 94: "zombie_nautilus/variant", 95: "frog/variant", 96: "horse/variant", 97: "painting/variant", 98: "llama/variant", 99: "axolotl/variant"}
|
||||
|
||||
func (ret *SlotComponentType) Decode(r io.Reader) (err error) {
|
||||
var SlotComponentTypeKey int32
|
||||
@@ -3031,7 +3032,7 @@ func (ret *SlotComponentType) Decode(r io.Reader) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
var SlotComponentTypeReverseMap = map[string]int32{"custom_data": 0, "max_stack_size": 1, "item_model": 10, "cat/variant": 100, "cat/collar": 101, "sheep/color": 102, "shulker/color": 103, "lore": 11, "rarity": 12, "enchantments": 13, "can_place_on": 14, "can_break": 15, "attribute_modifiers": 16, "custom_model_data": 17, "tooltip_display": 18, "repair_cost": 19, "max_damage": 2, "creative_slot_lock": 20, "enchantment_glint_override": 21, "intangible_projectile": 22, "food": 23, "consumable": 24, "use_remainder": 25, "use_cooldown": 26, "damage_resistant": 27, "tool": 28, "weapon": 29, "damage": 3, "attack_range": 30, "enchantable": 31, "equippable": 32, "repairable": 33, "glider": 34, "tooltip_style": 35, "death_protection": 36, "blocks_attacks": 37, "piercing_weapon": 38, "kinetic_weapon": 39, "unbreakable": 4, "swing_animation": 40, "stored_enchantments": 41, "dyed_color": 42, "map_color": 43, "map_id": 44, "map_decorations": 45, "map_post_processing": 46, "charged_projectiles": 47, "bundle_contents": 48, "potion_contents": 49, "use_effects": 5, "potion_duration_scale": 50, "suspicious_stew_effects": 51, "writable_book_content": 52, "written_book_content": 53, "trim": 54, "debug_stick_state": 55, "entity_data": 56, "bucket_entity_data": 57, "block_entity_data": 58, "instrument": 59, "custom_name": 6, "provides_trim_material": 60, "ominous_bottle_amplifier": 61, "jukebox_playable": 62, "provides_banner_patterns": 63, "recipes": 64, "lodestone_tracker": 65, "firework_explosion": 66, "fireworks": 67, "profile": 68, "note_block_sound": 69, "minimum_attack_charge": 7, "banner_patterns": 70, "base_color": 71, "pot_decorations": 72, "container": 73, "block_state": 74, "bees": 75, "lock": 76, "container_loot": 77, "break_sound": 78, "villager/variant": 79, "damage_type": 8, "wolf/variant": 80, "wolf/sound_variant": 81, "wolf/collar": 82, "fox/variant": 83, "salmon/size": 84, "parrot/variant": 85, "tropical_fish/pattern": 86, "tropical_fish/base_color": 87, "tropical_fish/pattern_color": 88, "mooshroom/variant": 89, "item_name": 9, "rabbit/variant": 90, "pig/variant": 91, "cow/variant": 92, "chicken/variant": 93, "zomie_nautilus/variant": 94, "frog/variant": 95, "horse/variant": 96, "painting/variant": 97, "llama/variant": 98, "axolotl/variant": 99}
|
||||
var SlotComponentTypeReverseMap = map[string]int32{"custom_data": 0, "max_stack_size": 1, "item_model": 10, "cat/variant": 100, "cat/collar": 101, "sheep/color": 102, "shulker/color": 103, "lore": 11, "rarity": 12, "enchantments": 13, "can_place_on": 14, "can_break": 15, "attribute_modifiers": 16, "custom_model_data": 17, "tooltip_display": 18, "repair_cost": 19, "max_damage": 2, "creative_slot_lock": 20, "enchantment_glint_override": 21, "intangible_projectile": 22, "food": 23, "consumable": 24, "use_remainder": 25, "use_cooldown": 26, "damage_resistant": 27, "tool": 28, "weapon": 29, "damage": 3, "attack_range": 30, "enchantable": 31, "equippable": 32, "repairable": 33, "glider": 34, "tooltip_style": 35, "death_protection": 36, "blocks_attacks": 37, "piercing_weapon": 38, "kinetic_weapon": 39, "unbreakable": 4, "swing_animation": 40, "stored_enchantments": 41, "dyed_color": 42, "map_color": 43, "map_id": 44, "map_decorations": 45, "map_post_processing": 46, "charged_projectiles": 47, "bundle_contents": 48, "potion_contents": 49, "use_effects": 5, "potion_duration_scale": 50, "suspicious_stew_effects": 51, "writable_book_content": 52, "written_book_content": 53, "trim": 54, "debug_stick_state": 55, "entity_data": 56, "bucket_entity_data": 57, "block_entity_data": 58, "instrument": 59, "custom_name": 6, "provides_trim_material": 60, "ominous_bottle_amplifier": 61, "jukebox_playable": 62, "provides_banner_patterns": 63, "recipes": 64, "lodestone_tracker": 65, "firework_explosion": 66, "fireworks": 67, "profile": 68, "note_block_sound": 69, "minimum_attack_charge": 7, "banner_patterns": 70, "base_color": 71, "pot_decorations": 72, "container": 73, "block_state": 74, "bees": 75, "lock": 76, "container_loot": 77, "break_sound": 78, "villager/variant": 79, "damage_type": 8, "wolf/variant": 80, "wolf/sound_variant": 81, "wolf/collar": 82, "fox/variant": 83, "salmon/size": 84, "parrot/variant": 85, "tropical_fish/pattern": 86, "tropical_fish/base_color": 87, "tropical_fish/pattern_color": 88, "mooshroom/variant": 89, "item_name": 9, "rabbit/variant": 90, "pig/variant": 91, "cow/variant": 92, "chicken/variant": 93, "zombie_nautilus/variant": 94, "frog/variant": 95, "horse/variant": 96, "painting/variant": 97, "llama/variant": 98, "axolotl/variant": 99}
|
||||
|
||||
func (ret *SlotComponentType) Encode(w io.Writer) (err error) {
|
||||
var vSlotComponentType int32
|
||||
@@ -3497,15 +3498,44 @@ func (ret *CommandNode) Encode(w io.Writer) (err error) {
|
||||
}
|
||||
|
||||
type EntityMetadata struct {
|
||||
Val proto_base.ToDo
|
||||
Val map[byte]EntityMetadataEntry
|
||||
}
|
||||
|
||||
func (ret *EntityMetadata) Decode(r io.Reader) (err error) {
|
||||
err = proto_base.ToDoError
|
||||
ret.Val = make(map[uint8]EntityMetadataEntry)
|
||||
var id uint8
|
||||
for {
|
||||
err = binary.Read(r, binary.BigEndian, &id)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if id == 255 {
|
||||
break
|
||||
}
|
||||
var entry EntityMetadataEntry
|
||||
err = entry.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ret.Val[id] = entry
|
||||
}
|
||||
return
|
||||
}
|
||||
func (ret *EntityMetadata) Encode(w io.Writer) (err error) {
|
||||
err = proto_base.ToDoError
|
||||
for k, v := range ret.Val {
|
||||
err = binary.Write(w, binary.BigEndian, k)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = v.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, uint8(255))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1951,7 +1951,7 @@ type SlotComponentType struct {
|
||||
Val string
|
||||
}
|
||||
|
||||
var SlotComponentTypeMap = map[int32]string{0: "custom_data", 1: "max_stack_size", 10: "enchantments", 11: "can_place_on", 12: "can_break", 13: "attribute_modifiers", 14: "custom_model_data", 15: "tooltip_display", 16: "repair_cost", 17: "creative_slot_lock", 18: "enchantment_glint_override", 19: "intangible_projectile", 2: "max_damage", 20: "food", 21: "consumable", 22: "use_remainder", 23: "use_cooldown", 24: "damage_resistant", 25: "tool", 26: "weapon", 27: "enchantable", 28: "equippable", 29: "repairable", 3: "damage", 30: "glider", 31: "tooltip_style", 32: "death_protection", 33: "blocks_attacks", 34: "stored_enchantments", 35: "dyed_color", 36: "map_color", 37: "map_id", 38: "map_decorations", 39: "map_post_processing", 4: "unbreakable", 40: "potion_duration_scale", 41: "charged_projectiles", 42: "bundle_contents", 43: "potion_contents", 44: "suspicious_stew_effects", 45: "writable_book_content", 46: "written_book_content", 47: "trim", 48: "debug_stick_state", 49: "entity_data", 5: "custom_name", 50: "bucket_entity_data", 51: "block_entity_data", 52: "instrument", 53: "provides_trim_material", 54: "ominous_bottle_amplifier", 55: "jukebox_playable", 56: "provides_banner_patterns", 57: "recipes", 58: "lodestone_tracker", 59: "firework_explosion", 6: "item_name", 60: "fireworks", 61: "profile", 62: "note_block_sound", 63: "banner_patterns", 64: "base_color", 65: "pot_decorations", 66: "container", 67: "block_state", 68: "bees", 69: "lock", 7: "item_model", 70: "container_loot", 71: "break_sound", 72: "villager/variant", 73: "wolf/variant", 74: "wolf/sound_variant", 75: "wolf/collar", 76: "fox/variant", 77: "salmon/size", 78: "parrot/variant", 79: "tropical_fish/pattern", 8: "lore", 80: "tropical_fish/base_color", 81: "tropical_fish/pattern_color", 82: "mooshroom/variant", 83: "rabbit/variant", 84: "pig/variant", 85: "cow/variant", 86: "chicken/variant", 87: "frog/variant", 88: "horse/variant", 89: "painting/variant", 9: "rarity", 90: "llama/variant", 91: "axolotl/variant", 92: "cat/variant", 93: "cat/collar", 94: "sheep/color", 95: "shulker/color"}
|
||||
var SlotComponentTypeMap = map[int32]string{0: "custom_data", 1: "max_stack_size", 10: "enchantments", 11: "can_place_on", 12: "can_break", 13: "attribute_modifiers", 14: "custom_model_data", 15: "tooltip_display", 16: "repair_cost", 17: "creative_slot_lock", 18: "enchantment_glint_override", 19: "intangible_projectile", 2: "max_damage", 20: "food", 21: "consumable", 22: "use_remainder", 23: "use_cooldown", 24: "damage_resistant", 25: "tool", 26: "weapon", 27: "enchantable", 28: "equippable", 29: "repairable", 3: "damage", 30: "glider", 31: "tooltip_style", 32: "death_protection", 33: "blocks_attacks", 34: "stored_enchantments", 35: "dyed_color", 36: "map_color", 37: "map_id", 38: "map_decorations", 39: "map_post_processing", 4: "unbreakable", 40: "charged_projectiles", 41: "bundle_contents", 42: "potion_contents", 43: "potion_duration_scale", 44: "suspicious_stew_effects", 45: "writable_book_content", 46: "written_book_content", 47: "trim", 48: "debug_stick_state", 49: "entity_data", 5: "custom_name", 50: "bucket_entity_data", 51: "block_entity_data", 52: "instrument", 53: "provides_trim_material", 54: "ominous_bottle_amplifier", 55: "jukebox_playable", 56: "provides_banner_patterns", 57: "recipes", 58: "lodestone_tracker", 59: "firework_explosion", 6: "item_name", 60: "fireworks", 61: "profile", 62: "note_block_sound", 63: "banner_patterns", 64: "base_color", 65: "pot_decorations", 66: "container", 67: "block_state", 68: "bees", 69: "lock", 7: "item_model", 70: "container_loot", 71: "break_sound", 72: "villager/variant", 73: "wolf/variant", 74: "wolf/sound_variant", 75: "wolf/collar", 76: "fox/variant", 77: "salmon/size", 78: "parrot/variant", 79: "tropical_fish/pattern", 8: "lore", 80: "tropical_fish/base_color", 81: "tropical_fish/pattern_color", 82: "mooshroom/variant", 83: "rabbit/variant", 84: "pig/variant", 85: "cow/variant", 86: "chicken/variant", 87: "frog/variant", 88: "horse/variant", 89: "painting/variant", 9: "rarity", 90: "llama/variant", 91: "axolotl/variant", 92: "cat/variant", 93: "cat/collar", 94: "sheep/color", 95: "shulker/color"}
|
||||
|
||||
func (ret *SlotComponentType) Decode(r io.Reader) (err error) {
|
||||
var SlotComponentTypeKey int32
|
||||
@@ -1966,7 +1966,7 @@ func (ret *SlotComponentType) Decode(r io.Reader) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
var SlotComponentTypeReverseMap = map[string]int32{"custom_data": 0, "max_stack_size": 1, "enchantments": 10, "can_place_on": 11, "can_break": 12, "attribute_modifiers": 13, "custom_model_data": 14, "tooltip_display": 15, "repair_cost": 16, "creative_slot_lock": 17, "enchantment_glint_override": 18, "intangible_projectile": 19, "max_damage": 2, "food": 20, "consumable": 21, "use_remainder": 22, "use_cooldown": 23, "damage_resistant": 24, "tool": 25, "weapon": 26, "enchantable": 27, "equippable": 28, "repairable": 29, "damage": 3, "glider": 30, "tooltip_style": 31, "death_protection": 32, "blocks_attacks": 33, "stored_enchantments": 34, "dyed_color": 35, "map_color": 36, "map_id": 37, "map_decorations": 38, "map_post_processing": 39, "unbreakable": 4, "potion_duration_scale": 40, "charged_projectiles": 41, "bundle_contents": 42, "potion_contents": 43, "suspicious_stew_effects": 44, "writable_book_content": 45, "written_book_content": 46, "trim": 47, "debug_stick_state": 48, "entity_data": 49, "custom_name": 5, "bucket_entity_data": 50, "block_entity_data": 51, "instrument": 52, "provides_trim_material": 53, "ominous_bottle_amplifier": 54, "jukebox_playable": 55, "provides_banner_patterns": 56, "recipes": 57, "lodestone_tracker": 58, "firework_explosion": 59, "item_name": 6, "fireworks": 60, "profile": 61, "note_block_sound": 62, "banner_patterns": 63, "base_color": 64, "pot_decorations": 65, "container": 66, "block_state": 67, "bees": 68, "lock": 69, "item_model": 7, "container_loot": 70, "break_sound": 71, "villager/variant": 72, "wolf/variant": 73, "wolf/sound_variant": 74, "wolf/collar": 75, "fox/variant": 76, "salmon/size": 77, "parrot/variant": 78, "tropical_fish/pattern": 79, "lore": 8, "tropical_fish/base_color": 80, "tropical_fish/pattern_color": 81, "mooshroom/variant": 82, "rabbit/variant": 83, "pig/variant": 84, "cow/variant": 85, "chicken/variant": 86, "frog/variant": 87, "horse/variant": 88, "painting/variant": 89, "rarity": 9, "llama/variant": 90, "axolotl/variant": 91, "cat/variant": 92, "cat/collar": 93, "sheep/color": 94, "shulker/color": 95}
|
||||
var SlotComponentTypeReverseMap = map[string]int32{"custom_data": 0, "max_stack_size": 1, "enchantments": 10, "can_place_on": 11, "can_break": 12, "attribute_modifiers": 13, "custom_model_data": 14, "tooltip_display": 15, "repair_cost": 16, "creative_slot_lock": 17, "enchantment_glint_override": 18, "intangible_projectile": 19, "max_damage": 2, "food": 20, "consumable": 21, "use_remainder": 22, "use_cooldown": 23, "damage_resistant": 24, "tool": 25, "weapon": 26, "enchantable": 27, "equippable": 28, "repairable": 29, "damage": 3, "glider": 30, "tooltip_style": 31, "death_protection": 32, "blocks_attacks": 33, "stored_enchantments": 34, "dyed_color": 35, "map_color": 36, "map_id": 37, "map_decorations": 38, "map_post_processing": 39, "unbreakable": 4, "charged_projectiles": 40, "bundle_contents": 41, "potion_contents": 42, "potion_duration_scale": 43, "suspicious_stew_effects": 44, "writable_book_content": 45, "written_book_content": 46, "trim": 47, "debug_stick_state": 48, "entity_data": 49, "custom_name": 5, "bucket_entity_data": 50, "block_entity_data": 51, "instrument": 52, "provides_trim_material": 53, "ominous_bottle_amplifier": 54, "jukebox_playable": 55, "provides_banner_patterns": 56, "recipes": 57, "lodestone_tracker": 58, "firework_explosion": 59, "item_name": 6, "fireworks": 60, "profile": 61, "note_block_sound": 62, "banner_patterns": 63, "base_color": 64, "pot_decorations": 65, "container": 66, "block_state": 67, "bees": 68, "lock": 69, "item_model": 7, "container_loot": 70, "break_sound": 71, "villager/variant": 72, "wolf/variant": 73, "wolf/sound_variant": 74, "wolf/collar": 75, "fox/variant": 76, "salmon/size": 77, "parrot/variant": 78, "tropical_fish/pattern": 79, "lore": 8, "tropical_fish/base_color": 80, "tropical_fish/pattern_color": 81, "mooshroom/variant": 82, "rabbit/variant": 83, "pig/variant": 84, "cow/variant": 85, "chicken/variant": 86, "frog/variant": 87, "horse/variant": 88, "painting/variant": 89, "rarity": 9, "llama/variant": 90, "axolotl/variant": 91, "cat/variant": 92, "cat/collar": 93, "sheep/color": 94, "shulker/color": 95}
|
||||
|
||||
func (ret *SlotComponentType) Encode(w io.Writer) (err error) {
|
||||
var vSlotComponentType int32
|
||||
@@ -2432,15 +2432,44 @@ func (ret *CommandNode) Encode(w io.Writer) (err error) {
|
||||
}
|
||||
|
||||
type EntityMetadata struct {
|
||||
Val proto_base.ToDo
|
||||
Val map[byte]EntityMetadataEntry
|
||||
}
|
||||
|
||||
func (ret *EntityMetadata) Decode(r io.Reader) (err error) {
|
||||
err = proto_base.ToDoError
|
||||
ret.Val = make(map[uint8]EntityMetadataEntry)
|
||||
var id uint8
|
||||
for {
|
||||
err = binary.Read(r, binary.BigEndian, &id)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if id == 255 {
|
||||
break
|
||||
}
|
||||
var entry EntityMetadataEntry
|
||||
err = entry.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ret.Val[id] = entry
|
||||
}
|
||||
return
|
||||
}
|
||||
func (ret *EntityMetadata) Encode(w io.Writer) (err error) {
|
||||
err = proto_base.ToDoError
|
||||
for k, v := range ret.Val {
|
||||
err = binary.Write(w, binary.BigEndian, k)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = v.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, uint8(255))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3786,6 +3815,43 @@ func (ret *Vec3i) Encode(w io.Writer) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type Vec3i16 struct {
|
||||
X int16
|
||||
Y int16
|
||||
Z int16
|
||||
}
|
||||
|
||||
func (ret *Vec3i16) Decode(r io.Reader) (err error) {
|
||||
err = binary.Read(r, binary.BigEndian, &ret.X)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.Y)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.Z)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
func (ret *Vec3i16) Encode(w io.Writer) (err error) {
|
||||
err = binary.Write(w, binary.BigEndian, ret.X)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.Y)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.Z)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type Vec4f struct {
|
||||
X float32
|
||||
Y float32
|
||||
@@ -15114,10 +15180,8 @@ func (ret *PlayToClientPacketEntityUpdateAttributes) Encode(w io.Writer) (err er
|
||||
}
|
||||
|
||||
type PlayToClientPacketEntityVelocity struct {
|
||||
EntityId int32
|
||||
VelocityX int16
|
||||
VelocityY int16
|
||||
VelocityZ int16
|
||||
EntityId int32
|
||||
Velocity Vec3i16
|
||||
}
|
||||
|
||||
func (ret *PlayToClientPacketEntityVelocity) Decode(r io.Reader) (err error) {
|
||||
@@ -15125,15 +15189,7 @@ func (ret *PlayToClientPacketEntityVelocity) Decode(r io.Reader) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.VelocityX)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.VelocityY)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.VelocityZ)
|
||||
err = ret.Velocity.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -15144,15 +15200,7 @@ func (ret *PlayToClientPacketEntityVelocity) Encode(w io.Writer) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.VelocityX)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.VelocityY)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.VelocityZ)
|
||||
err = ret.Velocity.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -18871,9 +18919,7 @@ type PlayToClientPacketSpawnEntity struct {
|
||||
Yaw int8
|
||||
HeadPitch int8
|
||||
ObjectData int32
|
||||
VelocityX int16
|
||||
VelocityY int16
|
||||
VelocityZ int16
|
||||
Velocity Vec3i16
|
||||
}
|
||||
|
||||
func (ret *PlayToClientPacketSpawnEntity) Decode(r io.Reader) (err error) {
|
||||
@@ -18917,15 +18963,7 @@ func (ret *PlayToClientPacketSpawnEntity) Decode(r io.Reader) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.VelocityX)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.VelocityY)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Read(r, binary.BigEndian, &ret.VelocityZ)
|
||||
err = ret.Velocity.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -18972,15 +19010,7 @@ func (ret *PlayToClientPacketSpawnEntity) Encode(w io.Writer) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.VelocityX)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.VelocityY)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, ret.VelocityZ)
|
||||
err = ret.Velocity.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2885,7 +2885,7 @@ type SlotComponentType struct {
|
||||
Val string
|
||||
}
|
||||
|
||||
var SlotComponentTypeMap = map[int32]string{0: "custom_data", 1: "max_stack_size", 10: "enchantments", 11: "can_place_on", 12: "can_break", 13: "attribute_modifiers", 14: "custom_model_data", 15: "tooltip_display", 16: "repair_cost", 17: "creative_slot_lock", 18: "enchantment_glint_override", 19: "intangible_projectile", 2: "max_damage", 20: "food", 21: "consumable", 22: "use_remainder", 23: "use_cooldown", 24: "damage_resistant", 25: "tool", 26: "weapon", 27: "enchantable", 28: "equippable", 29: "repairable", 3: "damage", 30: "glider", 31: "tooltip_style", 32: "death_protection", 33: "blocks_attacks", 34: "stored_enchantments", 35: "dyed_color", 36: "map_color", 37: "map_id", 38: "map_decorations", 39: "map_post_processing", 4: "unbreakable", 40: "potion_duration_scale", 41: "charged_projectiles", 42: "bundle_contents", 43: "potion_contents", 44: "suspicious_stew_effects", 45: "writable_book_content", 46: "written_book_content", 47: "trim", 48: "debug_stick_state", 49: "entity_data", 5: "custom_name", 50: "bucket_entity_data", 51: "block_entity_data", 52: "instrument", 53: "provides_trim_material", 54: "ominous_bottle_amplifier", 55: "jukebox_playable", 56: "provides_banner_patterns", 57: "recipes", 58: "lodestone_tracker", 59: "firework_explosion", 6: "item_name", 60: "fireworks", 61: "profile", 62: "note_block_sound", 63: "banner_patterns", 64: "base_color", 65: "pot_decorations", 66: "container", 67: "block_state", 68: "bees", 69: "lock", 7: "item_model", 70: "container_loot", 71: "break_sound", 72: "villager/variant", 73: "wolf/variant", 74: "wolf/sound_variant", 75: "wolf/collar", 76: "fox/variant", 77: "salmon/size", 78: "parrot/variant", 79: "tropical_fish/pattern", 8: "lore", 80: "tropical_fish/base_color", 81: "tropical_fish/pattern_color", 82: "mooshroom/variant", 83: "rabbit/variant", 84: "pig/variant", 85: "cow/variant", 86: "chicken/variant", 87: "frog/variant", 88: "horse/variant", 89: "painting/variant", 9: "rarity", 90: "llama/variant", 91: "axolotl/variant", 92: "cat/variant", 93: "cat/collar", 94: "sheep/color", 95: "shulker/color"}
|
||||
var SlotComponentTypeMap = map[int32]string{0: "custom_data", 1: "max_stack_size", 10: "enchantments", 11: "can_place_on", 12: "can_break", 13: "attribute_modifiers", 14: "custom_model_data", 15: "tooltip_display", 16: "repair_cost", 17: "creative_slot_lock", 18: "enchantment_glint_override", 19: "intangible_projectile", 2: "max_damage", 20: "food", 21: "consumable", 22: "use_remainder", 23: "use_cooldown", 24: "damage_resistant", 25: "tool", 26: "weapon", 27: "enchantable", 28: "equippable", 29: "repairable", 3: "damage", 30: "glider", 31: "tooltip_style", 32: "death_protection", 33: "blocks_attacks", 34: "stored_enchantments", 35: "dyed_color", 36: "map_color", 37: "map_id", 38: "map_decorations", 39: "map_post_processing", 4: "unbreakable", 40: "charged_projectiles", 41: "bundle_contents", 42: "potion_contents", 43: "potion_duration_scale", 44: "suspicious_stew_effects", 45: "writable_book_content", 46: "written_book_content", 47: "trim", 48: "debug_stick_state", 49: "entity_data", 5: "custom_name", 50: "bucket_entity_data", 51: "block_entity_data", 52: "instrument", 53: "provides_trim_material", 54: "ominous_bottle_amplifier", 55: "jukebox_playable", 56: "provides_banner_patterns", 57: "recipes", 58: "lodestone_tracker", 59: "firework_explosion", 6: "item_name", 60: "fireworks", 61: "profile", 62: "note_block_sound", 63: "banner_patterns", 64: "base_color", 65: "pot_decorations", 66: "container", 67: "block_state", 68: "bees", 69: "lock", 7: "item_model", 70: "container_loot", 71: "break_sound", 72: "villager/variant", 73: "wolf/variant", 74: "wolf/sound_variant", 75: "wolf/collar", 76: "fox/variant", 77: "salmon/size", 78: "parrot/variant", 79: "tropical_fish/pattern", 8: "lore", 80: "tropical_fish/base_color", 81: "tropical_fish/pattern_color", 82: "mooshroom/variant", 83: "rabbit/variant", 84: "pig/variant", 85: "cow/variant", 86: "chicken/variant", 87: "frog/variant", 88: "horse/variant", 89: "painting/variant", 9: "rarity", 90: "llama/variant", 91: "axolotl/variant", 92: "cat/variant", 93: "cat/collar", 94: "sheep/color", 95: "shulker/color"}
|
||||
|
||||
func (ret *SlotComponentType) Decode(r io.Reader) (err error) {
|
||||
var SlotComponentTypeKey int32
|
||||
@@ -2900,7 +2900,7 @@ func (ret *SlotComponentType) Decode(r io.Reader) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
var SlotComponentTypeReverseMap = map[string]int32{"custom_data": 0, "max_stack_size": 1, "enchantments": 10, "can_place_on": 11, "can_break": 12, "attribute_modifiers": 13, "custom_model_data": 14, "tooltip_display": 15, "repair_cost": 16, "creative_slot_lock": 17, "enchantment_glint_override": 18, "intangible_projectile": 19, "max_damage": 2, "food": 20, "consumable": 21, "use_remainder": 22, "use_cooldown": 23, "damage_resistant": 24, "tool": 25, "weapon": 26, "enchantable": 27, "equippable": 28, "repairable": 29, "damage": 3, "glider": 30, "tooltip_style": 31, "death_protection": 32, "blocks_attacks": 33, "stored_enchantments": 34, "dyed_color": 35, "map_color": 36, "map_id": 37, "map_decorations": 38, "map_post_processing": 39, "unbreakable": 4, "potion_duration_scale": 40, "charged_projectiles": 41, "bundle_contents": 42, "potion_contents": 43, "suspicious_stew_effects": 44, "writable_book_content": 45, "written_book_content": 46, "trim": 47, "debug_stick_state": 48, "entity_data": 49, "custom_name": 5, "bucket_entity_data": 50, "block_entity_data": 51, "instrument": 52, "provides_trim_material": 53, "ominous_bottle_amplifier": 54, "jukebox_playable": 55, "provides_banner_patterns": 56, "recipes": 57, "lodestone_tracker": 58, "firework_explosion": 59, "item_name": 6, "fireworks": 60, "profile": 61, "note_block_sound": 62, "banner_patterns": 63, "base_color": 64, "pot_decorations": 65, "container": 66, "block_state": 67, "bees": 68, "lock": 69, "item_model": 7, "container_loot": 70, "break_sound": 71, "villager/variant": 72, "wolf/variant": 73, "wolf/sound_variant": 74, "wolf/collar": 75, "fox/variant": 76, "salmon/size": 77, "parrot/variant": 78, "tropical_fish/pattern": 79, "lore": 8, "tropical_fish/base_color": 80, "tropical_fish/pattern_color": 81, "mooshroom/variant": 82, "rabbit/variant": 83, "pig/variant": 84, "cow/variant": 85, "chicken/variant": 86, "frog/variant": 87, "horse/variant": 88, "painting/variant": 89, "rarity": 9, "llama/variant": 90, "axolotl/variant": 91, "cat/variant": 92, "cat/collar": 93, "sheep/color": 94, "shulker/color": 95}
|
||||
var SlotComponentTypeReverseMap = map[string]int32{"custom_data": 0, "max_stack_size": 1, "enchantments": 10, "can_place_on": 11, "can_break": 12, "attribute_modifiers": 13, "custom_model_data": 14, "tooltip_display": 15, "repair_cost": 16, "creative_slot_lock": 17, "enchantment_glint_override": 18, "intangible_projectile": 19, "max_damage": 2, "food": 20, "consumable": 21, "use_remainder": 22, "use_cooldown": 23, "damage_resistant": 24, "tool": 25, "weapon": 26, "enchantable": 27, "equippable": 28, "repairable": 29, "damage": 3, "glider": 30, "tooltip_style": 31, "death_protection": 32, "blocks_attacks": 33, "stored_enchantments": 34, "dyed_color": 35, "map_color": 36, "map_id": 37, "map_decorations": 38, "map_post_processing": 39, "unbreakable": 4, "charged_projectiles": 40, "bundle_contents": 41, "potion_contents": 42, "potion_duration_scale": 43, "suspicious_stew_effects": 44, "writable_book_content": 45, "written_book_content": 46, "trim": 47, "debug_stick_state": 48, "entity_data": 49, "custom_name": 5, "bucket_entity_data": 50, "block_entity_data": 51, "instrument": 52, "provides_trim_material": 53, "ominous_bottle_amplifier": 54, "jukebox_playable": 55, "provides_banner_patterns": 56, "recipes": 57, "lodestone_tracker": 58, "firework_explosion": 59, "item_name": 6, "fireworks": 60, "profile": 61, "note_block_sound": 62, "banner_patterns": 63, "base_color": 64, "pot_decorations": 65, "container": 66, "block_state": 67, "bees": 68, "lock": 69, "item_model": 7, "container_loot": 70, "break_sound": 71, "villager/variant": 72, "wolf/variant": 73, "wolf/sound_variant": 74, "wolf/collar": 75, "fox/variant": 76, "salmon/size": 77, "parrot/variant": 78, "tropical_fish/pattern": 79, "lore": 8, "tropical_fish/base_color": 80, "tropical_fish/pattern_color": 81, "mooshroom/variant": 82, "rabbit/variant": 83, "pig/variant": 84, "cow/variant": 85, "chicken/variant": 86, "frog/variant": 87, "horse/variant": 88, "painting/variant": 89, "rarity": 9, "llama/variant": 90, "axolotl/variant": 91, "cat/variant": 92, "cat/collar": 93, "sheep/color": 94, "shulker/color": 95}
|
||||
|
||||
func (ret *SlotComponentType) Encode(w io.Writer) (err error) {
|
||||
var vSlotComponentType int32
|
||||
@@ -3366,15 +3366,44 @@ func (ret *CommandNode) Encode(w io.Writer) (err error) {
|
||||
}
|
||||
|
||||
type EntityMetadata struct {
|
||||
Val proto_base.ToDo
|
||||
Val map[byte]EntityMetadataEntry
|
||||
}
|
||||
|
||||
func (ret *EntityMetadata) Decode(r io.Reader) (err error) {
|
||||
err = proto_base.ToDoError
|
||||
ret.Val = make(map[uint8]EntityMetadataEntry)
|
||||
var id uint8
|
||||
for {
|
||||
err = binary.Read(r, binary.BigEndian, &id)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if id == 255 {
|
||||
break
|
||||
}
|
||||
var entry EntityMetadataEntry
|
||||
err = entry.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ret.Val[id] = entry
|
||||
}
|
||||
return
|
||||
}
|
||||
func (ret *EntityMetadata) Encode(w io.Writer) (err error) {
|
||||
err = proto_base.ToDoError
|
||||
for k, v := range ret.Val {
|
||||
err = binary.Write(w, binary.BigEndian, k)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = v.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
err = binary.Write(w, binary.BigEndian, uint8(255))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user