34 private static array $contexts = [];
36 public static function register(
self $context,
int $worldId) :
void{
37 self::$contexts[$worldId] = $context;
40 public static function unregister(
int $worldId) :
void{
41 unset(self::$contexts[$worldId]);
44 public static function fetch(
int $worldId) : ?
self{
45 return self::$contexts[$worldId] ??
null;
48 public function __construct(
50 private int $worldMinY,
51 private int $worldMaxY
54 public function getGenerator() :
Generator{
return $this->generator; }
56 public function getWorldMinY() :
int{
return $this->worldMinY; }
58 public function getWorldMaxY() :
int{
return $this->worldMaxY; }