func rainingAround(pos cube.Pos, w *world.World) bool {
	raining := w.RainingAt(pos)
	for _, face := range cube.HorizontalFaces() {
		if raining {
			break
		}
		raining = w.RainingAt(pos.Side(face))
	}
	return raining
}
rainingAround checks if it is raining either at the cube.Pos passed or at any of its horizontal neighbours.
package block
import (
	"github.com/df-mc/dragonfly/server/block/cube"
	"github.com/df-mc/dragonfly/server/entity"
	"github.com/df-mc/dragonfly/server/entity/damage"
	"github.com/df-mc/dragonfly/server/world"
	"math/rand"
	"time"
	_ "unsafe"  
)
type Fire struct {
	replaceable
	transparent
	empty
	Type FireType
	Age int
}
func flammableBlock(block world.Block) bool {
	flammable, ok := block.(Flammable)
	return ok && flammable.FlammabilityInfo().Encouragement > 0
}
func neighboursFlammable(pos cube.Pos, w *world.World) bool {
	for _, i := range cube.Faces() {
		if flammableBlock(w.Block(pos.Side(i))) {
			return true
		}
	}
	return false
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}
func infinitelyBurning(pos cube.Pos, w *world.World) bool {
	switch block := w.Block(pos.Side(cube.FaceDown)).(type) {
	case Netherrack:
		return true
	case Bedrock:
		return block.InfiniteBurning
	}
	return false
}
func (f Fire) burn(pos cube.Pos, w *world.World, r *rand.Rand, chanceBound int) {
	if flammable, ok := w.Block(pos).(Flammable); ok && r.Intn(chanceBound) < flammable.FlammabilityInfo().Flammability {
		if r.Intn(f.Age+10) < 5 && !rainingAround(pos, w) {
			age := min(15, f.Age+r.Intn(5)/4)
			w.PlaceBlock(pos, Fire{Type: f.Type, Age: age})
			w.ScheduleBlockUpdate(pos, time.Duration(30+r.Intn(10))*time.Second/20)
		} else {
			w.BreakBlockWithoutParticles(pos)
		}
	}
}