mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Continued cleanup of runtime entity NBT removal
it's no longer necessary to force-write these, since the NBT is now ephemeral. Any tag type mismatches should be dealt with on read, after which the original tag will be discarded anyway.
This commit is contained in:
parent
30fcfac8cf
commit
2ee0436f46
@ -838,7 +838,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
|
||||
public function saveNBT() : CompoundTag{
|
||||
$nbt = new CompoundTag();
|
||||
if(!($this instanceof Player)){
|
||||
$nbt->setString("id", $this->getSaveId(), true);
|
||||
$nbt->setString("id", $this->getSaveId());
|
||||
|
||||
if($this->getNameTag() !== ""){
|
||||
$nbt->setString("CustomName", $this->getNameTag());
|
||||
|
@ -769,9 +769,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
public function saveNBT() : CompoundTag{
|
||||
$nbt = parent::saveNBT();
|
||||
|
||||
$nbt->setInt("foodLevel", (int) $this->getFood(), true);
|
||||
$nbt->setFloat("foodExhaustionLevel", $this->getExhaustion(), true);
|
||||
$nbt->setFloat("foodSaturationLevel", $this->getSaturation(), true);
|
||||
$nbt->setInt("foodLevel", (int) $this->getFood());
|
||||
$nbt->setFloat("foodExhaustionLevel", $this->getExhaustion());
|
||||
$nbt->setFloat("foodSaturationLevel", $this->getSaturation());
|
||||
$nbt->setInt("foodTickTimer", $this->foodTickTimer);
|
||||
|
||||
$nbt->setInt("XpLevel", $this->getXpLevel());
|
||||
|
@ -148,7 +148,7 @@ abstract class Living extends Entity implements Damageable{
|
||||
|
||||
public function saveNBT() : CompoundTag{
|
||||
$nbt = parent::saveNBT();
|
||||
$nbt->setFloat("Health", $this->getHealth(), true);
|
||||
$nbt->setFloat("Health", $this->getHealth());
|
||||
|
||||
if(count($this->effects) > 0){
|
||||
$effects = [];
|
||||
|
@ -135,7 +135,7 @@ class FallingBlock extends Entity{
|
||||
|
||||
public function saveNBT() : CompoundTag{
|
||||
$nbt = parent::saveNBT();
|
||||
$nbt->setInt("TileID", $this->block->getId(), true);
|
||||
$nbt->setInt("TileID", $this->block->getId());
|
||||
$nbt->setByte("Data", $this->block->getDamage());
|
||||
|
||||
return $nbt;
|
||||
|
@ -76,7 +76,7 @@ class PrimedTNT extends Entity implements Explosive{
|
||||
|
||||
public function saveNBT() : CompoundTag{
|
||||
$nbt = parent::saveNBT();
|
||||
$nbt->setShort("Fuse", $this->fuse, true); //older versions incorrectly saved this as a byte
|
||||
$nbt->setShort("Fuse", $this->fuse);
|
||||
|
||||
return $nbt;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user