36 private static array $contexts = [];
38 public static function register(
self $context,
int $worldId) :
void{
39 self::$contexts[$worldId] = $context;
42 public static function unregister(
int $worldId) :
void{
43 unset(self::$contexts[$worldId]);
46 public static function fetch(
int $worldId) : ?
self{
47 return self::$contexts[$worldId] ??
null;
50 public function __construct(
52 private int $worldMinY,
53 private int $worldMaxY
56 public function getGenerator() :
Generator{
return $this->generator; }
58 public function getWorldMinY() :
int{
return $this->worldMinY; }
60 public function getWorldMaxY() :
int{
return $this->worldMaxY; }