material

package
v0.0.0-...-93368d4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2015 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package material defines all blocks and items and some utiliy functions.

Index

Constants

View Source
const (
	MinBlock = 0
	MaxBlock = 158
	MinItem  = 256
	MaxItem  = 408
	MinDisc  = 2256
	MaxDisc  = 2267
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Material

type Material uint
const (
	Air                  Material = iota // 00
	Stone                                // 01
	Grass                                // 02
	Dirt                                 // 03
	Cobblestone                          // 04
	WoodPlanks                           // 05 // D
	Sapling                              // 06 // DB
	Bedrock                              // 07
	Water                                // 08 // D
	WaterStatic                          // 09 // D
	Lava                                 // 10 // D
	LavaStatic                           // 11 // D
	Sand                                 // 12
	Gravel                               // 13
	OreGold                              // 14
	OreIron                              // 15
	OreCoal                              // 16
	Wood                                 // 17 // DB
	Leaves                               // 18 // DB
	Sponge                               // 19
	Glass                                // 20
	OreLapisLazuli                       // 21
	LapisLazuli                          // 22
	Dispenser                            // 23 // DT
	Sandstone                            // 24 // D
	Note                                 // 25 // T
	Bed                                  // 26 // DI
	RailPowered                          // 27 // D
	RailDetector                         // 28 // D
	StickyPiston                         // 29 // D
	Cobweb                               // 30
	TallGrass                            // 31 // D
	DeadBush                             // 32
	Piston                               // 33 // D
	PistonExtension                      // 34 // D
	Wool                                 // 35 // DB
	PistonBlockMoved                     // 36 // T
	FlowerYellow                         // 37
	FlowerRed                            // 38
	MushroomBrown                        // 39
	MushroomRed                          // 40
	Gold                                 // 41
	Iron                                 // 42
	SlabDouble                           // 43 // DB
	Slab                                 // 44 // DB
	Brick                                // 45
	Tnt                                  // 46
	Bookshelf                            // 47
	MossStone                            // 48
	Obsidian                             // 49
	Torch                                // 50 // D
	Fire                                 // 51 // D
	MonsterSpawner                       // 52 // T
	StairsWoodOak                        // 53 // D
	Chest                                // 54 // DT
	RedstoneWire                         // 55 // DI
	OreDiamond                           // 56
	Diamond                              // 57
	CraftingTable                        // 58
	Wheat                                // 59 // D
	Farmland                             // 60 // D
	Furnace                              // 61 // DT
	FurnaceOn                            // 62 // DT
	SignPost                             // 63 // DIT
	DoorWood                             // 64 // DI
	Ladder                               // 65 // D
	Rail                                 // 66 // D
	StairsCobblestone                    // 67 // D
	SignWall                             // 68 // DT
	Lever                                // 69 // D
	PlateStone                           // 70 // D
	DoorIron                             // 71 // DI
	PlateWood                            // 72 // D
	OreRedstone                          // 73
	OreRedstoneOn                        // 74
	RedstoneTorch                        // 75 // D
	RedstoneTorchOn                      // 76 // D
	ButtonStone                          // 77 // D
	Snow                                 // 78 // D
	Ice                                  // 79
	BlockSnow                            // 80 // Snow is 1/8 of this
	Cactus                               // 81 // D
	Clay                                 // 82
	SugarCane                            // 83 // DI
	Jukebox                              // 84 // DT
	Fence                                // 85
	Pumpkin                              // 86 // D
	Netherrack                           // 87
	SoulSand                             // 88
	Glowstone                            // 89
	PortalNether                         // 90
	JackOLantern                         // 91 // D
	Cake                                 // 92 // DI
	RedstoneRepeater                     // 93 // DI
	RedstoneRepeaterOn                   // 94 // DI
	ChestLocked                          // 95
	Trapdoor                             // 96 // D
	EggMonster                           // 97 // D
	StoneBrick                           // 98 // DB
	MushroomBrownHuge                    // 99 // D
	MushroomRedHuge                      // 100 // D
	IronBars                             // 101
	GlassPane                            // 102
	Melon                                // 103
	PumpkinStem                          // 104 // D
	MelonStem                            // 105 // D
	Vine                                 // 106 // D
	FenceGate                            // 107 // D
	StairsBrick                          // 108 // D
	StairsStoneBrick                     // 109 // D
	Mycelium                             // 110
	LilyPad                              // 111
	NetherBrick                          // 112
	NetherBrickFence                     // 113
	StairsNetherBrick                    // 114 // D
	NetherWart                           // 115 // DI
	EnchantmentTable                     // 116 // T
	BrewingStand                         // 117 // DTI
	Cauldron                             // 118 // DI
	PortalEnd                            // 119 // T
	BlockPortalEnd                       // 120 // D
	EndStone                             // 121
	EggDragon                            // 122
	RedstoneLamp                         // 123
	RedstoneLampOn                       // 124
	SlabDoubleWood                       // 125 // DB
	SlabWood                             // 126 // DB
	Cocoa                                // 127 // DI
	StairsSandstone                      // 128 // D
	OreEmerald                           // 129
	ChestEnder                           // 130 // DT
	TripwireHook                         // 131 // D
	Tripwire                             // 132 // DI
	Emerald                              // 133
	StairsSpruceWood                     // 134 // D
	StairsBirchWood                      // 135 // D
	StairsJungleWood                     // 136 // D
	Command                              // 137 // T
	Beacon                               // 138 // T
	CobblestoneWall                      // 139 // BD
	FlowerPot                            // 140 // DI
	Carrot                               // 141 // D
	Potato                               // 142 // D
	ButtonWood                           // 143 // D
	Skull                                // 144 // DTI
	Anvil                                // 145 // D
	ChestTrapped                         // 146 // DT
	WeightedPlateLight                   // 147 // D
	WeightedPlateHeavy                   // 148 // D
	RedstoneComparator                   // 149 // I
	RedstoneComparatorOn                 // 150 // I
	DaylightSensor                       // 151
	Redstone                             // 152
	OreQuartz                            // 153
	Hopper                               // 154 // DT
	Quartz                               // 155 // D
	StairsQuartz                         // 156
	RailActivator                        // 157
	Dropper                              // 158 // DT
)
const (
	Disc13      Material = iota + 2256 // 2256
	DiscCat                            // 2257
	DiscBlocks                         // 2258
	DiscChirp                          // 2259
	DiscFar                            // 2260
	DiscMall                           // 2261
	DiscMellohi                        // 2262
	DiscStal                           // 2263
	DiscStrad                          // 2264
	DiscWard                           // 2265
	Disc11                             // 2266
	DiscWait                           // 2267
)
const (
	IronShovel             Material = iota + 256 // 256
	IronPickaxe                                  // 257
	IronAxe                                      // 258
	FlintAndSteel                                // 259
	AppleItem                                    // 260
	Bow                                          // 261
	Arrow                                        // 262
	Coal                                         // 263 // D
	DiamondItem                                  // 264
	IronIngot                                    // 265
	GoldIngot                                    // 266
	IronSword                                    // 267
	WoodSword                                    // 268
	WoodShovel                                   // 269
	WoodPickaxe                                  // 270
	WoodAxe                                      // 271
	StoneSword                                   // 272
	StoneShovel                                  // 273
	StonePickaxe                                 // 274
	StoneAxe                                     // 275
	DiamondSword                                 // 276
	DiamondShovel                                // 277
	DiamondPickaxe                               // 278
	DiamondAxe                                   // 279
	Stick                                        // 280
	Bowl                                         // 281
	MushroomStew                                 // 282
	GoldenSword                                  // 283
	GoldenShovel                                 // 284
	GoldenPickaxe                                // 285
	GoldenAxe                                    // 286
	String                                       // 287
	Feather                                      // 288
	Gunpowder                                    // 289
	WoodHoe                                      // 290
	StoneHoe                                     // 291
	IronHoe                                      // 292
	DiamondHoe                                   // 293
	GoldHoe                                      // 294
	Seeds                                        // 295
	WheatItem                                    // 296
	Bread                                        // 297
	LeatherHelmet                                // 298
	LeatherChestplate                            // 299
	LeatherLeggings                              // 300
	LeatherBoots                                 // 301
	ChainHelmet                                  // 302
	ChainChestplate                              // 303
	ChainLeggings                                // 304
	ChainBoots                                   // 305
	IronHelmet                                   // 306
	IronChestplate                               // 307
	IronLeggings                                 // 308
	IronBoots                                    // 309
	DiamondHelmet                                // 310
	DiamondChestplate                            // 311
	DiamondLeggings                              // 312
	DiamondBoots                                 // 313
	GoldHelmet                                   // 314
	GoldChestplate                               // 315
	GoldLeggings                                 // 316
	GoldBoots                                    // 317
	Flint                                        // 318
	RawPorkchop                                  // 319
	CookedPorkchop                               // 320
	Painting                                     // 321
	AppleGolden                                  // 322 // D
	Sign                                         // 323
	DoorWoodItem                                 // 324
	Bucket                                       // 325
	BucketWater                                  // 326
	BucketLava                                   // 327
	Minecart                                     // 328
	Saddle                                       // 329
	DoorIronItem                                 // 330
	RedstoneItem                                 // 331
	Snowball                                     // 332
	Boat                                         // 333
	Leather                                      // 334
	Milk                                         // 335
	BrickItem                                    // 336
	ClayItem                                     // 337
	SugarCaneItem                                // 338
	Paper                                        // 339
	Book                                         // 340
	Slimeball                                    // 341
	MinecartChest                                // 342
	MinecartFurnace                              // 343
	Egg                                          // 344
	Compass                                      // 345
	FishingRod                                   // 346
	Clock                                        // 347
	GlowstoneDust                                // 348
	RawFish                                      // 349
	CookedFish                                   // 350
	Dye                                          // 351 // D
	Bone                                         // 352
	Sugar                                        // 353
	CakeItem                                     // 354
	BedItem                                      // 355
	RedstoneRepeaterItem                         // 356
	Cookie                                       // 357
	Map                                          // 358
	Shears                                       // 359
	MelonItem                                    // 360
	SeedsPumpkin                                 // 361
	SeedsMelon                                   // 362
	RawSteak                                     // 363
	CookedSteak                                  // 364
	RawChicken                                   // 365
	CookedChicken                                // 366
	RottenFlesh                                  // 367
	EnderPearl                                   // 368
	BlazeRod                                     // 369
	GhastTear                                    // 370
	GoldNugget                                   // 371
	NetherWartItem                               // 372
	Potion                                       // 373 // D
	GlassBottle                                  // 374
	EyeSpider                                    // 375
	EyeSpiderFermented                           // 376
	BlazePowder                                  // 377
	MagmaCream                                   // 378
	BrewingStandItem                             // 379
	CauldronItem                                 // 380
	EnderEye                                     // 381
	GlisteringMelon                              // 382
	SpawnEgg                                     // 383 // D
	BottleOfEnchanting                           // 384
	FireCharge                                   // 385
	BookAndQuill                                 // 386
	BookWritten                                  // 387
	EmeraldItem                                  // 388
	FrameItem                                    // 389
	FlowerPotItem                                // 390
	CarrotItem                                   // 391
	PotatoItem                                   // 392
	PotatoBaked                                  // 393
	PotatoPoisonous                              // 394
	MapEmpty                                     // 395
	CarrotGolden                                 // 396
	SkullItem                                    // 397 // D
	CarrotStick                                  // 398
	NetherStar                                   // 399
	PumpkinPie                                   // 400
	FireworkRocket                               // 401
	FireworkStar                                 // 402
	BookEnchanted                                // 403
	RedstoneComparatorItem                       // 404
	NetherBrickItem                              // 405
	QuartzItem                                   // 406
	MinecartTnt                                  // 407
	MinecartHopper                               // 408
)

func FromId

func FromId(id int) (m Material)

FromId attempts to match Material by its id. Matching order:

1: if id < MinBlock { return Air }
2: exact match
3: "Block" + name
4: "Item" + name
5: "Disc" + name
6: return Air

func FromName

func FromName(name string) (m Material)

FromName attempts to match Material by its name. Matching order:

1: if name == "" { return Air }
2: exact match
3: "Item" + name
4: "Disc" + name
5: return Air

func (Material) HasGravity

func (m Material) HasGravity() bool

HasGravity returns true if m is affected by gravity.

func (Material) IsBlock

func (m Material) IsBlock() bool

IsBlock returns true if m is a block.

func (Material) IsBurnable

func (m Material) IsBurnable() bool

IsBurnable returns true if m is a block and can burn away.

func (Material) IsDisc

func (m Material) IsDisc() bool

IsDisc returns true if m is a playable music disc.

func (Material) IsEdible

func (m Material) IsEdible() bool

func (Material) IsFlammable

func (m Material) IsFlammable() bool

IsFlammable returns true if m is a block and can catch fire.

func (Material) IsItem

func (m Material) IsItem() bool

IsItem returns true if m is an item.

func (Material) IsOccluding

func (m Material) IsOccluding() bool

IsOccluding returns true if m is a block and completely blocks vision.

func (Material) IsSolid

func (m Material) IsSolid() bool

IsSolid returns true if m is solid block.

func (Material) IsTransparent

func (m Material) IsTransparent() bool

IsTransparent returns true if m is a block and does not block any light.

func (Material) MaxDurability

func (m Material) MaxDurability() int

func (Material) MaxStack

func (m Material) MaxStack() byte

func (Material) String

func (m Material) String() string

Jump to

Keyboard shortcuts

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