mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 10:19:39 +00:00
Fixed Mojang world converters barfing on PocketMine-MP generated McRegion worlds
blame @shoghicp
This commit is contained in:
parent
0f174f7605
commit
0207b22110
@ -156,6 +156,10 @@ class Anvil extends McRegion{
|
||||
return "anvil";
|
||||
}
|
||||
|
||||
public static function getPcWorldFormatVersion() : int{
|
||||
return 19133; //anvil
|
||||
}
|
||||
|
||||
public function getWorldHeight() : int{
|
||||
//TODO: add world height options
|
||||
return 256;
|
||||
|
@ -210,6 +210,14 @@ class McRegion extends BaseLevelProvider{
|
||||
return "mcregion";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the storage version as per Minecraft PC world formats.
|
||||
* @return int
|
||||
*/
|
||||
public static function getPcWorldFormatVersion() : int{
|
||||
return 19132; //mcregion
|
||||
}
|
||||
|
||||
public function getWorldHeight() : int{
|
||||
//TODO: add world height options
|
||||
return 128;
|
||||
@ -251,7 +259,7 @@ class McRegion extends BaseLevelProvider{
|
||||
"SpawnX" => new IntTag("SpawnX", 256),
|
||||
"SpawnY" => new IntTag("SpawnY", 70),
|
||||
"SpawnZ" => new IntTag("SpawnZ", 256),
|
||||
"version" => new IntTag("version", 19133),
|
||||
"version" => new IntTag("version", static::getPcWorldFormatVersion()),
|
||||
"DayTime" => new IntTag("DayTime", 0),
|
||||
"LastPlayed" => new LongTag("LastPlayed", microtime(true) * 1000),
|
||||
"RandomSeed" => new LongTag("RandomSeed", $seed),
|
||||
|
@ -150,4 +150,8 @@ class PMAnvil extends Anvil{
|
||||
public static function getProviderName() : string{
|
||||
return "pmanvil";
|
||||
}
|
||||
|
||||
public static function getPcWorldFormatVersion() : int{
|
||||
return -1; //Not a PC format, only PocketMine-MP
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user