mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Renamed old getID() calls to getId()
This commit is contained in:
@@ -65,7 +65,7 @@ class Arrow extends Projectile{
|
||||
public function spawnTo(Player $player){
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->type = Arrow::NETWORK_ID;
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
@@ -312,8 +312,8 @@ abstract class Entity extends Location implements Metadatable{
|
||||
* @param Player $player
|
||||
*/
|
||||
public function spawnTo(Player $player){
|
||||
if(!isset($this->hasSpawned[$player->getID()]) and isset($player->usedChunks[Level::chunkHash($this->chunk->getX(), $this->chunk->getZ())])){
|
||||
$this->hasSpawned[$player->getID()] = $player;
|
||||
if(!isset($this->hasSpawned[$player->getId()]) and isset($player->usedChunks[Level::chunkHash($this->chunk->getX(), $this->chunk->getZ())])){
|
||||
$this->hasSpawned[$player->getId()] = $player;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,11 +347,11 @@ abstract class Entity extends Location implements Metadatable{
|
||||
* @param Player $player
|
||||
*/
|
||||
public function despawnFrom(Player $player){
|
||||
if(isset($this->hasSpawned[$player->getID()])){
|
||||
if(isset($this->hasSpawned[$player->getId()])){
|
||||
$pk = new RemoveEntityPacket();
|
||||
$pk->eid = $this->id;
|
||||
$player->dataPacket($pk);
|
||||
unset($this->hasSpawned[$player->getID()]);
|
||||
unset($this->hasSpawned[$player->getId()]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1117,10 +1117,10 @@ abstract class Entity extends Location implements Metadatable{
|
||||
if(!$this->justCreated){
|
||||
$newChunk = $this->level->getUsingChunk($this->x >> 4, $this->z >> 4);
|
||||
foreach($this->hasSpawned as $player){
|
||||
if(!isset($newChunk[$player->getID()])){
|
||||
if(!isset($newChunk[$player->getId()])){
|
||||
$this->despawnFrom($player);
|
||||
}else{
|
||||
unset($newChunk[$player->getID()]);
|
||||
unset($newChunk[$player->getId()]);
|
||||
}
|
||||
}
|
||||
foreach($newChunk as $player){
|
||||
@@ -1273,7 +1273,7 @@ abstract class Entity extends Location implements Metadatable{
|
||||
}
|
||||
|
||||
public function __toString(){
|
||||
return (new \ReflectionClass($this))->getShortName() . "(" . $this->getID() . ")";
|
||||
return (new \ReflectionClass($this))->getShortName() . "(" . $this->getId() . ")";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -88,7 +88,7 @@ class FallingSand extends Entity{
|
||||
if(!$this->dead){
|
||||
if($this->ticksLived === 1){
|
||||
$block = $this->level->getBlock($pos = (new Vector3($this->x, $this->y, $this->z))->floor());
|
||||
if($block->getID() != $this->blockId){
|
||||
if($block->getId() != $this->blockId){
|
||||
$this->kill();
|
||||
return true;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ class FallingSand extends Entity{
|
||||
public function spawnTo(Player $player){
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->type = FallingSand::NETWORK_ID;
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
@@ -99,13 +99,13 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$hotbarSlot = $this->inventory->getHotbarSlotIndex($slot);
|
||||
if($hotbarSlot !== -1){
|
||||
$item = $this->inventory->getItem($hotbarSlot);
|
||||
if($item->getID() !== 0 and $item->getCount() > 0){
|
||||
if($item->getId() !== 0 and $item->getCount() > 0){
|
||||
$this->namedtag->Inventory[$slot] = new Compound(false, [
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
new Byte("Slot", $slot),
|
||||
new Byte("TrueSlot", $hotbarSlot),
|
||||
new Short("id", $item->getID()),
|
||||
new Short("id", $item->getId()),
|
||||
]);
|
||||
continue;
|
||||
}
|
||||
@@ -128,19 +128,19 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
new Byte("Slot", $slot),
|
||||
new Short("id", $item->getID()),
|
||||
new Short("id", $item->getId()),
|
||||
]);
|
||||
}
|
||||
|
||||
//Armor
|
||||
for($slot = 100; $slot < 104; ++$slot){
|
||||
$item = $this->inventory->getItem($this->inventory->getSize() + $slot - 100);
|
||||
if($item instanceof ItemItem and $item->getID() !== ItemItem::AIR){
|
||||
if($item instanceof ItemItem and $item->getId() !== ItemItem::AIR){
|
||||
$this->namedtag->Inventory[$slot] = new Compound(false, [
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
new Byte("Slot", $slot),
|
||||
new Short("id", $item->getID()),
|
||||
new Short("id", $item->getId()),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -148,8 +148,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
}
|
||||
|
||||
public function spawnTo(Player $player){
|
||||
if($player !== $this and !isset($this->hasSpawned[$player->getID()])){
|
||||
$this->hasSpawned[$player->getID()] = $player;
|
||||
if($player !== $this and !isset($this->hasSpawned[$player->getId()])){
|
||||
$this->hasSpawned[$player->getId()] = $player;
|
||||
|
||||
$pk = new AddPlayerPacket();
|
||||
$pk->clientID = 0;
|
||||
@@ -158,14 +158,14 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
}else{
|
||||
$pk->username = $this->nameTag;
|
||||
}
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$item = $this->getInventory()->getItemInHand();
|
||||
$pk->item = $item->getID();
|
||||
$pk->item = $item->getId();
|
||||
$pk->meta = $item->getDamage();
|
||||
$pk->metadata = $this->getData();
|
||||
$player->dataPacket($pk);
|
||||
@@ -177,12 +177,12 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
}
|
||||
|
||||
public function despawnFrom(Player $player){
|
||||
if(isset($this->hasSpawned[$player->getID()])){
|
||||
if(isset($this->hasSpawned[$player->getId()])){
|
||||
$pk = new RemovePlayerPacket();
|
||||
$pk->eid = $this->id;
|
||||
$pk->clientID = 0;
|
||||
$player->dataPacket($pk);
|
||||
unset($this->hasSpawned[$player->getID()]);
|
||||
unset($this->hasSpawned[$player->getId()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -147,7 +147,7 @@ class Item extends Entity{
|
||||
public function saveNBT(){
|
||||
parent::saveNBT();
|
||||
$this->namedtag->Item = new Compound("Item", [
|
||||
"id" => new Short("id", $this->item->getID()),
|
||||
"id" => new Short("id", $this->item->getId()),
|
||||
"Damage" => new Short("Damage", $this->item->getDamage()),
|
||||
"Count" => new Byte("Count", $this->item->getCount())
|
||||
]);
|
||||
@@ -226,7 +226,7 @@ class Item extends Entity{
|
||||
|
||||
public function spawnTo(Player $player){
|
||||
$pk = new AddItemEntityPacket();
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
@@ -94,7 +94,7 @@ abstract class Living extends Entity implements Damageable{
|
||||
}
|
||||
|
||||
$pk = new EntityEventPacket();
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->event = 2; //Ouch!
|
||||
Server::broadcastPacket($this->hasSpawned, $pk);
|
||||
$this->setLastDamageCause($source);
|
||||
@@ -213,7 +213,7 @@ abstract class Living extends Entity implements Damageable{
|
||||
--$nextIndex;
|
||||
}
|
||||
|
||||
$id = $block->getID();
|
||||
$id = $block->getId();
|
||||
|
||||
if($transparent === null){
|
||||
if($id !== 0){
|
||||
|
@@ -139,7 +139,7 @@ class PrimedTNT extends Entity implements Explosive{
|
||||
public function spawnTo(Player $player){
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->type = PrimedTNT::NETWORK_ID;
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
@@ -64,7 +64,7 @@ class Snowball extends Projectile{
|
||||
public function spawnTo(Player $player){
|
||||
$pk = new AddEntityPacket();
|
||||
$pk->type = Snowball::NETWORK_ID;
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
|
@@ -53,7 +53,7 @@ class Villager extends Creature implements NPC, Ageable{
|
||||
|
||||
public function spawnTo(Player $player){
|
||||
$pk = new AddMobPacket();
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->type = Villager::NETWORK_ID;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
|
@@ -41,7 +41,7 @@ class Zombie extends Monster{
|
||||
public function spawnTo(Player $player){
|
||||
|
||||
$pk = new AddMobPacket();
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->type = Zombie::NETWORK_ID;
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
|
Reference in New Issue
Block a user