world

package
v0.0.0-...-54241fc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteUUIDToIntUUID

func ByteUUIDToIntUUID(uuid uuid2.UUID) (u []int32)

func CreateWorld

func CreateWorld(hardcore bool)

func GenerateWorldData

func GenerateWorldData(hardcore int8) worldData

func IntUUIDToByteUUID

func IntUUIDToByteUUID(u []int32) (uuid2.UUID, error)

func ParsePosition

func ParsePosition(pos int64) (x, y, z int64)

func RandomSeed

func RandomSeed() int64

Types

type Abilities

type Abilities struct {
	Mayfly       bool    `nbt:"mayfly"`
	Instabuild   bool    `nbt:"instabuild"`
	WalkSpeed    float32 `nbt:"walkSpeed"`
	MayBuild     bool    `nbt:"mayBuild"`
	Flying       bool    `nbt:"flying"`
	FlySpeed     float32 `nbt:"flySpeed"`
	Invulnerable bool    `nbt:"invulnerable"`
}

type Attribute

type Attribute struct {
	Name string  `nbt:"Name"`
	Base float64 `nbt:"Base"`
}

type BiomeSource

type BiomeSource struct {
	Preset string `nbt:"preset"`
	Type   string `nbt:"type"`
}

type Brain

type Brain struct {
	Memories struct{} `nbt:"memories"`
}

type DataPacks

type DataPacks struct {
	Disabled []string `nbt:"Disabled"`
	Enabled  []string `nbt:"Enabled"`
}

type Dimension

type Dimension struct {
	// contains filtered or unexported fields
}

func (*Dimension) Block

func (d *Dimension) Block(x, y, z int64) chunk.Block

func (*Dimension) Chunk

func (d *Dimension) Chunk(x, z int32) (*chunk.Chunk, error)

func (*Dimension) Chunks

func (d *Dimension) Chunks() map[chunk.Hash]*chunk.Chunk

func (*Dimension) LoadedChunks

func (d *Dimension) LoadedChunks() int

func (*Dimension) Seed

func (d *Dimension) Seed() int64

func (*Dimension) SetBlock

func (d *Dimension) SetBlock(x, y, z int64, b chunk.Block)

func (*Dimension) SetGenerator

func (d *Dimension) SetGenerator(g Generator)

func (*Dimension) Type

func (d *Dimension) Type() string

func (*Dimension) World

func (d *Dimension) World() *World

type DimensionData

type DimensionData struct {
	Generator DimensionGenerator `nbt:"generator"`
	Type      string             `nbt:"type"`
}

type DimensionGenerator

type DimensionGenerator struct {
	BiomeSource BiomeSource `nbt:"biome_source"`
	Type        string      `nbt:"type"`
	Settings    string      `nbt:"settings"`
}

type DimensionGeneratorLayer

type DimensionGeneratorLayer struct {
	Block  string `nbt:"block"`
	Height int32  `nbt:"height"`
}

type DimensionGeneratorSettings

type DimensionGeneratorSettings struct {
	Biome              string                    `nbt:"biome"`
	Features           int32                     `nbt:"features"`
	Lakes              int32                     `nbt:"lakes"`
	Layers             []DimensionGeneratorLayer `nbt:"layers"`
	StructureOverrides []string                  `nbt:"structure_overrides"`
}

type Dimensions

type Dimensions struct {
	End       DimensionData `nbt:"minecraft:the_end"`
	Overworld DimensionData `nbt:"minecraft:overworld"`
	Nether    DimensionData `nbt:"minecraft:the_nether"`
}

type DragonFight

type DragonFight struct {
	NeedsStateScanning int8    `nbt:"NeedsStateScanning"`
	Gateways           []int32 `nbt:"Gateways"`
	DragonKilled       int8    `nbt:"DragonKilled"`
	PreviouslyKilled   int8    `nbt:"PreviouslyKilled"`
}

type GameRule

type GameRule string

func (GameRule) Bool

func (r GameRule) Bool() (bool, error)

func (GameRule) Int

func (r GameRule) Int() (int, error)

type GameRules

type GameRules struct {
	DoDaylightCycle               string `nbt:"doDaylightCycle"`
	DoInsomnia                    string `nbt:"doInsomnia"`
	DoEntityDrops                 string `nbt:"doEntityDrops"`
	SpectatorsGenerateChunks      string `nbt:"spectatorsGenerateChunks"`
	DisableElytraMovementCheck    string `nbt:"disableElytraMovementCheck"`
	DisableRaids                  string `nbt:"disableRaids"`
	CommandModificationBlockLimit string `nbt:"commandModificationBlockLimit"`
	ForgiveDeadPlayers            string `nbt:"forgiveDeadPlayers"`
	MaxEntityCramming             string `nbt:"maxEntityCramming"`
	SpawnRadius                   string `nbt:"spawnRadius"`
	AnnounceAdvancements          string `nbt:"announceAdvancements"`
	UniversalAnger                string `nbt:"universalAnger"`
	FallDamage                    string `nbt:"fallDamage"`
	RandomTickSpeed               string `nbt:"randomTickSpeed"`
	DoTraderSpawning              string `nbt:"doTraderSpawning"`
	DrowningDamage                string `nbt:"drowningDamage"`
	ShowDeathMessages             string `nbt:"showDeathMessages"`
	PlayersSleepingPercentage     string `nbt:"playersSleepingPercentage"`
	DoImmediateRespawn            string `nbt:"doImmediateRespawn"`
	NaturalRegeneration           string `nbt:"naturalRegeneration"`
	KeepInventory                 string `nbt:"keepInventory"`
	DoVinesSpread                 string `nbt:"doVinesSpread"`
	DoTileDrops                   string `nbt:"doTileDrops"`
	MaxCommandChainLength         string `nbt:"maxCommandChainLength"`
	FireDamage                    string `nbt:"fireDamage"`
	WaterSourceConversion         string `nbt:"waterSourceConversion"`
	CommandBlockOutput            string `nbt:"commandBlockOutput"`
	DoWeatherCycle                string `nbt:"doWeatherCycle"`
	SnowAccumulationHeight        string `nbt:"snowAccumulationHeight"`
	DoWardenSpawning              string `nbt:"doWardenSpawning"`
	DoFireTick                    string `nbt:"doFireTick"`
	DoPatrolSpawning              string `nbt:"doPatrolSpawning"`
	DoMobLoot                     string `nbt:"doMobLoot"`
	SendCommandFeedback           string `nbt:"sendCommandFeedback"`
	DoMobSpawning                 string `nbt:"doMobSpawning"`
	MobExplosionDropDecay         string `nbt:"mobExplosionDropDecay"`
	MobGriefing                   string `nbt:"mobGriefing"`
	FreezeDamage                  string `nbt:"freezeDamage"`
	LogAdminCommands              string `nbt:"logAdminCommands"`
	GlobalSoundEvents             string `nbt:"globalSoundEvents"`
	TntExplosionDropDecay         string `nbt:"tntExplosionDropDecay"`
	BlockExplosionDropDecay       string `nbt:"blockExplosionDropDecay"`
	DoLimitedCrafting             string `nbt:"doLimitedCrafting"`
	ReducedDebugInfo              string `nbt:"reducedDebugInfo"`
	LavaSourceConversion          string `nbt:"lavaSourceConversion"`
}

type Generator

type Generator interface {
	GenerateChunk(x, z int32) (*chunk.Chunk, error)
}

type PlayerData

type PlayerData struct {
	Invulnerable          bool               `nbt:"Invulnerable"`
	FoodSaturationLevel   float32            `nbt:"foodSaturationLevel"`
	UUID                  []int32            `nbt:"UUID"`
	EnderItems            []item.Item        `nbt:"EnderItems"`
	DataVersion           int32              `nbt:"DataVersion"`
	SelectedItemSlot      int32              `nbt:"SelectedItemSlot"`
	SleepTimer            int16              `nbt:"SleepTimer"`
	Abilities             Abilities          `nbt:"abilities"`
	RecipeBook            RecipeBook         `nbt:"recipeBook"`
	XpSeed                int32              `nbt:"XpSeed"`
	Inventory             []item.Item        `nbt:"Inventory"`
	FoodLevel             int32              `nbt:"foodLevel"`
	HurtByTimestamp       int32              `nbt:"HurtByTimestamp"`
	FallDistance          float32            `nbt:"FallDistance"`
	PlayerGameType        int32              `nbt:"playerGameType"`
	SeenCredits           bool               `nbt:"seenCredits"`
	Pos                   []float64          `nbt:"Pos"`
	FoodTickTimer         int32              `nbt:"foodTickTimer"`
	Brain                 Brain              `nbt:"Brain"`
	AbsorptionAmount      float32            `nbt:"AbsorptionAmount"`
	DeathTime             int16              `nbt:"DeathTime"`
	XpLevel               int32              `nbt:"XpLevel"`
	XpP                   float32            `nbt:"XpP"`
	FallFlying            int8               `nbt:"FallFlying"`
	Motion                []float64          `nbt:"Motion"`
	OnGround              bool               `nbt:"OnGround"`
	Rotation              []float32          `nbt:"Rotation"`
	Score                 int32              `nbt:"Score"`
	Fire                  int16              `nbt:"Fire"`
	FoodExhaustionLevel   float32            `nbt:"foodExhaustionLevel"`
	Attributes            []Attribute        `nbt:"Attributes"`
	EnteredNetherPosition []float64          `nbt:"enteredNetherPosition"`
	PortalCooldown        int32              `nbt:"PortalCooldown"`
	Health                float32            `nbt:"Health"`
	Dimension             string             `nbt:"Dimension"`
	XpTotal               int32              `nbt:"XpTotal"`
	Air                   int16              `nbt:"Air"`
	WardenSpawnTracker    WardenSpawnTracker `nbt:"warden_spawn_tracker"`
	HurtTime              int16              `nbt:"HurtTime"`
	// contains filtered or unexported fields
}

func (*PlayerData) Save

func (data *PlayerData) Save()

type RecipeBook

type RecipeBook struct {
	IsGuiOpen                           int8     `nbt:"isGuiOpen"`
	IsBlastingFurnaceGuiOpen            int8     `nbt:"isBlastingFurnaceGuiOpen"`
	IsSmokerGuiOpen                     int8     `nbt:"isSmokerGuiOpen"`
	IsBlastingFurnaceFilteringCraftable int8     `nbt:"isBlastingFurnaceFilteringCraftable"`
	IsFilteringCraftable                int8     `nbt:"isFilteringCraftable"`
	ToBeDisplayed                       []string `nbt:"toBeDisplayed"`
	IsFurnaceGuiOpen                    int8     `nbt:"isFurnaceGuiOpen"`
	IsFurnaceFilteringCraftable         int8     `nbt:"isFurnaceFilteringCraftable"`
	IsSmokerFilteringCraftable          int8     `nbt:"isSmokerFilteringCraftable"`
	Recipes                             []string `nbt:"recipes"`
}

type SetBlockHandling

type SetBlockHandling = int8
const (
	SetBlockReplace SetBlockHandling = iota
	SetBlockKeep
	SetBlockDestroy
)

type Version

type Version struct {
	Snapshot int8   `nbt:"Snapshot"`
	Series   string `nbt:"Series"`
	Id       int32  `nbt:"Id"`
	Name     string `nbt:"Name"`
}

type WardenSpawnTracker

type WardenSpawnTracker struct {
	WarningLevel          int32 `nbt:"warning_level"`
	TicksSinceLastWarning int32 `nbt:"ticks_since_last_warning"`
	CooldownTicks         int32 `nbt:"cooldown_ticks"`
}

type World

type World struct {
	Gamemode byte
	// contains filtered or unexported fields
}

func OpenWorld

func OpenWorld(name string, flat bool) (*World, error)

func (*World) Gamerules

func (w *World) Gamerules() map[string]string

func (*World) GeneratePlayerData

func (world *World) GeneratePlayerData(uuid string) *PlayerData

func (*World) GetDimension

func (w *World) GetDimension(typ string) *Dimension

func (*World) GetPlayerData

func (world *World) GetPlayerData(uuid string) (data *PlayerData)

func (*World) IncrementTime

func (w *World) IncrementTime() (worldAge int64, dayTime int64)

func (*World) LoadSpawnChunks

func (w *World) LoadSpawnChunks(rd int32) (success int)

func (*World) Nether

func (w *World) Nether() *Dimension

func (*World) NewDimension

func (w *World) NewDimension(typ string, rd *anvil.Reader) *Dimension

func (*World) Overworld

func (w *World) Overworld() *Dimension

func (*World) Save

func (w *World) Save()

func (*World) Seed

func (w *World) Seed() int64

func (*World) Spawn

func (w *World) Spawn() (x, y, z int32, angle float32)

func (*World) TheEnd

func (w *World) TheEnd() *Dimension

type WorldData

type WorldData struct {
	ServerBrands               []string          `nbt:"ServerBrands"`
	SpawnY                     int32             `nbt:"SpawnY"`
	ThunderTime                int32             `nbt:"thunderTime"`
	LastPlayed                 int64             `nbt:"LastPlayed"`
	BorderSize                 float64           `nbt:"BorderSize"`
	DataVersion                int32             `nbt:"DataVersion"`
	Time                       int64             `nbt:"Time"`
	Difficulty                 int8              `nbt:"Difficulty"`
	Raining                    int8              `nbt:"raining"`
	BorderWarningBlocks        float64           `nbt:"BorderWarningBlocks"`
	WorldGenSettings           WorldGenSettings  `nbt:"WorldGenSettings"`
	BorderSizeLerpTarget       float64           `nbt:"BorderSizeLerpTarget"`
	Version                    Version           `nbt:"Version"`
	DayTime                    int64             `nbt:"DayTime"`
	WanderingTraderSpawnChance int32             `nbt:"WanderingTraderSpawnChance"`
	Hardcore                   int8              `nbt:"hardcore"`
	SpawnX                     int32             `nbt:"SpawnX"`
	BorderWarningTime          float64           `nbt:"BorderWarningTime"`
	WanderingTraderSpawnDelay  int32             `nbt:"WanderingTraderSpawnDelay"`
	CustomBossEvents           struct{}          `nbt:"CustomBossEvents"`
	ClearWeatherTime           int32             `nbt:"clearWeatherTime"`
	Thundering                 int8              `nbt:"thundering"`
	SpawnAngle                 float32           `nbt:"SpawnAngle"`
	ScheduledEvents            []interface{}     `nbt:"ScheduledEvents"`
	BorderCenterZ              float64           `nbt:"BorderCenterZ"`
	RainTime                   int32             `nbt:"rainTime"`
	LevelName                  string            `nbt:"LevelName"`
	WasModded                  int8              `nbt:"WasModded"`
	BorderCenterX              float64           `nbt:"BorderCenterX"`
	AllowCommands              int8              `nbt:"allowCommands"`
	DragonFight                DragonFight       `nbt:"DragonFight"`
	BorderDamagePerBlock       float64           `nbt:"BorderDamagePerBlock"`
	Initialized                int8              `nbt:"initialized"`
	GameRules                  map[string]string `nbt:"GameRules"`
	SpawnZ                     int32             `nbt:"SpawnZ"`
	BorderSafeZone             float64           `nbt:"BorderSafeZone"`
	DataPacks                  DataPacks         `nbt:"DataPacks"`
	GameType                   int32             `nbt:"GameType"`
	DifficultyLocked           int8              `nbt:"DifficultyLocked"`
	BorderSizeLerpTime         int64             `nbt:"BorderSizeLerpTime"`
	VersionNumber              int32             `nbt:"version"`
}

type WorldGenSettings

type WorldGenSettings struct {
	BonusChest       int8       `nbt:"bonus_chest"`
	Seed             int64      `nbt:"seed"`
	GenerateFeatures int8       `nbt:"generate_features"`
	Dimensions       Dimensions `nbt:"dimensions"`
}

Directories

Path Synopsis
generator

Jump to

Keyboard shortcuts

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