mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 23:15:29 +00:00
JavaWorldData: remove Bedrock-compatible hacks
we don't need these, since we don't write to Java world formats anymore anyway.
This commit is contained in:
parent
58eec637c1
commit
b27c47335c
@ -55,9 +55,7 @@ class JavaWorldData extends BaseNbtWorldData{
|
|||||||
private const TAG_HARDCORE = "hardcore";
|
private const TAG_HARDCORE = "hardcore";
|
||||||
private const TAG_INITIALIZED = "initialized";
|
private const TAG_INITIALIZED = "initialized";
|
||||||
private const TAG_LAST_PLAYED = "LastPlayed";
|
private const TAG_LAST_PLAYED = "LastPlayed";
|
||||||
private const TAG_LIGHTNING_LEVEL = "lightningLevel";
|
|
||||||
private const TAG_RAINING = "raining";
|
private const TAG_RAINING = "raining";
|
||||||
private const TAG_RAIN_LEVEL = "rainLevel";
|
|
||||||
private const TAG_RAIN_TIME = "rainTime";
|
private const TAG_RAIN_TIME = "rainTime";
|
||||||
private const TAG_ROOT_DATA = "Data";
|
private const TAG_ROOT_DATA = "Data";
|
||||||
private const TAG_SIZE_ON_DISK = "SizeOnDisk";
|
private const TAG_SIZE_ON_DISK = "SizeOnDisk";
|
||||||
@ -151,16 +149,11 @@ class JavaWorldData extends BaseNbtWorldData{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getRainLevel() : float{
|
public function getRainLevel() : float{
|
||||||
if(($rainLevelTag = $this->compoundTag->getTag(self::TAG_RAIN_LEVEL)) instanceof FloatTag){ //PocketMine/MCPE
|
return (float) $this->compoundTag->getByte(self::TAG_RAINING, 0);
|
||||||
return $rainLevelTag->getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
return (float) $this->compoundTag->getByte(self::TAG_RAINING, 0); //PC vanilla
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setRainLevel(float $level) : void{
|
public function setRainLevel(float $level) : void{
|
||||||
$this->compoundTag->setFloat(self::TAG_RAIN_LEVEL, $level); //PocketMine/MCPE
|
$this->compoundTag->setByte(self::TAG_RAINING, (int) ceil($level));
|
||||||
$this->compoundTag->setByte(self::TAG_RAINING, (int) ceil($level)); //PC vanilla
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLightningTime() : int{
|
public function getLightningTime() : int{
|
||||||
@ -172,15 +165,10 @@ class JavaWorldData extends BaseNbtWorldData{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getLightningLevel() : float{
|
public function getLightningLevel() : float{
|
||||||
if(($lightningLevelTag = $this->compoundTag->getTag(self::TAG_LIGHTNING_LEVEL)) instanceof FloatTag){ //PocketMine/MCPE
|
return (float) $this->compoundTag->getByte(self::TAG_THUNDERING, 0);
|
||||||
return $lightningLevelTag->getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
return (float) $this->compoundTag->getByte(self::TAG_THUNDERING, 0); //PC vanilla
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLightningLevel(float $level) : void{
|
public function setLightningLevel(float $level) : void{
|
||||||
$this->compoundTag->setFloat(self::TAG_LIGHTNING_LEVEL, $level); //PocketMine/MCPE
|
$this->compoundTag->setByte(self::TAG_THUNDERING, (int) ceil($level));
|
||||||
$this->compoundTag->setByte(self::TAG_THUNDERING, (int) ceil($level)); //PC vanilla
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user