mc_classic_parser

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

README

Minecraft Classic Parser (Go)

A library for parsing Minecraft Classic c0.0.14a-c0.30 worlds.

How To Install

Coming Soon.

How To Build

Coming Soon.

Minimum Go Version

  • Go 1.20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClassicEntity

type ClassicEntity struct {
	AirSupply            int32
	AllowAlpha           bool
	AnimStep             float32
	AnimStepO            float32
	AttackTime           int32
	Bb                   map[string]float32 // mapping same as original AABB class. map keys range from x0 to z1
	BbHeight             float32
	BbWidth              float32
	BobStrength          float32
	Collision            bool // make optional
	Dead                 bool
	DeathScore           int32
	DeathTime            int32
	FallDistance         float32 // make optional
	FootSize             float32 // make optional
	HasHair              bool
	Health               int32
	HeightOffset         float32
	HorizontalCollision  bool
	Hovered              bool // make optional
	HurtDir              float32
	HurtDuration         int32
	HurtTime             int32
	InvulnerableDuration int32
	InvulnerableTime     int32
	LastHealth           int32
	MakeStepSound        bool // make optional
	ModelName            string
	NoPhysics            bool // make optional
	ORun                 float32
	OTilt                float32
	OnGround             bool
	Pushthrough          float32 // make optional
	Removed              bool
	RenderOffset         float32
	Rot                  float32
	RotA                 float32
	RotOffs              float32
	Run                  float32
	Slide                bool // make optional
	Speed                float32
	TextureId            int32 // make optional
	TextureName          string
	TickCount            int32
	Tilt                 float32
	TimeOffs             float32
	WalkDist             float32 // make optional
	WalkDistO            float32 // make optional
	X                    float32
	XOld                 float32 // make optional
	XRot                 float32
	XRotO                float32
	Xd                   float32
	Xo                   float32
	Y                    float32
	YBodyRot             float32
	YBodyRotO            float32
	YOld                 float32 // make optional
	YRot                 float32
	YRotO                float32
	YSlideOffset         float32 // make optional
	Yd                   float32
	Yo                   float32
	Z                    float32
	ZOld                 float32 // make optional
	Zd                   float32
	Zo                   float32
}

func (ClassicEntity) ToString

func (player ClassicEntity) ToString() string

type ClassicParser

type ClassicParser struct {
}

func (*ClassicParser) Parse

func (cp *ClassicParser) Parse(filepath string) (*ClassicWorld, error)

type ClassicPlayer

type ClassicPlayer struct {
	ClassicEntity
	Arrows    int32
	Bob       float32
	Inventory map[string]any
	OBob      float32
	Score     int32
	UserType  int8
}

func (ClassicPlayer) ToString

func (player ClassicPlayer) ToString() string

type ClassicWorld

type ClassicWorld struct {
	Blocks       []int8
	CloudColor   int32 // make optional
	CreateTime   int64
	CreativeMode bool // make optional
	Creator      string
	Depth        int32
	Entities     []ClassicEntity // empty if no entities
	FogColor     int32           // make optional
	GrowTrees    bool            // make optional
	Height       int32
	Name         string
	Player       ClassicPlayer // make optional
	RotSpawn     float32
	SkyColor     int32 // make optional
	WaterLevel   int32 // make optional
	Width        int32
	XSpawn       int32
	YSpawn       int32
	ZSpawn       int32
}

func (*ClassicWorld) GetWaterLevel

func (world *ClassicWorld) GetWaterLevel() float32

Returns the water level of the world or -1 & error if not present

func (*ClassicWorld) GetWorldSpawn

func (world *ClassicWorld) GetWorldSpawn() (int32, int32, int32)

func (ClassicWorld) ToString

func (player ClassicWorld) ToString() string

Jump to

Keyboard shortcuts

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