func (r *resetter) At(_, y, _ int, _ func(x int, y int, z int) world.Block) (world.Block, world.Liquid) {
	switch {
	case y < 22:
		return block.Dirt{}, nil
	case y == 22:
		return r.settings.FloorBlock, nil
	default:
		return block.Air{}, nil
	}
}
At returns either dirt, the floor block or air, depending on the y value.
package plot
import (
	"github.com/df-mc/dragonfly/server/block"
	"github.com/df-mc/dragonfly/server/block/cube"
	"github.com/df-mc/dragonfly/server/world"
	"github.com/go-gl/mathgl/mgl64"
)
type Position [2]int
func PosFromBlockPos(pos cube.Pos, settings Settings) Position {
	fullPlotSize := pathWidth + boundaryWidth + settings.PlotWidth
	if pos[0] < 0 && mod(int32(pos[0]), int32(fullPlotSize)) != 0 {
		pos[0] -= fullPlotSize
	}
	if pos[2] < 0 && mod(int32(pos[2]), int32(fullPlotSize)) != 0 {
		pos[2] -= fullPlotSize
	}
	return Position{pos[0] / fullPlotSize, pos[2] / fullPlotSize}
}
func (pos Position) Add(p Position) Position {
	return Position{pos[0] + p[0], pos[1] + p[1]}
}
func (pos Position) Hash() []byte {
	a, b := int32(pos[0]), int32(pos[1])
	return []byte{
		byte(a), byte(a >> 8), byte(a >> 16), byte(a >> 24),
		byte(b), byte(b >> 8), byte(b >> 16), byte(b >> 24),
	}
}
func (pos Position) Bounds(settings Settings) (min, max cube.Pos) {
	fullPlotSize := pathWidth + boundaryWidth + settings.PlotWidth
	baseX, baseZ := pos[0]*fullPlotSize, pos[1]*fullPlotSize
	x, z := baseX+pathWidth+1, baseZ+pathWidth+1
	return cube.Pos{x, 0, z}, cube.Pos{
		baseX + fullPlotSize - 2,
		255,
		baseZ + fullPlotSize - 2,
	}
}
func (pos Position) Absolute(settings Settings) cube.Pos {
	fullPlotSize := pathWidth + boundaryWidth + settings.PlotWidth
	baseX, baseZ := pos[0]*fullPlotSize, pos[1]*fullPlotSize
	return cube.Pos{baseX, 0, baseZ}
}
func (pos Position) TeleportPosition(settings Settings) mgl64.Vec3 {
	return pos.Absolute(settings).Add(cube.Pos{2, RoadHeight, 2}).Vec3Middle()
}
func Within(pos, min, max cube.Pos) bool {
	return (pos[0] >= min[0] && pos[0] <= max[0]) &&
		(pos[1] >= min[1] && pos[1] <= max[1]) &&
		(pos[2] >= min[2] && pos[2] <= max[2])
}
func (pos Position) Reset(w *world.World, settings Settings) {
	base := pos.Absolute(settings).Add(cube.Pos{pathWidth + 1, 0, pathWidth + 1})
	w.BuildStructure(base, &resetter{settings: settings})
}
type resetter struct {
	settings Settings
}
func (r *resetter) Dimensions() [3]int {
	return [3]int{
		r.settings.PlotWidth,
		256,
		r.settings.PlotWidth,
	}
}