mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Renamed NBT tags to have Tag in the name
This commit is contained in:
@ -30,9 +30,9 @@ use pocketmine\level\format\Chunk;
|
||||
use pocketmine\level\format\FullChunk;
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\level\Position;
|
||||
use pocketmine\nbt\tag\Compound;
|
||||
use pocketmine\nbt\tag\Int;
|
||||
use pocketmine\nbt\tag\String;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\nbt\tag\IntTag;
|
||||
use pocketmine\nbt\tag\StringTag;
|
||||
use pocketmine\utils\ChunkException;
|
||||
|
||||
abstract class Tile extends Position{
|
||||
@ -71,12 +71,12 @@ abstract class Tile extends Position{
|
||||
/**
|
||||
* @param string $type
|
||||
* @param FullChunk $chunk
|
||||
* @param Compound $nbt
|
||||
* @param CompoundTag $nbt
|
||||
* @param $args
|
||||
*
|
||||
* @return Tile
|
||||
*/
|
||||
public static function createTile($type, FullChunk $chunk, Compound $nbt, ...$args){
|
||||
public static function createTile($type, FullChunk $chunk, CompoundTag $nbt, ...$args){
|
||||
if(isset(self::$knownTiles[$type])){
|
||||
$class = self::$knownTiles[$type];
|
||||
return new $class($chunk, $nbt, ...$args);
|
||||
@ -110,7 +110,7 @@ abstract class Tile extends Position{
|
||||
return self::$shortNames[static::class];
|
||||
}
|
||||
|
||||
public function __construct(FullChunk $chunk, Compound $nbt){
|
||||
public function __construct(FullChunk $chunk, CompoundTag $nbt){
|
||||
if($chunk === null or $chunk->getProvider() === null){
|
||||
throw new ChunkException("Invalid garbage Chunk given to Tile");
|
||||
}
|
||||
@ -138,10 +138,10 @@ abstract class Tile extends Position{
|
||||
}
|
||||
|
||||
public function saveNBT(){
|
||||
$this->namedtag->id = new String("id", $this->getSaveId());
|
||||
$this->namedtag->x = new Int("x", $this->x);
|
||||
$this->namedtag->y = new Int("y", $this->y);
|
||||
$this->namedtag->z = new Int("z", $this->z);
|
||||
$this->namedtag->id = new StringTag("id", $this->getSaveId());
|
||||
$this->namedtag->x = new IntTag("x", $this->x);
|
||||
$this->namedtag->y = new IntTag("y", $this->y);
|
||||
$this->namedtag->z = new IntTag("z", $this->z);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user