mapper

package module
v0.0.0-...-9ba4538 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2017 License: MIT Imports: 13 Imported by: 0

README

mapper

Map generator for minecraft region files

Documentation

Index

Constants

View Source
const (
	Air = iota
	Stone
	Grass
	Dirt
	Cobblestone
	Planks
	Sapling
	Bedrock
	Flowing_water
	Water
	Flowing_lava
	Lava
	Sand
	Gravel
	Gold_ore
	Iron_ore
	Coal_ore
	Log
	Leaves
	Sponge
	Glass
	Lapis_ore
	Lapis_block
	Dispenser
	Sandstone
	Noteblock
	Bed
	Golden_rail
	Detector_rail
	Sticky_piston
	Web
	Tallgrass
	Deadbush
	Piston
	Piston_head
	Wool
	Piston_extension
	Yellow_flower
	Red_flower
	Brown_mushroom
	Red_mushroom
	Gold_block
	Iron_block
	Double_stone_slab
	Stone_slab
	Brick_block
	Tnt
	Bookshelf
	Mossy_cobblestone
	Obsidian
	Torch
	Fire
	Mob_spawner
	Oak_stairs
	Chest
	Redstone_wire
	Diamond_ore
	Diamond_block
	Crafting_table
	Wheat
	Farmland
	Furnace
	Lit_furnace
	Standing_sign
	Wooden_door
	Ladder
	Rail
	Stone_stairs
	Wall_sign
	Lever
	Stone_pressure_plate
	Iron_door
	Wooden_pressure_plate
	Redstone_ore
	Lit_redstone_ore
	Unlit_redstone_torch
	Redstone_torch
	Stone_button
	Snow_layer
	Ice
	Snow
	Cactus
	Clay
	Reeds
	Jukebox
	Fence
	Pumpkin
	Netherrack
	Soul_sand
	Glowstone
	Portal
	Lit_pumpkin
	Cake
	Unpowered_repeater
	Powered_repeater
	Stained_glass
	Trapdoor
	Monster_egg
	Stonebrick
	Brown_mushroom_block
	Red_mushroom_block
	Iron_bars
	Glass_pane
	Melon_block
	Pumpkin_stem
	Melon_stem
	Vine
	Fence_gate
	Brick_stairs
	Stone_brick_stairs
	Mycelium
	Waterlily
	Nether_brick
	Nether_brick_fence
	Nether_brick_stairs
	Nether_wart
	Enchanting_table
	Brewing_stand
	Cauldron
	End_portal
	End_portal_frame
	End_stone
	Dragon_egg
	Redstone_lamp
	Lit_redstone_lamp
	Double_wooden_slab
	Wooden_slab
	Cocoa
	Sandstone_stairs
	Emerald_ore
	Ender_chest
	Tripwire_hook
	Tripwire
	Emerald_block
	Spruce_stairs
	Birch_stairs
	Jungle_stairs
	Command_block
	Beacon
	Cobblestone_wall
	Flower_pot
	Carrots
	Potatoes
	Wooden_button
	Skull
	Anvil
	Trapped_chest
	Light_weighted_pressure_plate
	Heavy_weighted_pressure_plate
	Unpowered_comparator
	Powered_comparator
	Daylight_detector
	Redstone_block
	Quartz_ore
	Hopper
	Quartz_block
	Quartz_stairs
	Activator_rail
	Dropper
	Stained_hardened_clay
	Stained_glass_pane
	Leaves2
	Log2
	Acacia_stairs
	Dark_oak_stairs
	Slime
	Barrier
	Iron_trapdoor
	Prismarine
	Sea_lantern
	Hay_block
	Carpet
	Hardened_clay
	Coal_block
	Packed_ice
	Double_plant
	Standing_banner
	Wall_banner
	Daylight_detector_inverted
	Red_sandstone
	Red_sandstone_stairs
	Double_stone_slab2
	Stone_slab2
	Spruce_fence_gate
	Birch_fence_gate
	Jungle_fence_gate
	Dark_oak_fence_gate
	Acacia_fence_gate
	Spruce_fence
	Birch_fence
	Jungle_fence
	Dark_oak_fence
	Acacia_fence
	Spruce_door
	Birch_door
	Jungle_door
	Acacia_door
	Dark_oak_door
	End_rod
	Chorus_plant
	Chorus_flower
	Purpur_block
	Purpur_pillar
	Purpur_stairs
	Purpur_double_slab
	Purpur_slab
	End_bricks
	Beetroots
	Grass_path
	End_gateway
	Repeating_command_block
	Chain_command_block
	Frosted_ice
	Magma
	Nether_wart_block
	Red_nether_brick
	Bone_block
	Structure_void
	Observer
	White_shulker_box
	Orange_shulker_box
	Magenta_shulker_box
	Light_blue_shulker_box
	Yellow_shulker_box
	Lime_shulker_box
	Pink_shulker_box
	Gray_shulker_box
	Light_gray_shulker_box
	Cyan_shulker_box
	Purple_shulker_box
	Blue_shulker_box
	Brown_shulker_box
	Green_shulker_box
	Red_shulker_box
	Black_shulker_box
	Structure_block
)

Variables

View Source
var EmptySectionError = errors.New("section is empty")

Functions

This section is empty.

Types

type Block

type Block struct {
	Id   int16 // composed of "byte" and "add" from a chunk Section
	Data int8  // actually only 4 bits (0-15)

}

func NewBlock

func NewBlock(id int16, data int8) Block

this is independat of the zany way the chunk format stores stuff just take the id and the data fields as parameters

func (Block) Block

func (b Block) Block() string

func (Block) Colour

func (b Block) Colour() color.RGBA

returns the colour which should be used by this block on the terrain map

func (Block) Description

func (b Block) Description() string

func (Block) Name

func (b Block) Name() string

type Chunk

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

func NewChunk

func NewChunk(tag nbt.Tag, region *Region, x int, z int) *Chunk

func (*Chunk) Biomes

func (c *Chunk) Biomes() []byte

func (*Chunk) BlockAt

func (c *Chunk) BlockAt(x int, y int, z int) Block

returns the Block found at coords x y z

func (*Chunk) Debug

func (c *Chunk) Debug()

walk the NBT data structure and print it out

func (*Chunk) HeightMap

func (c *Chunk) HeightMap() []int32

accessor methods to values inside chunks

func (*Chunk) Level

func (c *Chunk) Level() nbt.CompoundTag

func (*Chunk) MaxSection

func (c *Chunk) MaxSection() (max int)

return the index of the highest section in this chunk - above this is only air

func (*Chunk) Root

func (c *Chunk) Root() nbt.CompoundTag

func (*Chunk) Section

func (c *Chunk) Section(y int) (result nbt.CompoundTag, err error)

returns the section with index Y=y. If it doesn't exist, returns an empty section

func (*Chunk) X

func (c *Chunk) X() int

func (*Chunk) Z

func (c *Chunk) Z() int

type Region

type Region struct {
	X int
	Z int
	// contains filtered or unexported fields
}

func (*Region) ChunkData

func (r *Region) ChunkData(x int, z int) (data bytes.Buffer, err error)

returns a Buffer which is the uncompressed chunk data

func (*Region) Open

func (r *Region) Open(fn string) (err error)

Directories

Path Synopsis
cmd
map command

Jump to

Keyboard shortcuts

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