38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
|
package blocks
|
||
|
|
||
|
import (
|
||
|
"edgaru089.ml/go/gl01/internal/util/itype"
|
||
|
"edgaru089.ml/go/gl01/internal/world"
|
||
|
)
|
||
|
|
||
|
type WaterBehaviour struct{}
|
||
|
|
||
|
func (WaterBehaviour) Static() bool { return false }
|
||
|
func (WaterBehaviour) RequireDataset() bool { return false }
|
||
|
func (WaterBehaviour) RequireBlockUpdate() bool { return false }
|
||
|
func (b WaterBehaviour) Appearance(position itype.Vec3i, aux int, data itype.Dataset, w *world.World) world.BlockAppearance {
|
||
|
return world.BlockAppearance{
|
||
|
Name: "water",
|
||
|
Transparent: true,
|
||
|
NotSolid: true,
|
||
|
|
||
|
RenderType: world.CustomRendering,
|
||
|
CustomRenderAppend: func(
|
||
|
position itype.Vec3i,
|
||
|
aux int,
|
||
|
data itype.Dataset,
|
||
|
w *world.World,
|
||
|
vertexArray []world.Vertex) []world.Vertex {
|
||
|
|
||
|
if block := w.Block(position.Addv(0, 1, 0)); block.Id != Water {
|
||
|
return appendFace(itype.YPlus, position, "water.png", itype.Vec3f{0, -0.125, 0}, vertexArray)
|
||
|
}
|
||
|
|
||
|
return vertexArray
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
func (WaterBehaviour) BlockUpdate(position itype.Vec3i, aux int, data itype.Dataset, w *world.World) bool {
|
||
|
return false
|
||
|
}
|