save

package
v1.16.2-0...-18405f0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Name       string
	Properties map[string]interface{}
}

type Chunk

type Chunk struct {
	Palette     []Block
	Y           byte
	BlockLight  []byte
	BlockStates []int64
	SkyLight    []byte
}

type Column

type Column struct {
	DataVersion int
	Level       struct {
		Heightmaps map[string][]int64
		Structures struct {
			References map[string][]int64
			Starts     map[string]struct {
				ID string `nbt:"id"`
			}
		}
		// Entities
		// LiquidTicks
		// PostProcessing
		Sections []Chunk
		// TileEntities
		// TileTicks
		InhabitedTime int64
		IsLightOn     byte `nbt:"isLightOn"`
		LastUpdate    int64
		Status        string
		PosX          int32 `nbt:"xPos"`
		PosY          int32 `nbt:"yPos"`
		Biomes        []int32
	}
}

Column is 16* chunk

func (*Column) Load

func (c *Column) Load(data []byte) (err error)

Load read column data from []byte

type Item

type Item struct {
	Count byte
	Slot  byte
	ID    string                 `nbt:"id"`
	Tag   map[string]interface{} `nbt:"tag"`
}

type Level

type Level struct {
	Data struct {
		DataVersion int32
		NBTVersion  int32 `nbt:"version"`
		Version     struct {
			ID       int32 `nbt:"Id"`
			Name     string
			Snapshot byte
		}
		GameType         int32
		Difficulty       byte
		DifficultyLocked byte
		HardCore         byte `nbt:"hardcore"`
		Initialized      byte `nbt:"initialized"`
		AllowCommands    byte `nbt:"allowCommands"`

		MapFeatures      byte
		LevelName        string
		GeneratorName    string `nbt:"generatorName"`
		GeneratorVersion int32  `nbt:"generatorVersion"`
		RandomSeed       int64

		SpawnX, SpawnY, SpawnZ int32

		BorderCenterX, BorderCenterZ float64
		BorderDamagePerBlock         float64
		BorderSafeZone               float64
		BorderSize                   float64
		BorderSizeLerpTarget         float64
		BorderSizeLerpTime           int64
		BorderWarningBlocks          float64
		BorderWarningTime            float64

		GameRules map[string]string
		DataPacks struct {
			Enabled, Disabled []string
		}
		DimensionData struct {
			TheEnd struct {
				DragonFight struct {
					Gateways         []int32
					DragonKilled     byte
					PreviouslyKilled byte
				}
			} `nbt:"1"`
		}

		Raining          byte  `nbt:"raining"`
		Thundering       byte  `nbt:"thundering"`
		RainTime         int32 `nbt:"rainTime"`
		ThunderTime      int32 `nbt:"thunderTime"`
		ClearWeatherTime int32 `nbt:"clearWeatherTime"`

		Time       int64
		DayTime    int64
		LastPlayed int64
	}
}

func ReadLevel

func ReadLevel(r io.Reader) (data Level, err error)

type PlayerData

type PlayerData struct {
	DataVersion int32

	Dimension    int32
	Pos          [3]float64
	Motion       [3]float64
	Rotation     [2]float32
	FallDistance float32
	FallFlying   byte
	OnGround     byte

	UUID                uuid.UUID `nbt:"-"`
	UUIDLeast, UUIDMost int64

	PlayerGameType  int32 `nbt:"playerGameType"`
	Air             int16
	DeathTime       int16
	Fire            int16
	HurtTime        int16
	Health          float32
	HurtByTimestamp int32
	PortalCooldown  int32

	Invulnerable     byte
	SeenCredits      byte `nbt:"seenCredits"`
	SelectedItemSlot int32
	Score            int32
	AbsorptionAmount float32

	Inventory, EnderItems []Item

	XpLevel int32
	XpP     float32
	XpTotal int32
	XpSeed  int32

	FoodExhaustionLevel float32 `nbt:"foodExhaustionLevel"`
	FoodLevel           int32   `nbt:"foodLevel"`
	FoodSaturationLevel float32 `nbt:"foodSaturationLevel"`
	FoodTickTimer       int32   `nbt:"foodTickTimer"`

	Attributes []struct {
		Base float64
		Name string
	}

	Abilities struct {
		FlySpeed     float32 `nbt:"flySpeed"`
		WalkSpeed    float32 `nbt:"walkSpeed"`
		Flying       byte    `nbt:"flying"`
		InstantBuild byte    `nbt:"instabuild"`
		Invulnerable byte    `nbt:"invulnerable"`
		MayBuild     byte    `nbt:"mayBuild"`
		MayFly       byte    `nbt:"mayfly"`
	} `nbt:"abilities"`

	RecipeBook struct {
		IsFilteringCraftable        byte `nbt:"isFilteringCraftable"`
		IsFurnaceFilteringCraftable byte `nbt:"isFurnaceFilteringCraftable"`
		IsFurnaceGUIOpen            byte `nbt:"isFurnaceGuiOpen"`
		IsGUIOpen                   byte `nbt:"isGuiOpen"`
	} `nbt:"recipeBook"`
}

func ReadPlayerData

func ReadPlayerData(r io.Reader) (data PlayerData, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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