nbt_parser_block

package
v0.0.0-...-b0cdd02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseNBTBlock

func ParseNBTBlock(blockName string, blockStates map[string]any, blockNBT map[string]any) (block nbt_parser_interface.Block, err error)

ParseNBTBlock 从方块实体数据 blockNBT 解析一个方块实体。 blockName 和 blockStates 分别指示这个方块实体的名称和方块状态

func SetShulkerBoxFacing

func SetShulkerBoxFacing(container nbt_parser_interface.Block, facing uint8)

SetShulkerBoxFacing 将 container 的潜影盒朝向设置为 facing。 SetShulkerBoxFacing 假定 container 可以被断言为 Container。 如果不是 Container,则 SetShulkerBoxFacing 将不执行任何操作

Types

type Banner struct {
	DefaultBlock
	NBT BannerNBT
}

旗帜

func (*Banner) FullStableBytes

func (b *Banner) FullStableBytes() []byte

func (Banner) NBTStableBytes

func (b Banner) NBTStableBytes() []byte

func (Banner) NeedCheckCompletely

func (b Banner) NeedCheckCompletely() bool

func (Banner) NeedSpecialHandle

func (b Banner) NeedSpecialHandle() bool

func (*Banner) Parse

func (b *Banner) Parse(nbtMap map[string]any) error

type BannerNBT

type BannerNBT struct {
	Base     int32
	Patterns []nbt_parser_general.BannerPattern
	Type     int32
}

BannerNBT ..

type BrewingStand

type BrewingStand struct {
	DefaultBlock
	NBT BrewingStandNBT
}

酿造台

func (*BrewingStand) FullStableBytes

func (b *BrewingStand) FullStableBytes() []byte

func (BrewingStand) NBTStableBytes

func (b BrewingStand) NBTStableBytes() []byte

func (BrewingStand) NeedCheckCompletely

func (BrewingStand) NeedCheckCompletely() bool

func (*BrewingStand) NeedSpecialHandle

func (b *BrewingStand) NeedSpecialHandle() bool

func (*BrewingStand) Parse

func (b *BrewingStand) Parse(nbtMap map[string]any) error

type BrewingStandNBT

type BrewingStandNBT struct {
	Items      []ItemWithSlot
	CustomName string
}

BrewingStandNBT ..

type CommandBlock

type CommandBlock struct {
	DefaultBlock
	NBT CommandBlockNBT
}

命令方块

func (*CommandBlock) FullStableBytes

func (c *CommandBlock) FullStableBytes() []byte

func (CommandBlock) NBTStableBytes

func (c CommandBlock) NBTStableBytes() []byte

func (CommandBlock) NeedCheckCompletely

func (c CommandBlock) NeedCheckCompletely() bool

func (*CommandBlock) NeedSpecialHandle

func (c *CommandBlock) NeedSpecialHandle() bool

func (*CommandBlock) Parse

func (c *CommandBlock) Parse(nbtMap map[string]any) error

type CommandBlockNBT

type CommandBlockNBT struct {
	Command            string `mapstructure:"Command"`
	CustomName         string `mapstructure:"CustomName"`
	TickDelay          int32  `mapstructure:"TickDelay"`
	ExecuteOnFirstTick byte   `mapstructure:"ExecuteOnFirstTick"`
	TrackOutput        byte   `mapstructure:"TrackOutput"`
	ConditionalMode    byte   `mapstructure:"conditionalMode"`
	Auto               byte   `mapstructure:"auto"`
	Version            int32  `mapstructure:"Version"`
}

CommandBlockNBT ..

type Container

type Container struct {
	DefaultBlock
	CustomName string
	NBT        ContainerNBT
}

容器

func (*Container) ConsiderOpenDirection

func (c *Container) ConsiderOpenDirection() bool

ConsiderOpenDirection 指示打开目标容器 是否需要考虑其打开方向上的障碍物方块, 这似乎只对箱子和潜影盒有效

func (*Container) FullStableBytes

func (c *Container) FullStableBytes() []byte

func (Container) NBTStableBytes

func (c Container) NBTStableBytes() []byte

func (Container) NeedCheckCompletely

func (c Container) NeedCheckCompletely() bool

func (*Container) NeedSpecialHandle

func (c *Container) NeedSpecialHandle() bool

func (*Container) Parse

func (c *Container) Parse(nbtMap map[string]any) error

func (*Container) SetBytes

func (c *Container) SetBytes() []byte

type ContainerNBT

type ContainerNBT struct {
	Items         []ItemWithSlot
	ShulkerFacing uint8
}

ContainerNBT ..

type DefaultBlock

type DefaultBlock struct {
	Name   string
	States map[string]any
}

默认 NBT 实体

func (*DefaultBlock) BlockName

func (d *DefaultBlock) BlockName() string

func (DefaultBlock) BlockStates

func (d DefaultBlock) BlockStates() map[string]any

func (DefaultBlock) BlockStatesString

func (d DefaultBlock) BlockStatesString() string

func (DefaultBlock) FullStableBytes

func (d DefaultBlock) FullStableBytes() []byte

func (DefaultBlock) NBTStableBytes

func (DefaultBlock) NBTStableBytes() []byte

func (DefaultBlock) NeedCheckCompletely

func (DefaultBlock) NeedCheckCompletely() bool

func (DefaultBlock) NeedSpecialHandle

func (DefaultBlock) NeedSpecialHandle() bool

func (*DefaultBlock) Parse

func (*DefaultBlock) Parse(nbtMap map[string]any) error

type Frame

type Frame struct {
	DefaultBlock
	NBT FrameNBT
}

物品展示框

func (*Frame) FullStableBytes

func (f *Frame) FullStableBytes() []byte

func (Frame) NBTStableBytes

func (f Frame) NBTStableBytes() []byte

func (Frame) NeedCheckCompletely

func (f Frame) NeedCheckCompletely() bool

func (Frame) NeedSpecialHandle

func (f Frame) NeedSpecialHandle() bool

func (*Frame) Parse

func (f *Frame) Parse(nbtMap map[string]any) error

type FrameNBT

type FrameNBT struct {
	ItemRotation float32
	HaveItem     bool
	Item         nbt_parser_interface.Item
}

FrameNBT ..

type ItemWithSlot

type ItemWithSlot struct {
	Item nbt_parser_interface.Item
	Slot uint8
}

ItemWithSlot ..

type JukeBox

type JukeBox struct {
	DefaultBlock
	NBT JukeBoxNBT
}

唱片机

func (*JukeBox) FullStableBytes

func (j *JukeBox) FullStableBytes() []byte

func (JukeBox) NBTStableBytes

func (j JukeBox) NBTStableBytes() []byte

func (JukeBox) NeedCheckCompletely

func (JukeBox) NeedCheckCompletely() bool

func (JukeBox) NeedSpecialHandle

func (j JukeBox) NeedSpecialHandle() bool

func (*JukeBox) Parse

func (j *JukeBox) Parse(nbtMap map[string]any) error

type JukeBoxNBT

type JukeBoxNBT struct {
	CustomName string
	HaveDisc   bool
	Disc       nbt_parser_interface.Item
}

JukeBoxNBT ..

type Lectern

type Lectern struct {
	DefaultBlock
	NBT LecternNBT
}

讲台

func (*Lectern) FullStableBytes

func (l *Lectern) FullStableBytes() []byte

func (Lectern) NBTStableBytes

func (l Lectern) NBTStableBytes() []byte

func (Lectern) NeedCheckCompletely

func (Lectern) NeedCheckCompletely() bool

func (Lectern) NeedSpecialHandle

func (l Lectern) NeedSpecialHandle() bool

func (*Lectern) Parse

func (l *Lectern) Parse(nbtMap map[string]any) error

type LecternNBT

type LecternNBT struct {
	CustomName string
	HaveBook   bool
	Book       nbt_parser_interface.Item
}

LecternNBT ..

type Sign

type Sign struct {
	DefaultBlock
	NBT SignNBT
}

告示牌

func (*Sign) FullStableBytes

func (s *Sign) FullStableBytes() []byte

func (Sign) NBTStableBytes

func (s Sign) NBTStableBytes() []byte

func (Sign) NeedCheckCompletely

func (s Sign) NeedCheckCompletely() bool

func (*Sign) NeedSpecialHandle

func (s *Sign) NeedSpecialHandle() bool

func (*Sign) Parse

func (s *Sign) Parse(nbtMap map[string]any) error

type SignNBT

type SignNBT struct {
	IsWaxed   byte     `mapstructure:"IsWaxed"`
	FrontText SignText `mapstructure:"FrontText"`
	BackText  SignText `mapstructure:"BackText"`
}

SignNBT ..

type SignText

type SignText struct {
	IgnoreLighting byte   `mapstructure:"IgnoreLighting"`
	SignTextColor  int32  `mapstructure:"SignTextColor"`
	Text           string `mapstructure:"Text"`
}

SignText ..

type StructureBlock

type StructureBlock struct {
	DefaultBlock
	NBT StructureBlockNBT
}

结构方块

func (*StructureBlock) FullStableBytes

func (s *StructureBlock) FullStableBytes() []byte

func (StructureBlock) NBTStableBytes

func (s StructureBlock) NBTStableBytes() []byte

func (StructureBlock) NeedCheckCompletely

func (s StructureBlock) NeedCheckCompletely() bool

func (StructureBlock) NeedSpecialHandle

func (s StructureBlock) NeedSpecialHandle() bool

func (*StructureBlock) Parse

func (s *StructureBlock) Parse(nbtMap map[string]any) error

type StructureBlockNBT

type StructureBlockNBT struct {
	AnimationMode    byte    `mapstructure:"animationMode"`
	AnimationSeconds float32 `mapstructure:"animationSeconds"`
	Data             int32   `mapstructure:"data"`
	DataField        string  `mapstructure:"dataField"`
	IgnoreEntities   byte    `mapstructure:"ignoreEntities"`
	IncludePlayers   byte    `mapstructure:"includePlayers"`
	Integrity        float32 `mapstructure:"integrity"`
	Mirror           byte    `mapstructure:"mirror"`
	RedstoneSaveMode int32   `mapstructure:"redstoneSaveMode"`
	RemoveBlocks     byte    `mapstructure:"removeBlocks"`
	Rotation         byte    `mapstructure:"rotation"`
	Seed             int64   `mapstructure:"seed"`
	ShowBoundingBox  byte    `mapstructure:"showBoundingBox"`
	StructureName    string  `mapstructure:"structureName"`
	XStructureOffset int32   `mapstructure:"xStructureOffset"`
	XStructureSize   int32   `mapstructure:"xStructureSize"`
	YStructureOffset int32   `mapstructure:"yStructureOffset"`
	YStructureSize   int32   `mapstructure:"xStructureSize"`
	ZStructureOffset int32   `mapstructure:"zStructureOffset"`
	ZStructureSize   int32   `mapstructure:"xStructureSize"`
}

StructureBlockNBT ..

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL