mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-21 02:16:33 +00:00
Renamed old getID() calls to getId()
This commit is contained in:
parent
f0d6128282
commit
a98da3bab1
@ -1050,7 +1050,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
protected function getCreativeBlock(Item $item){
|
||||
foreach(Block::$creative as $i => $d){
|
||||
if($d[0] === $item->getID() and $d[1] === $item->getDamage()){
|
||||
if($d[0] === $item->getId() and $d[1] === $item->getDamage()){
|
||||
return $i;
|
||||
}
|
||||
}
|
||||
@ -1241,11 +1241,11 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = 0;
|
||||
$pk->target = $entity->getID();
|
||||
$pk->target = $entity->getId();
|
||||
$this->dataPacket($pk);
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = $this->getID();
|
||||
$pk->target = $entity->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->target = $entity->getId();
|
||||
Server::broadcastPacket($entity->getViewers(), $pk);
|
||||
$this->inventory->addItem(clone $item, $this);
|
||||
$entity->kill();
|
||||
@ -1264,7 +1264,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch($item->getID()){
|
||||
switch($item->getId()){
|
||||
case Item::WOOD:
|
||||
$this->awardAchievement("mineWood");
|
||||
break;
|
||||
@ -1275,11 +1275,11 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = 0;
|
||||
$pk->target = $entity->getID();
|
||||
$pk->target = $entity->getId();
|
||||
$this->dataPacket($pk);
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = $this->getID();
|
||||
$pk->target = $entity->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->target = $entity->getId();
|
||||
Server::broadcastPacket($entity->getViewers(), $pk);
|
||||
$this->inventory->addItem(clone $item, $this);
|
||||
$entity->kill();
|
||||
@ -1592,7 +1592,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
}else{
|
||||
$this->inventory->setHeldItemSlot($packet->slot); //set Air
|
||||
}
|
||||
}elseif(!isset($item) or $slot === -1 or $item->getID() !== $packet->item or $item->getDamage() !== $packet->meta){ // packet error or not implemented
|
||||
}elseif(!isset($item) or $slot === -1 or $item->getId() !== $packet->item or $item->getDamage() !== $packet->meta){ // packet error or not implemented
|
||||
$this->inventory->sendContents($this);
|
||||
break;
|
||||
}elseif($this->isCreative()){
|
||||
@ -1637,7 +1637,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
if($this->level->useItemOn($blockVector, $item, $packet->face, $packet->fx, $packet->fy, $packet->fz, $this) === true){
|
||||
break;
|
||||
}
|
||||
}elseif($this->inventory->getItemInHand()->getID() !== $packet->item or (($damage = $this->inventory->getItemInHand()->getDamage()) !== $packet->meta and $damage !== null)){
|
||||
}elseif($this->inventory->getItemInHand()->getId() !== $packet->item or (($damage = $this->inventory->getItemInHand()->getDamage()) !== $packet->meta and $damage !== null)){
|
||||
$this->inventory->sendHeldItem($this);
|
||||
}else{
|
||||
$item = $this->inventory->getItemInHand();
|
||||
@ -1658,7 +1658,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$pk->x = $target->x;
|
||||
$pk->y = $target->y;
|
||||
$pk->z = $target->z;
|
||||
$pk->block = $target->getID();
|
||||
$pk->block = $target->getId();
|
||||
$pk->meta = $target->getDamage();
|
||||
$this->dataPacket($pk);
|
||||
|
||||
@ -1666,14 +1666,14 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$pk->x = $block->x;
|
||||
$pk->y = $block->y;
|
||||
$pk->z = $block->z;
|
||||
$pk->block = $block->getID();
|
||||
$pk->block = $block->getId();
|
||||
$pk->meta = $block->getDamage();
|
||||
$this->dataPacket($pk);
|
||||
break;
|
||||
}elseif($packet->face === 0xff){
|
||||
if($this->isCreative()){
|
||||
$item = $this->inventory->getItemInHand();
|
||||
}elseif($this->inventory->getItemInHand()->getID() !== $packet->item or (($damage = $this->inventory->getItemInHand()->getDamage()) !== $packet->meta and $damage !== null)){
|
||||
}elseif($this->inventory->getItemInHand()->getId() !== $packet->item or (($damage = $this->inventory->getItemInHand()->getDamage()) !== $packet->meta and $damage !== null)){
|
||||
$this->inventory->sendHeldItem($this);
|
||||
break;
|
||||
}else{
|
||||
@ -1690,7 +1690,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
break;
|
||||
}
|
||||
|
||||
if($item->getID() === Item::SNOWBALL){
|
||||
if($item->getId() === Item::SNOWBALL){
|
||||
$nbt = new Compound("", [
|
||||
"Pos" => new Enum("Pos", [
|
||||
new Double("", $this->x),
|
||||
@ -1740,7 +1740,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
switch($packet->action){
|
||||
case 5: //Shot arrow
|
||||
if($this->inventory->getItemInHand()->getID() === Item::BOW){
|
||||
if($this->inventory->getItemInHand()->getId() === Item::BOW){
|
||||
$bow = $this->inventory->getItemInHand();
|
||||
if($this->isSurvival()){
|
||||
if(!$this->inventory->contains(Item::get(Item::ARROW, 0, 1))){
|
||||
@ -1841,7 +1841,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$pk->x = $target->x;
|
||||
$pk->y = $target->y;
|
||||
$pk->z = $target->z;
|
||||
$pk->block = $target->getID();
|
||||
$pk->block = $target->getId();
|
||||
$pk->meta = $target->getDamage();
|
||||
$this->dataPacket($pk);
|
||||
|
||||
@ -1907,7 +1907,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
];
|
||||
|
||||
$damage = [
|
||||
EntityDamageEvent::MODIFIER_BASE => isset($damageTable[$item->getID()]) ? $damageTable[$item->getID()] : 1,
|
||||
EntityDamageEvent::MODIFIER_BASE => isset($damageTable[$item->getId()]) ? $damageTable[$item->getId()] : 1,
|
||||
];
|
||||
|
||||
if($this->distance($target) > 8){
|
||||
@ -1943,8 +1943,8 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
];
|
||||
$points = 0;
|
||||
foreach($target->getInventory()->getArmorContents() as $index => $i){
|
||||
if(isset($armorValues[$i->getID()])){
|
||||
$points += $armorValues[$i->getID()];
|
||||
if(isset($armorValues[$i->getId()])){
|
||||
$points += $armorValues[$i->getId()];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1987,7 +1987,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
}
|
||||
|
||||
$pk = new AnimatePacket();
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->action = $ev->getAnimationType();
|
||||
Server::broadcastPacket($this->getViewers(), $pk);
|
||||
break;
|
||||
@ -2053,7 +2053,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
//Item::RAW_FISH => 2,
|
||||
];
|
||||
$slot = $this->inventory->getItemInHand();
|
||||
if($this->getHealth() < 20 and isset($items[$slot->getID()])){
|
||||
if($this->getHealth() < 20 and isset($items[$slot->getId()])){
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerItemConsumeEvent($this, $slot));
|
||||
if($ev->isCancelled()){
|
||||
$this->inventory->sendContents($this);
|
||||
@ -2064,10 +2064,10 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$pk->eid = 0;
|
||||
$pk->event = 9;
|
||||
$this->dataPacket($pk);
|
||||
$pk->eid = $this->getID();
|
||||
$pk->eid = $this->getId();
|
||||
Server::broadcastPacket($this->getViewers(), $pk);
|
||||
|
||||
$amount = $items[$slot->getID()];
|
||||
$amount = $items[$slot->getId()];
|
||||
$this->server->getPluginManager()->callEvent($ev = new EntityRegainHealthEvent($this, $amount, EntityRegainHealthEvent::CAUSE_EATING));
|
||||
if(!$ev->isCancelled()){
|
||||
$this->heal($ev->getAmount(), $ev);
|
||||
@ -2075,7 +2075,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
--$slot->count;
|
||||
$this->inventory->setItemInHand($slot, $this);
|
||||
if($slot->getID() === Item::MUSHROOM_STEW or $slot->getID() === Item::BEETROOT_SOUP){
|
||||
if($slot->getId() === Item::MUSHROOM_STEW or $slot->getId() === Item::BEETROOT_SOUP){
|
||||
$this->inventory->addItem(Item::get(Item::BOWL, 0, 1), $this);
|
||||
}
|
||||
}
|
||||
@ -2206,7 +2206,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$inv = $ts->getInventory();
|
||||
if($inv instanceof FurnaceInventory){
|
||||
if($ts->getSlot() === 2){
|
||||
switch($inv->getResult()->getID()){
|
||||
switch($inv->getResult()->getId()){
|
||||
case Item::IRON_INGOT:
|
||||
$this->awardAchievement("acquireIron");
|
||||
break;
|
||||
@ -2227,7 +2227,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
}
|
||||
|
||||
if($craftingGroup->execute()){
|
||||
switch($craftingGroup->getResult()->getID()){
|
||||
switch($craftingGroup->getResult()->getId()){
|
||||
case Item::WORKBENCH:
|
||||
$this->awardAchievement("buildWorkBench");
|
||||
break;
|
||||
|
@ -944,7 +944,7 @@ class Server{
|
||||
*/
|
||||
public function unloadLevel(Level $level, $forceUnload = false){
|
||||
if($level->unload($forceUnload) === true){
|
||||
unset($this->levels[$level->getID()]);
|
||||
unset($this->levels[$level->getId()]);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -995,7 +995,7 @@ class Server{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->levels[$level->getID()] = $level;
|
||||
$this->levels[$level->getId()] = $level;
|
||||
|
||||
$level->initLevel();
|
||||
|
||||
@ -1130,7 +1130,7 @@ class Server{
|
||||
$provider::generate($path, $name, $seed, $generator, $options);
|
||||
|
||||
$level = new Level($this, $name, $path, $provider);
|
||||
$this->levels[$level->getID()] = $level;
|
||||
$this->levels[$level->getId()] = $level;
|
||||
|
||||
$level->initLevel();
|
||||
|
||||
|
@ -79,13 +79,13 @@ class Bed extends Transparent{
|
||||
if(($this->meta & 0x08) === 0x08){ //This is the Top part of bed
|
||||
$b = $this;
|
||||
}else{ //Bottom Part of Bed
|
||||
if($blockNorth->getID() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
|
||||
if($blockNorth->getId() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
|
||||
$b = $blockNorth;
|
||||
}elseif($blockSouth->getID() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
|
||||
}elseif($blockSouth->getId() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
|
||||
$b = $blockSouth;
|
||||
}elseif($blockEast->getID() === $this->id and ($blockEast->meta & 0x08) === 0x08){
|
||||
}elseif($blockEast->getId() === $this->id and ($blockEast->meta & 0x08) === 0x08){
|
||||
$b = $blockEast;
|
||||
}elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){
|
||||
}elseif($blockWest->getId() === $this->id and ($blockWest->meta & 0x08) === 0x08){
|
||||
$b = $blockWest;
|
||||
}else{
|
||||
if($player instanceof Player){
|
||||
@ -138,23 +138,23 @@ class Bed extends Transparent{
|
||||
$blockWest = $this->getSide(4);
|
||||
|
||||
if(($this->meta & 0x08) === 0x08){ //This is the Top part of bed
|
||||
if($blockNorth->getID() === $this->id and $blockNorth->meta !== 0x08){ //Checks if the block ID and meta are right
|
||||
if($blockNorth->getId() === $this->id and $blockNorth->meta !== 0x08){ //Checks if the block ID and meta are right
|
||||
$this->getLevel()->setBlock($blockNorth, new Air(), true, true);
|
||||
}elseif($blockSouth->getID() === $this->id and $blockSouth->meta !== 0x08){
|
||||
}elseif($blockSouth->getId() === $this->id and $blockSouth->meta !== 0x08){
|
||||
$this->getLevel()->setBlock($blockSouth, new Air(), true, true);
|
||||
}elseif($blockEast->getID() === $this->id and $blockEast->meta !== 0x08){
|
||||
}elseif($blockEast->getId() === $this->id and $blockEast->meta !== 0x08){
|
||||
$this->getLevel()->setBlock($blockEast, new Air(), true, true);
|
||||
}elseif($blockWest->getID() === $this->id and $blockWest->meta !== 0x08){
|
||||
}elseif($blockWest->getId() === $this->id and $blockWest->meta !== 0x08){
|
||||
$this->getLevel()->setBlock($blockWest, new Air(), true, true);
|
||||
}
|
||||
}else{ //Bottom Part of Bed
|
||||
if($blockNorth->getID() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
|
||||
if($blockNorth->getId() === $this->id and ($blockNorth->meta & 0x08) === 0x08){
|
||||
$this->getLevel()->setBlock($blockNorth, new Air(), true, true);
|
||||
}elseif($blockSouth->getID() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
|
||||
}elseif($blockSouth->getId() === $this->id and ($blockSouth->meta & 0x08) === 0x08){
|
||||
$this->getLevel()->setBlock($blockSouth, new Air(), true, true);
|
||||
}elseif($blockEast->getID() === $this->id and ($blockEast->meta & 0x08) === 0x08){
|
||||
}elseif($blockEast->getId() === $this->id and ($blockEast->meta & 0x08) === 0x08){
|
||||
$this->getLevel()->setBlock($blockEast, new Air(), true, true);
|
||||
}elseif($blockWest->getID() === $this->id and ($blockWest->meta & 0x08) === 0x08){
|
||||
}elseif($blockWest->getId() === $this->id and ($blockWest->meta & 0x08) === 0x08){
|
||||
$this->getLevel()->setBlock($blockWest, new Air(), true, true);
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ class Cactus extends Transparent{
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() !== self::SAND and $down->getID() !== self::CACTUS){
|
||||
if($down->getId() !== self::SAND and $down->getId() !== self::CACTUS){
|
||||
$this->getLevel()->useBreakOn($this);
|
||||
}else{
|
||||
for($side = 2; $side <= 5; ++$side){
|
||||
@ -83,11 +83,11 @@ class Cactus extends Transparent{
|
||||
}
|
||||
}
|
||||
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
|
||||
if($this->getSide(0)->getID() !== self::CACTUS){
|
||||
if($this->getSide(0)->getId() !== self::CACTUS){
|
||||
if($this->meta == 0x0F){
|
||||
for($y = 1; $y < 3; ++$y){
|
||||
$b = $this->getLevel()->getBlock(new Vector3($this->x, $this->y + $y, $this->z));
|
||||
if($b->getID() === self::AIR){
|
||||
if($b->getId() === self::AIR){
|
||||
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($b, new Cactus()));
|
||||
if(!$ev->isCancelled()){
|
||||
$this->getLevel()->setBlock($b, $ev->getNewState(), true);
|
||||
@ -108,7 +108,7 @@ class Cactus extends Transparent{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::SAND or $down->getID() === self::CACTUS){
|
||||
if($down->getId() === self::SAND or $down->getId() === self::CACTUS){
|
||||
$block0 = $this->getSide(2);
|
||||
$block1 = $this->getSide(3);
|
||||
$block2 = $this->getSide(4);
|
||||
|
@ -64,7 +64,7 @@ class Cake extends Transparent{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() !== self::AIR){
|
||||
if($down->getId() !== self::AIR){
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
return true;
|
||||
@ -75,7 +75,7 @@ class Cake extends Transparent{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
|
||||
if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method
|
||||
$this->getLevel()->setBlock($this, new Air(), true);
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
|
@ -74,7 +74,7 @@ class Carpet extends Flowable{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() !== self::AIR){
|
||||
if($down->getId() !== self::AIR){
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
return true;
|
||||
@ -85,7 +85,7 @@ class Carpet extends Flowable{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === self::AIR){
|
||||
if($this->getSide(0)->getId() === self::AIR){
|
||||
$this->getLevel()->useBreakOn($this);
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
|
@ -35,7 +35,7 @@ abstract class Crops extends Flowable{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::FARMLAND){
|
||||
if($down->getId() === self::FARMLAND){
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
return true;
|
||||
@ -46,7 +46,7 @@ abstract class Crops extends Flowable{
|
||||
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||
if($item->getId() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||
$block = clone $this;
|
||||
$block->meta += mt_rand(2, 5);
|
||||
if($block->meta > 7){
|
||||
|
@ -40,7 +40,7 @@ class Dandelion extends Flowable{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
|
||||
if($down->getId() === 2 or $down->getId() === 3 or $down->getId() === 60){
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
return true;
|
||||
|
@ -205,7 +205,7 @@ abstract class Door extends Transparent{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
|
||||
if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method
|
||||
$this->getLevel()->setBlock($this, new Air(), false);
|
||||
if($this->getSide(1) instanceof Door){
|
||||
$this->getLevel()->setBlock($this->getSide(1), new Air(), false);
|
||||
@ -235,7 +235,7 @@ abstract class Door extends Transparent{
|
||||
$next = $this->getSide($face[(($direction + 2) % 4)]);
|
||||
$next2 = $this->getSide($face[$direction]);
|
||||
$metaUp = 0x08;
|
||||
if($next->getID() === $this->id or ($next2->isTransparent() === false and $next->isTransparent() === true)){ //Door hinge
|
||||
if($next->getId() === $this->id or ($next2->isTransparent() === false and $next->isTransparent() === true)){ //Door hinge
|
||||
$metaUp |= 0x01;
|
||||
}
|
||||
|
||||
@ -251,12 +251,12 @@ abstract class Door extends Transparent{
|
||||
public function onBreak(Item $item){
|
||||
if(($this->meta & 0x08) === 0x08){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === $this->id){
|
||||
if($down->getId() === $this->id){
|
||||
$this->getLevel()->setBlock($down, new Air(), true);
|
||||
}
|
||||
}else{
|
||||
$up = $this->getSide(1);
|
||||
if($up->getID() === $this->id){
|
||||
if($up->getId() === $this->id){
|
||||
$this->getLevel()->setBlock($up, new Air(), true);
|
||||
}
|
||||
}
|
||||
@ -268,12 +268,12 @@ abstract class Door extends Transparent{
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
if(($this->meta & 0x08) === 0x08){ //Top
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === $this->id){
|
||||
if($down->getId() === $this->id){
|
||||
$meta = $down->getDamage() ^ 0x04;
|
||||
$this->getLevel()->setBlock($down, Block::get($this->id, $meta), true);
|
||||
$players = $this->getLevel()->getUsingChunk($this->x >> 4, $this->z >> 4);
|
||||
if($player instanceof Player){
|
||||
unset($players[$player->getID()]);
|
||||
unset($players[$player->getId()]);
|
||||
}
|
||||
$pk = new LevelEventPacket();
|
||||
$pk->x = $this->x;
|
||||
@ -292,7 +292,7 @@ abstract class Door extends Transparent{
|
||||
$this->getLevel()->setBlock($this, $this, true);
|
||||
$players = $this->getLevel()->getUsingChunk($this->x >> 4, $this->z >> 4);
|
||||
if($player instanceof Player){
|
||||
unset($players[$player->getID()]);
|
||||
unset($players[$player->getId()]);
|
||||
}
|
||||
$pk = new LevelEventPacket();
|
||||
$pk->x = $this->x;
|
||||
|
@ -43,7 +43,7 @@ abstract class Fallable extends Solid{
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::AIR or ($down instanceof Liquid)){
|
||||
if($down->getId() === self::AIR or ($down instanceof Liquid)){
|
||||
$fall = Entity::createEntity("FallingSand", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), new Compound("", [
|
||||
"Pos" => new Enum("Pos", [
|
||||
new Double("", $this->x + 0.5),
|
||||
@ -59,7 +59,7 @@ abstract class Fallable extends Solid{
|
||||
new Float("", 0),
|
||||
new Float("", 0)
|
||||
]),
|
||||
"TileID" => new Int("TileID", $this->getID()),
|
||||
"TileID" => new Int("TileID", $this->getId()),
|
||||
"Data" => new Byte("Data", $this->getDamage()),
|
||||
]));
|
||||
|
||||
|
@ -76,7 +76,7 @@ class Fire extends Flowable{
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
for($s = 0; $s <= 5; ++$s){
|
||||
$side = $this->getSide($s);
|
||||
if($side->getID() !== self::AIR and !($side instanceof Liquid)){
|
||||
if($side->getId() !== self::AIR and !($side instanceof Liquid)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ class Fire extends Flowable{
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
|
||||
if($this->getSide(0)->getID() !== self::NETHERRACK){
|
||||
if($this->getSide(0)->getId() !== self::NETHERRACK){
|
||||
$this->getLevel()->setBlock($this, new Air(), true);
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
|
@ -63,7 +63,7 @@ class Grass extends Solid{
|
||||
$y = mt_rand($this->y - 2, $this->y + 2);
|
||||
$z = mt_rand($this->z - 1, $this->z + 1);
|
||||
$block = $this->getLevel()->getBlock(new Vector3($x, $y, $z));
|
||||
if($block->getID() === Block::DIRT){
|
||||
if($block->getId() === Block::DIRT){
|
||||
if($block->getSide(1) instanceof Transparent){
|
||||
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockSpreadEvent($block, $this, new Grass()));
|
||||
if(!$ev->isCancelled()){
|
||||
@ -75,7 +75,7 @@ class Grass extends Solid{
|
||||
}
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){
|
||||
if($item->getId() === Item::DYE and $item->getDamage() === 0x0F){
|
||||
$item->count--;
|
||||
TallGrassObject::growGrass($this->getLevel(), $this, new Random(mt_rand()), 8, 2);
|
||||
|
||||
|
@ -123,7 +123,7 @@ class Ladder extends Transparent{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
/*if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
|
||||
/*if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method
|
||||
Server::getInstance()->api->entity->drop($this, Item::get(LADDER, 0, 1));
|
||||
$this->getLevel()->setBlock($this, new Air(), true, true, true);
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
|
@ -61,11 +61,11 @@ class Leaves extends Transparent{
|
||||
if(isset($visited[$index])){
|
||||
return false;
|
||||
}
|
||||
if($pos->getID() === self::WOOD){
|
||||
if($pos->getId() === self::WOOD){
|
||||
return true;
|
||||
}elseif($pos->getID() === self::LEAVES and $distance < 3){
|
||||
}elseif($pos->getId() === self::LEAVES and $distance < 3){
|
||||
$visited[$index] = true;
|
||||
$down = $pos->getSide(0)->getID();
|
||||
$down = $pos->getSide(0)->getId();
|
||||
if($down === Item::WOOD){
|
||||
return true;
|
||||
}
|
||||
|
@ -49,11 +49,11 @@ class Leaves2 extends Leaves{
|
||||
if(isset($visited[$index])){
|
||||
return false;
|
||||
}
|
||||
if($pos->getID() === self::WOOD2){
|
||||
if($pos->getId() === self::WOOD2){
|
||||
return true;
|
||||
}elseif($pos->getID() === self::LEAVES2 and $distance < 3){
|
||||
}elseif($pos->getId() === self::LEAVES2 and $distance < 3){
|
||||
$visited[$index] = true;
|
||||
$down = $pos->getSide(0)->getID();
|
||||
$down = $pos->getSide(0)->getId();
|
||||
if($down === Item::WOOD2){
|
||||
return true;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ abstract class Liquid extends Transparent{
|
||||
$pos = $this->getLevel()->getBlock($pos);
|
||||
}
|
||||
|
||||
if($pos->getID() !== $this->getID()){
|
||||
if($pos->getId() !== $this->getId()){
|
||||
return -1;
|
||||
}else{
|
||||
return $pos->getDamage();
|
||||
@ -75,7 +75,7 @@ abstract class Liquid extends Transparent{
|
||||
$pos = $this->getLevel()->getBlock($pos);
|
||||
}
|
||||
|
||||
if($pos->getID() !== $this->getID()){
|
||||
if($pos->getId() !== $this->getId()){
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ abstract class Liquid extends Transparent{
|
||||
|
||||
private function flowIntoBlock(Block $block, $newFlowDecay){
|
||||
if($block->canBeFlowedInto()){
|
||||
if($block->getID() > 0){
|
||||
if($block->getId() > 0){
|
||||
$this->getLevel()->useBreakOn($block);
|
||||
}
|
||||
|
||||
|
@ -58,13 +58,13 @@ class MelonStem extends Crops{
|
||||
}else{
|
||||
for($side = 2; $side <= 5; ++$side){
|
||||
$b = $this->getSide($side);
|
||||
if($b->getID() === self::MELON_BLOCK){
|
||||
if($b->getId() === self::MELON_BLOCK){
|
||||
return Level::BLOCK_UPDATE_RANDOM;
|
||||
}
|
||||
}
|
||||
$side = $this->getSide(mt_rand(2, 5));
|
||||
$d = $side->getSide(0);
|
||||
if($side->getID() === self::AIR and ($d->getID() === self::FARMLAND or $d->getID() === self::GRASS or $d->getID() === self::DIRT)){
|
||||
if($side->getId() === self::AIR and ($d->getId() === self::FARMLAND or $d->getId() === self::GRASS or $d->getId() === self::DIRT)){
|
||||
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($side, new Melon()));
|
||||
if(!$ev->isCancelled()){
|
||||
$this->getLevel()->setBlock($side, $ev->getNewState(), true);
|
||||
|
@ -56,7 +56,7 @@ class Mycelium extends Solid{
|
||||
$y = mt_rand($this->y - 2, $this->y + 2);
|
||||
$z = mt_rand($this->z - 1, $this->z + 1);
|
||||
$block = $this->getLevel()->getBlock(new Vector3($x, $y, $z));
|
||||
if($block->getID() === Block::DIRT){
|
||||
if($block->getId() === Block::DIRT){
|
||||
if($block->getSide(1) instanceof Transparent){
|
||||
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockSpreadEvent($block, $this, new Mycelium()));
|
||||
if(!$ev->isCancelled()){
|
||||
|
@ -40,7 +40,7 @@ class Poppy extends Flowable{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){
|
||||
if($down->getId() === 2 or $down->getId() === 3 or $down->getId() === 60){
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
return true;
|
||||
|
@ -58,13 +58,13 @@ class PumpkinStem extends Crops{
|
||||
}else{
|
||||
for($side = 2; $side <= 5; ++$side){
|
||||
$b = $this->getSide($side);
|
||||
if($b->getID() === self::PUMPKIN){
|
||||
if($b->getId() === self::PUMPKIN){
|
||||
return Level::BLOCK_UPDATE_RANDOM;
|
||||
}
|
||||
}
|
||||
$side = $this->getSide(mt_rand(2, 5));
|
||||
$d = $side->getSide(0);
|
||||
if($side->getID() === self::AIR and ($d->getID() === self::FARMLAND or $d->getID() === self::GRASS or $d->getID() === self::DIRT)){
|
||||
if($side->getId() === self::AIR and ($d->getId() === self::FARMLAND or $d->getId() === self::GRASS or $d->getId() === self::DIRT)){
|
||||
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($side, new Pumpkin()));
|
||||
if(!$ev->isCancelled()){
|
||||
$this->getLevel()->setBlock($side, $ev->getNewState(), true);
|
||||
|
@ -62,7 +62,7 @@ class Sapling extends Flowable{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::GRASS or $down->getID() === self::DIRT or $down->getID() === self::FARMLAND){
|
||||
if($down->getId() === self::GRASS or $down->getId() === self::DIRT or $down->getId() === self::FARMLAND){
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
return true;
|
||||
@ -72,7 +72,7 @@ class Sapling extends Flowable{
|
||||
}
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||
if($item->getId() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||
//TODO: change log type
|
||||
Tree::growTree($this->getLevel(), $this->x, $this->y, $this->z, new Random(mt_rand()), $this->meta & 0x07);
|
||||
if(($player->gamemode & 0x01) === 0){
|
||||
|
@ -76,7 +76,7 @@ class SignPost extends Transparent{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === self::AIR){
|
||||
if($this->getSide(0)->getId() === self::AIR){
|
||||
$this->getLevel()->useBreakOn($this);
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
|
@ -77,11 +77,11 @@ class Slab extends Transparent{
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$this->meta &= 0x07;
|
||||
if($face === 0){
|
||||
if($target->getID() === self::SLAB and ($target->getDamage() & 0x08) === 0x08 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
if($target->getId() === self::SLAB and ($target->getDamage() & 0x08) === 0x08 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
}elseif($block->getID() === self::SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
}elseif($block->getId() === self::SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
@ -89,18 +89,18 @@ class Slab extends Transparent{
|
||||
$this->meta |= 0x08;
|
||||
}
|
||||
}elseif($face === 1){
|
||||
if($target->getID() === self::SLAB and ($target->getDamage() & 0x08) === 0 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
if($target->getId() === self::SLAB and ($target->getDamage() & 0x08) === 0 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
}elseif($block->getID() === self::SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
}elseif($block->getId() === self::SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
}
|
||||
//TODO: check for collision
|
||||
}else{
|
||||
if($block->getID() === self::SLAB){
|
||||
if($block->getId() === self::SLAB){
|
||||
if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true);
|
||||
|
||||
@ -115,7 +115,7 @@ class Slab extends Transparent{
|
||||
}
|
||||
}
|
||||
|
||||
if($block->getID() === self::SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
|
||||
if($block->getId() === self::SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
|
||||
return false;
|
||||
}
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
@ -59,7 +59,7 @@ class SnowLayer extends Flowable{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
|
||||
if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method
|
||||
$this->getLevel()->setBlock($this, new Air(), true);
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
|
@ -79,7 +79,7 @@ class StoneWall extends Transparent{
|
||||
}
|
||||
|
||||
public function canConnect(Block $block){
|
||||
return ($block->getID() !== self::COBBLE_WALL and $block->getID() !== self::FENCE_GATE) ? $block->isSolid() : true;
|
||||
return ($block->getId() !== self::COBBLE_WALL and $block->getId() !== self::FENCE_GATE) ? $block->isSolid() : true;
|
||||
}
|
||||
|
||||
}
|
@ -48,11 +48,11 @@ class Sugarcane extends Flowable{
|
||||
}
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
if($item->getID() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||
if($this->getSide(0)->getID() !== self::SUGARCANE_BLOCK){
|
||||
if($item->getId() === Item::DYE and $item->getDamage() === 0x0F){ //Bonemeal
|
||||
if($this->getSide(0)->getId() !== self::SUGARCANE_BLOCK){
|
||||
for($y = 1; $y < 3; ++$y){
|
||||
$b = $this->getLevel()->getBlock(new Vector3($this->x, $this->y + $y, $this->z));
|
||||
if($b->getID() === self::AIR){
|
||||
if($b->getId() === self::AIR){
|
||||
Server::getInstance()->getPluginManager()->callEvent($ev = new BlockGrowEvent($b, new Sugarcane()));
|
||||
if(!$ev->isCancelled()){
|
||||
$this->getLevel()->setBlock($b, $ev->getNewState(), true);
|
||||
@ -76,17 +76,17 @@ class Sugarcane extends Flowable{
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
$down = $this->getSide(0);
|
||||
if($down->isTransparent() === true and $down->getID() !== self::SUGARCANE_BLOCK){
|
||||
if($down->isTransparent() === true and $down->getId() !== self::SUGARCANE_BLOCK){
|
||||
$this->getLevel()->useBreakOn($this);
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
}
|
||||
}elseif($type === Level::BLOCK_UPDATE_RANDOM){
|
||||
if($this->getSide(0)->getID() !== self::SUGARCANE_BLOCK){
|
||||
if($this->getSide(0)->getId() !== self::SUGARCANE_BLOCK){
|
||||
if($this->meta === 0x0F){
|
||||
for($y = 1; $y < 3; ++$y){
|
||||
$b = $this->getLevel()->getBlock(new Vector3($this->x, $this->y + $y, $this->z));
|
||||
if($b->getID() === self::AIR){
|
||||
if($b->getId() === self::AIR){
|
||||
$this->getLevel()->setBlock($b, new Sugarcane(), true);
|
||||
break;
|
||||
}
|
||||
@ -107,11 +107,11 @@ class Sugarcane extends Flowable{
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$down = $this->getSide(0);
|
||||
if($down->getID() === self::SUGARCANE_BLOCK){
|
||||
if($down->getId() === self::SUGARCANE_BLOCK){
|
||||
$this->getLevel()->setBlock($block, new Sugarcane(), true);
|
||||
|
||||
return true;
|
||||
}elseif($down->getID() === self::GRASS or $down->getID() === self::DIRT or $down->getID() === self::SAND){
|
||||
}elseif($down->getId() === self::GRASS or $down->getId() === self::DIRT or $down->getId() === self::SAND){
|
||||
$block0 = $down->getSide(2);
|
||||
$block1 = $down->getSide(3);
|
||||
$block2 = $down->getSide(4);
|
||||
|
@ -52,7 +52,7 @@ class TNT extends Solid{
|
||||
}
|
||||
|
||||
public function onActivate(Item $item, Player $player = null){
|
||||
if($item->getID() === Item::FLINT_STEEL){
|
||||
if($item->getId() === Item::FLINT_STEEL){
|
||||
$item->useOn($this);
|
||||
$this->getLevel()->setBlock($this, new Air(), true);
|
||||
|
||||
|
@ -76,7 +76,7 @@ abstract class Thin extends Transparent{
|
||||
|
||||
|
||||
public function canConnect(Block $block){
|
||||
return $block->isSolid() or $block->getID() === $this->getID() or $block->getID() === self::GLASS_PANE or $block->getID() === self::GLASS;
|
||||
return $block->isSolid() or $block->getId() === $this->getId() or $block->getId() === self::GLASS_PANE or $block->getId() === self::GLASS;
|
||||
}
|
||||
|
||||
}
|
@ -55,7 +55,7 @@ class Torch extends Flowable{
|
||||
0 => 0,
|
||||
];
|
||||
|
||||
if($this->getSide($faces[$side])->isTransparent()=== true and !($side === 0 and $this->getSide(0)->getID() === self::FENCE)){
|
||||
if($this->getSide($faces[$side])->isTransparent()=== true and !($side === 0 and $this->getSide(0)->getId() === self::FENCE)){
|
||||
$this->getLevel()->useBreakOn($this);
|
||||
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
@ -78,7 +78,7 @@ class Torch extends Flowable{
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
return true;
|
||||
}elseif($this->getSide(0)->isTransparent() === false or $this->getSide(0)->getID() === self::FENCE){
|
||||
}elseif($this->getSide(0)->isTransparent() === false or $this->getSide(0)->getId() === self::FENCE){
|
||||
$this->meta = 0;
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
||||
|
@ -115,7 +115,7 @@ class Trapdoor extends Transparent{
|
||||
}
|
||||
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
if(($target->isTransparent() === false or $target->getID() === self::SLAB) and $face !== 0 and $face !== 1){
|
||||
if(($target->isTransparent() === false or $target->getId() === self::SLAB) and $face !== 0 and $face !== 1){
|
||||
$faces = [
|
||||
2 => 0,
|
||||
3 => 1,
|
||||
|
@ -163,7 +163,7 @@ class Vine extends Transparent{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||
/*if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
|
||||
/*if($this->getSide(0)->getId() === self::AIR){ //Replace with common break method
|
||||
Server::getInstance()->api->entity->drop($this, Item::get(LADDER, 0, 1));
|
||||
$this->getLevel()->setBlock($this, new Air(), true, true, true);
|
||||
return Level::BLOCK_UPDATE_NORMAL;
|
||||
|
@ -77,11 +77,11 @@ class WoodSlab extends Transparent{
|
||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||
$this->meta &= 0x07;
|
||||
if($face === 0){
|
||||
if($target->getID() === self::WOOD_SLAB and ($target->getDamage() & 0x08) === 0x08 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
if($target->getId() === self::WOOD_SLAB and ($target->getDamage() & 0x08) === 0x08 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
}elseif($block->getID() === self::WOOD_SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
}elseif($block->getId() === self::WOOD_SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
@ -89,17 +89,17 @@ class WoodSlab extends Transparent{
|
||||
$this->meta |= 0x08;
|
||||
}
|
||||
}elseif($face === 1){
|
||||
if($target->getID() === self::WOOD_SLAB and ($target->getDamage() & 0x08) === 0 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
if($target->getId() === self::WOOD_SLAB and ($target->getDamage() & 0x08) === 0 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
}elseif($block->getID() === self::WOOD_SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
}elseif($block->getId() === self::WOOD_SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}else{ //TODO: collision
|
||||
if($block->getID() === self::WOOD_SLAB){
|
||||
if($block->getId() === self::WOOD_SLAB){
|
||||
if(($block->getDamage() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_WOOD_SLAB, $this->meta), true);
|
||||
|
||||
@ -114,7 +114,7 @@ class WoodSlab extends Transparent{
|
||||
}
|
||||
}
|
||||
|
||||
if($block->getID() === self::WOOD_SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
|
||||
if($block->getId() === self::WOOD_SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){
|
||||
return false;
|
||||
}
|
||||
$this->getLevel()->setBlock($block, $this, true, true);
|
||||
|
@ -64,7 +64,7 @@ class GiveCommand extends VanillaCommand{
|
||||
|
||||
return true;
|
||||
}
|
||||
if($item->getID() == 0){
|
||||
if($item->getId() == 0){
|
||||
$sender->sendMessage(TextFormat::RED . "There is no item called " . $args[1] . ".");
|
||||
|
||||
return true;
|
||||
@ -78,7 +78,7 @@ class GiveCommand extends VanillaCommand{
|
||||
return true;
|
||||
}
|
||||
|
||||
Command::broadcastCommandMessage($sender, "Gave " . $player->getName() . " " . $item->getCount() . " of " . $item->getName() . " (" . $item->getID() . ":" . $item->getDamage() . ")");
|
||||
Command::broadcastCommandMessage($sender, "Gave " . $player->getName() . " " . $item->getCount() . " of " . $item->getName() . " (" . $item->getId() . ":" . $item->getDamage() . ")");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -124,7 +124,7 @@ abstract class BaseInventory implements Inventory{
|
||||
$item = clone $item;
|
||||
if($index < 0 or $index >= $this->size){
|
||||
return false;
|
||||
}elseif($item->getID() === 0 or $item->getCount() <= 0){
|
||||
}elseif($item->getId() === 0 or $item->getCount() <= 0){
|
||||
return $this->clear($index, $source);
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ abstract class BaseInventory implements Inventory{
|
||||
|
||||
public function firstEmpty(){
|
||||
for($i = 0; $i < $this->size; ++$i){
|
||||
if($this->getItem($i)->getID() === Item::AIR){
|
||||
if($this->getItem($i)->getId() === Item::AIR){
|
||||
return $i;
|
||||
}
|
||||
}
|
||||
@ -212,7 +212,7 @@ abstract class BaseInventory implements Inventory{
|
||||
if(($diff = $slot->getMaxStackSize() - $slot->getCount()) > 0){
|
||||
$item->setCount($item->getCount() - $diff);
|
||||
}
|
||||
}elseif($slot->getID() === Item::AIR){
|
||||
}elseif($slot->getId() === Item::AIR){
|
||||
$item->setCount($item->getCount() - $this->getMaxStackSize());
|
||||
}
|
||||
|
||||
@ -345,7 +345,7 @@ abstract class BaseInventory implements Inventory{
|
||||
}
|
||||
$item = $ev->getNewItem();
|
||||
}
|
||||
if($item->getID() !== Item::AIR){
|
||||
if($item->getId() !== Item::AIR){
|
||||
$this->slots[$index] = clone $item;
|
||||
}else{
|
||||
unset($this->slots[$index]);
|
||||
|
@ -291,9 +291,9 @@ class CraftingManager{
|
||||
}
|
||||
|
||||
public function sort(Item $i1, Item $i2){
|
||||
if($i1->getID() > $i2->getID()){
|
||||
if($i1->getId() > $i2->getId()){
|
||||
return 1;
|
||||
}elseif($i1->getID() < $i2->getID()){
|
||||
}elseif($i1->getId() < $i2->getId()){
|
||||
return -1;
|
||||
}elseif($i1->getDamage() > $i2->getDamage()){
|
||||
return 1;
|
||||
@ -329,10 +329,10 @@ class CraftingManager{
|
||||
* @return FurnaceRecipe
|
||||
*/
|
||||
public function matchFurnaceRecipe(Item $input){
|
||||
if(isset($this->furnaceRecipes[$input->getID() . ":" . $input->getDamage()])){
|
||||
return $this->furnaceRecipes[$input->getID() . ":" . $input->getDamage()];
|
||||
}elseif(isset($this->furnaceRecipes[$input->getID() . ":?"])){
|
||||
return $this->furnaceRecipes[$input->getID() . ":?"];
|
||||
if(isset($this->furnaceRecipes[$input->getId() . ":" . $input->getDamage()])){
|
||||
return $this->furnaceRecipes[$input->getId() . ":" . $input->getDamage()];
|
||||
}elseif(isset($this->furnaceRecipes[$input->getId() . ":?"])){
|
||||
return $this->furnaceRecipes[$input->getId() . ":?"];
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -355,9 +355,9 @@ class CraftingManager{
|
||||
$ingredients = $recipe->getIngredientList();
|
||||
usort($ingredients, [$this, "sort"]);
|
||||
foreach($ingredients as $item){
|
||||
$hash .= $item->getID() . ":" . ($item->getDamage() === null ? "?" : $item->getDamage()) . "x" . $item->getCount() . ",";
|
||||
$hash .= $item->getId() . ":" . ($item->getDamage() === null ? "?" : $item->getDamage()) . "x" . $item->getCount() . ",";
|
||||
}
|
||||
$this->recipeLookup[$result->getID() . ":" . $result->getDamage()][$hash] = $recipe;
|
||||
$this->recipeLookup[$result->getId() . ":" . $result->getDamage()][$hash] = $recipe;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -365,7 +365,7 @@ class CraftingManager{
|
||||
*/
|
||||
public function registerFurnaceRecipe(FurnaceRecipe $recipe){
|
||||
$input = $recipe->getInput();
|
||||
$this->furnaceRecipes[$input->getID() . ":" . ($input->getDamage() === null ? "?" : $input->getDamage())] = $recipe;
|
||||
$this->furnaceRecipes[$input->getId() . ":" . ($input->getDamage() === null ? "?" : $input->getDamage())] = $recipe;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -379,7 +379,7 @@ class CraftingManager{
|
||||
if(!($result instanceof Item)){
|
||||
return false;
|
||||
}
|
||||
$k = $result->getID() . ":" . $result->getDamage();
|
||||
$k = $result->getId() . ":" . $result->getDamage();
|
||||
|
||||
if(!isset($this->recipeLookup[$k])){
|
||||
return false;
|
||||
@ -390,7 +390,7 @@ class CraftingManager{
|
||||
$inputCount = 0;
|
||||
foreach($input as $item){
|
||||
$inputCount += $item->getCount();
|
||||
$hash .= $item->getID() . ":" . ($item->getDamage() === null ? "?" : $item->getDamage()) . "x" . $item->getCount() . ",";
|
||||
$hash .= $item->getId() . ":" . ($item->getDamage() === null ? "?" : $item->getDamage()) . "x" . $item->getCount() . ",";
|
||||
}
|
||||
if(!isset($this->recipeLookup[$k][$hash])){
|
||||
$hasRecipe = null;
|
||||
|
@ -68,8 +68,8 @@ class PlayerInventory extends BaseInventory{
|
||||
$item = $this->getItemInHand();
|
||||
|
||||
$pk = new PlayerEquipmentPacket();
|
||||
$pk->eid = $this->getHolder()->getID();
|
||||
$pk->item = $item->getID();
|
||||
$pk->eid = $this->getHolder()->getId();
|
||||
$pk->item = $item->getId();
|
||||
$pk->meta = $item->getDamage();
|
||||
$pk->slot = $this->getHeldItemIndex();
|
||||
|
||||
@ -128,8 +128,8 @@ class PlayerInventory extends BaseInventory{
|
||||
$item = $this->getItemInHand();
|
||||
|
||||
$pk = new PlayerEquipmentPacket();
|
||||
$pk->eid = $this->getHolder()->getID();
|
||||
$pk->item = $item->getID();
|
||||
$pk->eid = $this->getHolder()->getId();
|
||||
$pk->item = $item->getId();
|
||||
$pk->meta = $item->getDamage();
|
||||
$pk->slot = 0;
|
||||
$pk->isEncoded = true;
|
||||
@ -202,7 +202,7 @@ class PlayerInventory extends BaseInventory{
|
||||
public function setItem($index, Item $item, $source = null){
|
||||
if($index < 0 or $index >= $this->size){
|
||||
return false;
|
||||
}elseif($item->getID() === 0 or $item->getCount() <= 0){
|
||||
}elseif($item->getId() === 0 or $item->getCount() <= 0){
|
||||
return $this->clear($index, $source);
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ class PlayerInventory extends BaseInventory{
|
||||
}
|
||||
$item = $ev->getNewItem();
|
||||
}
|
||||
if($item->getID() !== Item::AIR){
|
||||
if($item->getId() !== Item::AIR){
|
||||
$this->slots[$index] = clone $item;
|
||||
}else{
|
||||
unset($this->slots[$index]);
|
||||
@ -308,15 +308,15 @@ class PlayerInventory extends BaseInventory{
|
||||
$slots = [];
|
||||
|
||||
foreach($armor as $i => $slot){
|
||||
if($slot->getID() === Item::AIR){
|
||||
if($slot->getId() === Item::AIR){
|
||||
$slots[$i] = 255;
|
||||
}else{
|
||||
$slots[$i] = $slot->getID();
|
||||
$slots[$i] = $slot->getId();
|
||||
}
|
||||
}
|
||||
|
||||
$pk = new PlayerArmorEquipmentPacket();
|
||||
$pk->eid = $this->getHolder()->getID();
|
||||
$pk->eid = $this->getHolder()->getId();
|
||||
$pk->slots = $slots;
|
||||
$pk->encode();
|
||||
$pk->isEncoded = true;
|
||||
@ -346,7 +346,7 @@ class PlayerInventory extends BaseInventory{
|
||||
$items[$i] = Item::get(Item::AIR, null, 0);
|
||||
}
|
||||
|
||||
if($items[$i]->getID() === Item::AIR){
|
||||
if($items[$i]->getId() === Item::AIR){
|
||||
$this->clear($this->getSize() + $i);
|
||||
}else{
|
||||
$this->setItem($this->getSize() + $i, $items[$i]);
|
||||
@ -369,15 +369,15 @@ class PlayerInventory extends BaseInventory{
|
||||
$slots = [];
|
||||
|
||||
foreach($armor as $i => $slot){
|
||||
if($slot->getID() === Item::AIR){
|
||||
if($slot->getId() === Item::AIR){
|
||||
$slots[$i] = 255;
|
||||
}else{
|
||||
$slots[$i] = $slot->getID();
|
||||
$slots[$i] = $slot->getId();
|
||||
}
|
||||
}
|
||||
|
||||
$pk = new PlayerArmorEquipmentPacket();
|
||||
$pk->eid = $this->getHolder()->getID();
|
||||
$pk->eid = $this->getHolder()->getId();
|
||||
$pk->slots = $slots;
|
||||
$pk->encode();
|
||||
$pk->isEncoded = true;
|
||||
|
@ -93,7 +93,7 @@ class SimpleTransactionGroup implements TransactionGroup{
|
||||
*/
|
||||
protected function matchItems(array &$needItems, array &$haveItems){
|
||||
foreach($this->transactions as $key => $ts){
|
||||
if($ts->getTargetItem()->getID() !== Item::AIR){
|
||||
if($ts->getTargetItem()->getId() !== Item::AIR){
|
||||
$needItems[] = $ts->getTargetItem();
|
||||
}
|
||||
$checkSourceItem = $ts->getInventory()->getItem($ts->getSlot());
|
||||
@ -101,7 +101,7 @@ class SimpleTransactionGroup implements TransactionGroup{
|
||||
if(!$checkSourceItem->equals($sourceItem, true) or $sourceItem->getCount() !== $checkSourceItem->getCount()){
|
||||
return false;
|
||||
}
|
||||
if($sourceItem->getID() !== Item::AIR){
|
||||
if($sourceItem->getId() !== Item::AIR){
|
||||
$haveItems[] = $sourceItem;
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ class Bucket extends Item{
|
||||
if($targetBlock instanceof Air){
|
||||
if($target instanceof Liquid and $target->getDamage() === 0){
|
||||
$result = clone $this;
|
||||
$result->setDamage($target->getID());
|
||||
$result->setDamage($target->getId());
|
||||
$player->getServer()->getPluginManager()->callEvent($ev = new PlayerBucketFillEvent($player, $block, $face, $this, $result));
|
||||
if(!$ev->isCancelled()){
|
||||
$player->getLevel()->setBlock($target, new Air(), true, true);
|
||||
|
@ -38,7 +38,7 @@ class FlintSteel extends Tool{
|
||||
$player->getInventory()->setItemInHand(new Item(Item::AIR, 0, 0));
|
||||
}
|
||||
|
||||
if($block->getID() === self::AIR and ($target instanceof Solid)){
|
||||
if($block->getId() === self::AIR and ($target instanceof Solid)){
|
||||
$level->setBlock($block, new Fire(), true);
|
||||
|
||||
return true;
|
||||
|
@ -519,7 +519,7 @@ class Item{
|
||||
|
||||
if(defined(Item::class . "::" . strtoupper($b[0]))){
|
||||
$item = self::get(constant(Item::class . "::" . strtoupper($b[0])), $meta);
|
||||
if($item->getID() === self::AIR and strtoupper($b[0]) !== "AIR"){
|
||||
if($item->getId() === self::AIR and strtoupper($b[0]) !== "AIR"){
|
||||
$item = self::get(((int) $b[0]) & 0xFFFF, $meta);
|
||||
}
|
||||
}else{
|
||||
@ -656,7 +656,7 @@ class Item{
|
||||
}
|
||||
|
||||
public final function equals(Item $item, $checkDamage = false){
|
||||
return $this->id === $item->getID() and ($checkDamage === false or $this->getDamage() === $item->getDamage());
|
||||
return $this->id === $item->getId() and ($checkDamage === false or $this->getDamage() === $item->getDamage());
|
||||
}
|
||||
|
||||
}
|
@ -29,7 +29,7 @@ use pocketmine\block\Block;
|
||||
class ItemBlock extends Item{
|
||||
public function __construct(Block $block, $meta = 0, $count = 1){
|
||||
$this->block = clone $block;
|
||||
parent::__construct($block->getID(), $block->getDamage(), $count, $block->getName());
|
||||
parent::__construct($block->getId(), $block->getDamage(), $count, $block->getName());
|
||||
}
|
||||
|
||||
public function setDamage($meta){
|
||||
|
@ -82,7 +82,7 @@ class Painting extends Item{
|
||||
//$e = $server->api->entity->add($level, ENTITY_OBJECT, OBJECT_PAINTING, $data);
|
||||
//$e->spawnToAll();
|
||||
/*if(($player->gamemode & 0x01) === 0x00){
|
||||
$player->removeItem(Item::get($this->getID(), $this->getDamage(), 1));
|
||||
$player->removeItem(Item::get($this->getId(), $this->getDamage(), 1));
|
||||
}*/
|
||||
|
||||
return true;
|
||||
|
@ -46,7 +46,7 @@ abstract class Tool extends Item{
|
||||
*/
|
||||
public function useOn($object){
|
||||
if($this->isHoe()){
|
||||
if(($object instanceof Block) and ($object->getID() === self::GRASS or $object->getID() === self::DIRT)){
|
||||
if(($object instanceof Block) and ($object->getId() === self::GRASS or $object->getId() === self::DIRT)){
|
||||
$this->meta++;
|
||||
}
|
||||
}elseif(($object instanceof Entity) and !$this->isSword()){
|
||||
|
@ -407,7 +407,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
public function useChunk($X, $Z, Player $player){
|
||||
$index = Level::chunkHash($X, $Z);
|
||||
$this->loadChunk($X, $Z);
|
||||
$this->usedChunks[$index][$player->getID()] = $player;
|
||||
$this->usedChunks[$index][$player->getId()] = $player;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,7 +419,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @param Player $player
|
||||
*/
|
||||
public function freeChunk($X, $Z, Player $player){
|
||||
unset($this->usedChunks[$index = Level::chunkHash($X, $Z)][$player->getID()]);
|
||||
unset($this->usedChunks[$index = Level::chunkHash($X, $Z)][$player->getId()]);
|
||||
$this->unloadChunkRequest($X, $Z, true);
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$pk->x = $b->x;
|
||||
$pk->y = $b->y;
|
||||
$pk->z = $b->z;
|
||||
$pk->block = $b->getID();
|
||||
$pk->block = $b->getId();
|
||||
$pk->meta = $b->getDamage();
|
||||
Server::broadcastPacket($this->getUsingChunk($b->x >> 4, $b->z >> 4), $pk);
|
||||
}
|
||||
@ -1046,14 +1046,14 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
unset($this->blockCache["{$pos->x}:{$pos->y}:{$pos->z}"]);
|
||||
|
||||
if($this->getChunk($pos->x >> 4, $pos->z >> 4, true)->setBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f, $block->getID(), $block->getDamage())){
|
||||
if($this->getChunk($pos->x >> 4, $pos->z >> 4, true)->setBlock($pos->x & 0x0f, $pos->y & 0x7f, $pos->z & 0x0f, $block->getId(), $block->getDamage())){
|
||||
if(!($pos instanceof Position)){
|
||||
$pos = $this->temporalPosition->setComponents($pos->x, $pos->y, $pos->z);
|
||||
}
|
||||
$block->position($pos);
|
||||
$index = Level::chunkHash($pos->x >> 4, $pos->z >> 4);
|
||||
if(ADVANCED_CACHE == true){
|
||||
Cache::remove("world:" . $this->getID() . ":" . $index);
|
||||
Cache::remove("world:" . $this->getId() . ":" . $index);
|
||||
}
|
||||
|
||||
if($direct === true){
|
||||
@ -1061,7 +1061,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$pk->x = $pos->x;
|
||||
$pk->y = $pos->y;
|
||||
$pk->z = $pos->z;
|
||||
$pk->block = $block->getID();
|
||||
$pk->block = $block->getId();
|
||||
$pk->meta = $block->getDamage();
|
||||
|
||||
Server::broadcastPacket($this->getUsingChunk($pos->x >> 4, $pos->z >> 4), $pk);
|
||||
@ -1105,7 +1105,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
*/
|
||||
public function dropItem(Vector3 $source, Item $item, Vector3 $motion = null, $delay = 10){
|
||||
$motion = $motion === null ? new Vector3(lcg_value() * 0.2 - 0.1, 0.2, lcg_value() * 0.2 - 0.1) : $motion;
|
||||
if($item->getID() > 0 and $item->getCount() > 0){
|
||||
if($item->getId() > 0 and $item->getCount() > 0){
|
||||
$itemEntity = Entity::createEntity("Item", $this->getChunk($source->getX() >> 4, $source->getZ() >> 4), new Compound("", [
|
||||
"Pos" => new Enum("Pos", [
|
||||
new Double("", $source->getX()),
|
||||
@ -1124,7 +1124,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
]),
|
||||
"Health" => new Short("Health", 5),
|
||||
"Item" => new Compound("Item", [
|
||||
"id" => new Short("id", $item->getID()),
|
||||
"id" => new Short("id", $item->getId()),
|
||||
"Damage" => new Short("Damage", $item->getDamage()),
|
||||
"Count" => new Byte("Count", $item->getCount())
|
||||
]),
|
||||
@ -1189,7 +1189,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($level instanceof Level){
|
||||
$above = $level->getBlock(new Vector3($target->x, $target->y + 1, $target->z));
|
||||
if($above instanceof Block){
|
||||
if($above->getID() === Item::FIRE){
|
||||
if($above->getId() === Item::FIRE){
|
||||
$level->setBlock($above, new Air(), true);
|
||||
}
|
||||
}
|
||||
@ -1250,7 +1250,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
return false;
|
||||
}
|
||||
|
||||
if($target->getID() === Item::AIR){
|
||||
if($target->getId() === Item::AIR){
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1285,7 +1285,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($item->isPlaceable()){
|
||||
$hand = $item->getBlock();
|
||||
$hand->position($block);
|
||||
}elseif($block->getID() === Item::FIRE){
|
||||
}elseif($block->getId() === Item::FIRE){
|
||||
$this->setBlock($block, new Air(), true);
|
||||
|
||||
return false;
|
||||
@ -1293,7 +1293,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!($block->canBeReplaced() === true or ($hand->getID() === Item::SLAB and $block->getID() === Item::SLAB))){
|
||||
if(!($block->canBeReplaced() === true or ($hand->getId() === Item::SLAB and $block->getId() === Item::SLAB))){
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1338,7 +1338,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
return false;
|
||||
}
|
||||
|
||||
if($hand->getID() === Item::SIGN_POST or $hand->getID() === Item::WALL_SIGN){
|
||||
if($hand->getId() === Item::SIGN_POST or $hand->getId() === Item::WALL_SIGN){
|
||||
$tile = Tile::createTile("Sign", $this->getChunk($block->x >> 4, $block->z >> 4), new Compound(false, [
|
||||
"id" => new String("id", Tile::SIGN),
|
||||
"x" => new Int("x", $block->x),
|
||||
@ -1709,7 +1709,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$this->chunks[$index] = $chunk;
|
||||
}
|
||||
if(ADVANCED_CACHE == true){
|
||||
Cache::remove("world:" . $this->getID() . ":". Level::chunkHash($x, $z));
|
||||
Cache::remove("world:" . $this->getId() . ":". Level::chunkHash($x, $z));
|
||||
}
|
||||
$chunk->setChanged();
|
||||
}
|
||||
@ -1802,7 +1802,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
continue;
|
||||
}
|
||||
Level::getXZ($index, $x, $z);
|
||||
if(ADVANCED_CACHE == true and ($cache = Cache::get("world:" . $this->getID() . ":" . $index)) !== false){
|
||||
if(ADVANCED_CACHE == true and ($cache = Cache::get("world:" . $this->getId() . ":" . $index)) !== false){
|
||||
/** @var Player[] $players */
|
||||
foreach($players as $player){
|
||||
if($player->isConnected() and isset($player->usedChunks[$index])){
|
||||
@ -1830,7 +1830,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
if(isset($this->chunkSendTasks[$index])){
|
||||
|
||||
if(ADVANCED_CACHE == true){
|
||||
Cache::add("world:" . $this->getID() . ":" . $index, $payload, 60);
|
||||
Cache::add("world:" . $this->getId() . ":" . $index, $payload, 60);
|
||||
}
|
||||
foreach($this->chunkSendQueue[$index] as $player){
|
||||
/** @var Player $player */
|
||||
@ -1856,14 +1856,14 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
if($entity instanceof Player){
|
||||
unset($this->players[$entity->getID()]);
|
||||
unset($this->players[$entity->getId()]);
|
||||
//$this->everyoneSleeping();
|
||||
}else{
|
||||
$entity->kill();
|
||||
}
|
||||
|
||||
unset($this->entities[$entity->getID()]);
|
||||
unset($this->updateEntities[$entity->getID()]);
|
||||
unset($this->entities[$entity->getId()]);
|
||||
unset($this->updateEntities[$entity->getId()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1876,9 +1876,9 @@ class Level implements ChunkManager, Metadatable{
|
||||
throw new LevelException("Invalid Entity level");
|
||||
}
|
||||
if($entity instanceof Player){
|
||||
$this->players[$entity->getID()] = $entity;
|
||||
$this->players[$entity->getId()] = $entity;
|
||||
}
|
||||
$this->entities[$entity->getID()] = $entity;
|
||||
$this->entities[$entity->getId()] = $entity;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1890,7 +1890,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($tile->getLevel() !== $this){
|
||||
throw new LevelException("Invalid Tile level");
|
||||
}
|
||||
$this->tiles[$tile->getID()] = $tile;
|
||||
$this->tiles[$tile->getId()] = $tile;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1903,8 +1903,8 @@ class Level implements ChunkManager, Metadatable{
|
||||
throw new LevelException("Invalid Tile level");
|
||||
}
|
||||
|
||||
unset($this->tiles[$tile->getID()]);
|
||||
unset($this->updateTiles[$tile->getID()]);
|
||||
unset($this->tiles[$tile->getId()]);
|
||||
unset($this->updateTiles[$tile->getId()]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2005,7 +2005,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
|
||||
unset($this->chunks[$index]);
|
||||
unset($this->usedChunks[$index]);
|
||||
Cache::remove("world:" . $this->getID() . ":$index");
|
||||
Cache::remove("world:" . $this->getId() . ":$index");
|
||||
|
||||
$this->timings->doChunkUnload->stopTiming();
|
||||
|
||||
|
@ -66,7 +66,7 @@ class Anvil extends McRegion{
|
||||
}
|
||||
|
||||
public function requestChunkTask($x, $z){
|
||||
return new ChunkRequestTask($this, $this->getLevel()->getID(), $x, $z);
|
||||
return new ChunkRequestTask($this, $this->getLevel()->getId(), $x, $z);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -226,17 +226,17 @@ abstract class BaseFullChunk implements FullChunk{
|
||||
}
|
||||
|
||||
public function addEntity(Entity $entity){
|
||||
$this->entities[$entity->getID()] = $entity;
|
||||
$this->entities[$entity->getId()] = $entity;
|
||||
$this->hasChanged = true;
|
||||
}
|
||||
|
||||
public function removeEntity(Entity $entity){
|
||||
unset($this->entities[$entity->getID()]);
|
||||
unset($this->entities[$entity->getId()]);
|
||||
$this->hasChanged = true;
|
||||
}
|
||||
|
||||
public function addTile(Tile $tile){
|
||||
$this->tiles[$tile->getID()] = $tile;
|
||||
$this->tiles[$tile->getId()] = $tile;
|
||||
if(isset($this->tileList[$index = (($tile->z & 0x0f) << 12) | (($tile->x & 0x0f) << 8) | ($tile->y & 0xff)]) and $this->tileList[$index] !== $tile){
|
||||
$this->tileList[$index]->close();
|
||||
}
|
||||
@ -245,7 +245,7 @@ abstract class BaseFullChunk implements FullChunk{
|
||||
}
|
||||
|
||||
public function removeTile(Tile $tile){
|
||||
unset($this->tiles[$tile->getID()]);
|
||||
unset($this->tiles[$tile->getId()]);
|
||||
unset($this->tileList[(($tile->z & 0x0f) << 12) | (($tile->x & 0x0f) << 8) | ($tile->y & 0xff)]);
|
||||
$this->hasChanged = true;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ class Flat extends Generator{
|
||||
$b = Item::fromString($b);
|
||||
$cnt = $matches[2][$i] === "" ? 1 : intval($matches[2][$i]);
|
||||
for($cY = $y, $y += $cnt; $cY < $y; ++$cY){
|
||||
$this->structure[$cY] = [$b->getID(), $b->getDamage()];
|
||||
$this->structure[$cY] = [$b->getId(), $b->getDamage()];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,14 +55,14 @@ class GenerationInstanceManager extends GenerationRequestManager{
|
||||
* @param array $options
|
||||
*/
|
||||
public function openLevel(Level $level, $generator, array $options = []){
|
||||
$this->generationManager->openLevel($level->getID(), $level->getSeed(), $generator, $options);
|
||||
$this->generationManager->openLevel($level->getId(), $level->getSeed(), $generator, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Level $level
|
||||
*/
|
||||
public function closeLevel(Level $level){
|
||||
$this->generationManager->closeLevel($level->getID());
|
||||
$this->generationManager->closeLevel($level->getId());
|
||||
}
|
||||
|
||||
public function addNamespace($namespace, $path){
|
||||
@ -70,7 +70,7 @@ class GenerationInstanceManager extends GenerationRequestManager{
|
||||
}
|
||||
|
||||
public function requestChunk(Level $level, $chunkX, $chunkZ){
|
||||
$this->generationManager->enqueueChunk($level->getID(), $chunkX, $chunkZ);
|
||||
$this->generationManager->enqueueChunk($level->getId(), $chunkX, $chunkZ);
|
||||
}
|
||||
|
||||
public function getChunk($levelID, $chunkX, $chunkZ){
|
||||
|
@ -53,7 +53,7 @@ class GenerationRequestManager{
|
||||
* @param array $options
|
||||
*/
|
||||
public function openLevel(Level $level, $generator, array $options = []){
|
||||
$buffer = chr(GenerationManager::PACKET_OPEN_LEVEL) . Binary::writeInt($level->getID()) . Binary::writeInt($level->getSeed()) .
|
||||
$buffer = chr(GenerationManager::PACKET_OPEN_LEVEL) . Binary::writeInt($level->getId()) . Binary::writeInt($level->getSeed()) .
|
||||
Binary::writeShort(strlen($generator)) . $generator . serialize($options);
|
||||
|
||||
$this->generationThread->pushMainToThreadPacket($buffer);
|
||||
@ -63,7 +63,7 @@ class GenerationRequestManager{
|
||||
* @param Level $level
|
||||
*/
|
||||
public function closeLevel(Level $level){
|
||||
$buffer = chr(GenerationManager::PACKET_CLOSE_LEVEL) . Binary::writeInt($level->getID());
|
||||
$buffer = chr(GenerationManager::PACKET_CLOSE_LEVEL) . Binary::writeInt($level->getId());
|
||||
$this->generationThread->pushMainToThreadPacket($buffer);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ class GenerationRequestManager{
|
||||
}
|
||||
|
||||
public function requestChunk(Level $level, $chunkX, $chunkZ){
|
||||
$buffer = chr(GenerationManager::PACKET_REQUEST_CHUNK) . Binary::writeInt($level->getID()) . Binary::writeInt($chunkX) . Binary::writeInt($chunkZ);
|
||||
$buffer = chr(GenerationManager::PACKET_REQUEST_CHUNK) . Binary::writeInt($level->getId()) . Binary::writeInt($chunkX) . Binary::writeInt($chunkZ);
|
||||
$this->generationThread->pushMainToThreadPacket($buffer);
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ class Ore{
|
||||
$sizeZ **= 2;
|
||||
|
||||
if(($sizeX + $sizeY + $sizeZ) < 1 and $level->getBlockIdAt($x, $y, $z) === 1){
|
||||
$level->setBlockIdAt($x, $y, $z, $this->type->material->getID());
|
||||
$level->setBlockIdAt($x, $y, $z, $this->type->material->getId());
|
||||
$level->setBlockDataAt($x, $y, $z, $this->type->material->getDamage());
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,6 @@ class EntityMetadataStore extends MetadataStore{
|
||||
throw new \InvalidArgumentException("Argument must be an Entity instance");
|
||||
}
|
||||
|
||||
return $entity->getID() . ":" . $metadataKey;
|
||||
return $entity->getId() . ":" . $metadataKey;
|
||||
}
|
||||
}
|
@ -156,7 +156,7 @@ abstract class DataPacket extends \stdClass{
|
||||
}
|
||||
|
||||
protected function putSlot(Item $item){
|
||||
$this->putShort($item->getID());
|
||||
$this->putShort($item->getId());
|
||||
$this->putByte($item->getCount());
|
||||
$this->putShort($item->getDamage());
|
||||
}
|
||||
|
@ -129,11 +129,11 @@ class Chest extends Spawnable implements InventoryHolder, Container{
|
||||
$d = new Compound(false, [
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Byte("Slot", $index),
|
||||
new Short("id", $item->getID()),
|
||||
new Short("id", $item->getId()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
]);
|
||||
|
||||
if($item->getID() === Item::AIR or $item->getCount() <= 0){
|
||||
if($item->getId() === Item::AIR or $item->getCount() <= 0){
|
||||
if($i >= 0){
|
||||
unset($this->namedtag->Items[$i]);
|
||||
}
|
||||
|
@ -137,11 +137,11 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
$d = new Compound(false, [
|
||||
new Byte("Count", $item->getCount()),
|
||||
new Byte("Slot", $index),
|
||||
new Short("id", $item->getID()),
|
||||
new Short("id", $item->getId()),
|
||||
new Short("Damage", $item->getDamage()),
|
||||
]);
|
||||
|
||||
if($item->getID() === Item::AIR or $item->getCount() <= 0){
|
||||
if($item->getId() === Item::AIR or $item->getCount() <= 0){
|
||||
if($i >= 0){
|
||||
unset($this->namedtag->Items[$i]);
|
||||
}
|
||||
@ -176,7 +176,7 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
$this->namedtag->MaxTime = new Short("MaxTime", $ev->getBurnTime());
|
||||
$this->namedtag->BurnTime = new Short("BurnTime", $ev->getBurnTime());
|
||||
$this->namedtag->BurnTicks = new Short("BurnTicks", 0);
|
||||
if($this->getBlock()->getID() === Item::FURNACE){
|
||||
if($this->getBlock()->getId() === Item::FURNACE){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::BURNING_FURNACE, $this->getBlock()->getDamage()), true);
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
$raw = $this->inventory->getSmelting();
|
||||
$product = $this->inventory->getResult();
|
||||
$smelt = $this->server->getCraftingManager()->matchFurnaceRecipe($raw);
|
||||
$canSmelt = ($smelt instanceof FurnaceRecipe and $raw->getCount() > 0 and (($smelt->getResult()->equals($product, true) and $product->getCount() < $product->getMaxStackSize()) or $product->getID() === Item::AIR));
|
||||
$canSmelt = ($smelt instanceof FurnaceRecipe and $raw->getCount() > 0 and (($smelt->getResult()->equals($product, true) and $product->getCount() < $product->getMaxStackSize()) or $product->getId() === Item::AIR));
|
||||
|
||||
if($this->namedtag["BurnTime"] <= 0 and $canSmelt and $fuel->getFuelTime() !== null and $fuel->getCount() > 0){
|
||||
$this->checkFuel($fuel);
|
||||
@ -215,7 +215,7 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
if($smelt instanceof FurnaceRecipe and $canSmelt){
|
||||
$this->namedtag->CookTime = new Short("CookTime", $this->namedtag["CookTime"] + 1);
|
||||
if($this->namedtag["CookTime"] >= 200){ //10 seconds
|
||||
$product = Item::get($smelt->getResult()->getID(), $smelt->getResult()->getDamage(), $product->getCount() + 1);
|
||||
$product = Item::get($smelt->getResult()->getId(), $smelt->getResult()->getDamage(), $product->getCount() + 1);
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new FurnaceSmeltEvent($this, $raw, $product));
|
||||
|
||||
@ -239,7 +239,7 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
||||
}
|
||||
$ret = true;
|
||||
}else{;
|
||||
if($this->getBlock()->getID() === Item::BURNING_FURNACE){
|
||||
if($this->getBlock()->getId() === Item::BURNING_FURNACE){
|
||||
$this->getLevel()->setBlock($this, Block::get(Item::FURNACE, $this->getBlock()->getDamage()), true);
|
||||
}
|
||||
$this->namedtag->BurnTime = new Short("BurnTime", 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user