protocol

package
v0.0.0-...-a5a0d7e Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Overworld = Dimension{
		ID:                 0,
		Name:               "minecraft:overworld",
		BedWorks:           true,
		HasCeiling:         false,
		CoordinateScale:    1,
		PiglinSafe:         false,
		HasSkylight:        true,
		Ultrawarm:          false,
		Infiniburn:         "minecraft:infiniburn_overworld",
		Effects:            "minecraft:overworld",
		HasRaids:           true,
		AmbientLight:       0,
		LogicalHeight:      256,
		Natural:            true,
		RespawnAnchorWorks: false,
		Shrunk:             true,
	}

	OverworldCaves = Dimension{
		ID:                 1,
		Name:               "minecraft:overworld_caves",
		BedWorks:           true,
		HasCeiling:         true,
		CoordinateScale:    1,
		PiglinSafe:         false,
		HasSkylight:        true,
		Ultrawarm:          false,
		Infiniburn:         "minecraft:infiniburn_overworld",
		Effects:            "minecraft:overworld",
		HasRaids:           true,
		AmbientLight:       0,
		LogicalHeight:      256,
		Natural:            true,
		RespawnAnchorWorks: false,
		Shrunk:             false,
	}

	TheNether = Dimension{
		ID:                 2,
		Name:               "minecraft:the_nether",
		BedWorks:           false,
		HasCeiling:         true,
		CoordinateScale:    8,
		PiglinSafe:         true,
		HasSkylight:        false,
		Ultrawarm:          true,
		Infiniburn:         "minecraft:infiniburn_nether",
		Effects:            "minecraft:the_nether",
		HasRaids:           false,
		AmbientLight:       0.1,
		LogicalHeight:      128,
		Natural:            false,
		RespawnAnchorWorks: true,
		FixedTime:          func(i int64) *int64 { return &i }(18000),
		Shrunk:             true,
	}

	TheEnd = Dimension{
		ID:                 3,
		Name:               "minecraft:the_end",
		BedWorks:           false,
		HasCeiling:         false,
		CoordinateScale:    1,
		PiglinSafe:         false,
		HasSkylight:        false,
		Ultrawarm:          false,
		Infiniburn:         "minecraft:infiniburn_end",
		Effects:            "minecraft:the_end",
		HasRaids:           true,
		AmbientLight:       0,
		LogicalHeight:      256,
		Natural:            false,
		RespawnAnchorWorks: false,
		FixedTime:          func(i int64) *int64 { return &i }(6000),
		Shrunk:             false,
	}

	DefaultDimensionCodec = DimensionCodec{
		Dimensions: []Dimension{Overworld, OverworldCaves, TheNether, TheEnd},
		Biomes: []Biome{{
			ID:            0,
			Name:          "minecraft:ocean",
			Category:      "ocean",
			Temperature:   0.5,
			Downfall:      0.5,
			Depth:         -1.0,
			Precipitation: "rain",
			Scale:         0.1,
			Effects: Effects{
				WaterFogColor: 329011,
				WaterColor:    4159204,
				FogColor:      12638463,
				SkyColor:      8103167,
				MoodSound: MoodSound{
					Offset:            2.0,
					Sound:             "minecraft:ambient.cave",
					BlockSearchExtent: 8,
					TickDelay:         6000,
				},
			},
		}, {
			ID:            1,
			Name:          "minecraft:plains",
			Category:      "plains",
			Temperature:   0.8,
			Downfall:      0.4,
			Depth:         0.125,
			Precipitation: "rain",
			Scale:         0.05,
			Effects: Effects{
				WaterFogColor: 329011,
				WaterColor:    4159204,
				FogColor:      12638463,
				SkyColor:      7907327,
				MoodSound: MoodSound{
					Offset:            2.0,
					Sound:             "minecraft:ambient.cave",
					BlockSearchExtent: 8,
					TickDelay:         6000,
				},
			},
		}, {
			ID:            127,
			Name:          "minecraft:the_void",
			Category:      "none",
			Temperature:   0.5,
			Downfall:      0.5,
			Depth:         0.1,
			Precipitation: "none",
			Scale:         0.2,
			Effects: Effects{
				WaterFogColor: 329011,
				WaterColor:    4159204,
				FogColor:      12638463,
				SkyColor:      8103167,
				MoodSound: MoodSound{
					Offset:            2.0,
					Sound:             "minecraft:ambient.cave",
					BlockSearchExtent: 8,
					TickDelay:         6000,
				},
			},
		}},
	}
)

Functions

func IsSupported

func IsSupported(protocol Protocol) bool

Types

type Biome

type Biome struct {
	ID            int32
	Name          string
	Category      string
	Temperature   float32
	Downfall      float32
	Depth         float32
	Precipitation string
	Scale         float32
	Effects       Effects
}

func BiomeFromTag

func BiomeFromTag(tag nbt.Tag) (Biome, error)

func (Biome) ToCompound

func (biome Biome) ToCompound() nbt.CompoundTag

type Dimension

type Dimension struct {
	ID                 int32
	Name               string
	BedWorks           bool
	HasCeiling         bool
	CoordinateScale    float64
	PiglinSafe         bool
	HasSkylight        bool
	Ultrawarm          bool
	Infiniburn         string
	Effects            string
	HasRaids           bool
	AmbientLight       float32
	LogicalHeight      int32
	Natural            bool
	RespawnAnchorWorks bool
	FixedTime          *int64
	Shrunk             bool
}

func DimensionFromTag

func DimensionFromTag(tag nbt.Tag) (Dimension, error)

func (Dimension) ToCompound

func (dim Dimension) ToCompound(proto Protocol) nbt.CompoundTag

type DimensionCodec

type DimensionCodec struct {
	Dimensions []Dimension
	Biomes     []Biome
}

func DimensionCodecFromTag

func DimensionCodecFromTag(tag nbt.Tag, proto Protocol) (DimensionCodec, error)

func (DimensionCodec) ToCompound

func (codec DimensionCodec) ToCompound(proto Protocol) nbt.CompoundTag

type Direction

type Direction int
const (
	ClientBound Direction = iota
	ServerBound
)

func (Direction) String

func (direction Direction) String() string

type Effects

type Effects struct {
	WaterFogColor int32
	WaterColor    int32
	FogColor      int32
	SkyColor      int32
	MoodSound     MoodSound
}

type MoodSound

type MoodSound struct {
	Offset            float64
	Sound             string
	BlockSearchExtent int32
	TickDelay         int32
}

type Packet

type Packet interface {
	GetID(proto Protocol) (int32, error)
	Read(proto Protocol, buffer *bytes.Buffer) error
	Write(proto Protocol, buffer *bytes.Buffer) error
}

type Protocol

type Protocol int32
const (
	Unknown Protocol = -1
	V1_8    Protocol = 47
	V1_9    Protocol = 107
	V1_9_1  Protocol = 108
	V1_9_2  Protocol = 109
	V1_9_3  Protocol = 110
	V1_10   Protocol = 210
	V1_11   Protocol = 315
	V1_11_1 Protocol = 316
	V1_12   Protocol = 335
	V1_12_1 Protocol = 338
	V1_12_2 Protocol = 340
	V1_13   Protocol = 393
	V1_13_1 Protocol = 401
	V1_13_2 Protocol = 404
	V1_14   Protocol = 477
	V1_14_1 Protocol = 480
	V1_14_2 Protocol = 485
	V1_14_3 Protocol = 490
	V1_14_4 Protocol = 498
	V1_15   Protocol = 573
	V1_15_1 Protocol = 575
	V1_15_2 Protocol = 578
	V1_16   Protocol = 735
	V1_16_1 Protocol = 736
	V1_16_2 Protocol = 751
	V1_16_3 Protocol = 753
	V1_16_4 Protocol = 754
)

type State

type State int
const (
	Handshaking State = iota
	Status
	Login
	Play
)

func (State) String

func (state State) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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