World: added setDisplayName()

this is an obvious use case, and I'm not really sure why it wasn't supported sooner.
This commit is contained in:
Dylan K. Taylor
2023-05-01 16:29:07 +01:00
parent 29694c19af
commit 096daef0d0
4 changed files with 65 additions and 0 deletions

View File

@ -34,6 +34,8 @@ interface WorldData{
public function getName() : string;
public function setName(string $value) : void;
/**
* Returns the generator name
*/

View File

@ -116,6 +116,10 @@ abstract class BaseNbtWorldData implements WorldData{
return $this->compoundTag->getString(self::TAG_LEVEL_NAME);
}
public function setName(string $value) : void{
$this->compoundTag->setString(self::TAG_LEVEL_NAME, $value);
}
public function getGenerator() : string{
return $this->compoundTag->getString(self::TAG_GENERATOR_NAME, "DEFAULT");
}