basic

package
v1.16.5-pre2.0...-5b980bd Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Jacket
	LeftSleeve
	RightSleeve
	LeftPantsLeg
	RightPantsLeg
	Hat
)

Used by Settings.DisplayedSkinParts. For each bits set if shows match part.

Variables

View Source
var DefaultSettings = Settings{
	Locale:             "zh_CN",
	ViewDistance:       15,
	ChatMode:           0,
	DisplayedSkinParts: Jacket | LeftSleeve | RightSleeve | LeftPantsLeg | RightPantsLeg | Hat,
	MainHand:           1,

	Brand: "vanilla",
}

DefaultSettings are the default settings of client

Functions

This section is empty.

Types

type Error

type Error struct {
	Err error
}

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type EventsListener

type EventsListener struct {
	GameStart    func() error
	ChatMsg      func(c chat.Message, pos byte, uuid uuid.UUID) error
	Disconnect   func(reason chat.Message) error
	HealthChange func(health float32) error
	Death        func() error
}

func (EventsListener) Attach

func (e EventsListener) Attach(c *bot.Client)

type Player

type Player struct {
	Settings Settings

	PlayerInfo
	WorldInfo
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(c *bot.Client, settings Settings) *Player

func (*Player) Respawn

func (p *Player) Respawn() error

type PlayerInfo

type PlayerInfo struct {
	EID          int32 // The player's Entity ID (EID).
	Hardcore     bool  // Is hardcore
	Gamemode     byte  // Gamemode. 0: Survival, 1: Creative, 2: Adventure, 3: Spectator.
	PrevGamemode int8  // Previous Gamemode
}

type ServInfo

type ServInfo struct {
	Brand string
}

ServInfo contains information about the server implementation.

type Settings

type Settings struct {
	Locale             string //地区
	ViewDistance       int    //视距
	ChatMode           int    //聊天模式
	ChatColors         bool   //聊天颜色
	DisplayedSkinParts uint8  //皮肤显示
	MainHand           int    //主手

	Brand string // The brand string presented to the server.
}

Settings of client

type WorldInfo

type WorldInfo struct {
	DimensionCodec struct {
		DimensionType interface{} `nbt:"minecraft:dimension_type"`
		WorldgenBiome interface{} `nbt:"minecraft:worldgen/biome"`
	}
	Dimension           interface{}
	WorldNames          []string // Identifiers for all worlds on the server.
	WorldName           string   // Name of the world being spawned into.
	HashedSeed          int64    // First 8 bytes of the SHA-256 hash of the world's seed. Used client side for biome noise
	MaxPlayers          int32    // Was once used by the client to draw the player list, but now is ignored.
	ViewDistance        int32    // Render distance (2-32).
	ReducedDebugInfo    bool     // If true, a Notchian client shows reduced information on the debug screen. For servers in development, this should almost always be false.
	EnableRespawnScreen bool     // Set to false when the doImmediateRespawn gamerule is true.
	IsDebug             bool     // True if the world is a debug mode world; debug mode worlds cannot be modified and have predefined blocks.
	IsFlat              bool     // True if the world is a superflat world; flat worlds have different void fog and a horizon at y=0 instead of y=63.
}

WorldInfo content player info in server.

Jump to

Keyboard shortcuts

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