Example #1
0
File: mtl.go Project: quag/mcobj
func (mtl *MTL) colorId() nbt.Block {
	var id = nbt.Block(mtl.blockId)
	if mtl.metadata != 255 {
		id += nbt.Block(mtl.metadata) << 8
	}
	return id
}
Example #2
0
File: mtl.go Project: quag/mcobj
func (mtl *MTL) Print(w io.Writer) {
	var (
		r = mtl.color >> 24
		g = mtl.color >> 16 & 0xff
		b = mtl.color >> 8 & 0xff
		a = mtl.color & 0xff
	)

	fmt.Fprintf(w, "# %s\nnewmtl %s\nKd %.4f %.4f %.4f\nd %.4f\nillum 1\n\n", mtl.name, MaterialNamer.NameBlockId(nbt.Block(mtl.blockId)+nbt.Block(mtl.metadata)*256), float64(r)/255, float64(g)/255, float64(b)/255, float64(a)/255)
}