From 2674902eaa2b9686f59db5ef06cd25d9261c3672 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 5 Jun 2014 01:22:04 +0200 Subject: [PATCH] Preparing to merge --- src/pocketmine/Player.php | 28 ------------------- src/pocketmine/block/Beetroot.php | 5 ++-- src/pocketmine/block/BrownMushroom.php | 3 +- src/pocketmine/block/Carpet.php | 5 ++-- src/pocketmine/block/CyanFlower.php | 5 ++-- src/pocketmine/block/Leaves.php | 6 ++-- src/pocketmine/block/MelonStem.php | 5 ++-- src/pocketmine/block/Potato.php | 5 ++-- src/pocketmine/command/Command.php | 2 -- .../command/defaults/VanillaCommand.php | 5 ++-- .../inventory/DoubleChestInventory.php | 2 -- 11 files changed, 15 insertions(+), 56 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 81dc61982..295d3a6d7 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -81,12 +81,10 @@ use pocketmine\scheduler\CallbackTask; use pocketmine\tile\Sign; use pocketmine\tile\Spawnable; use pocketmine\tile\Tile; -use pocketmine\utils\Binary; use pocketmine\utils\TextFormat; /** * Main class that handles networking, recovery, and packet sending to the server part - * TODO: Move reliability layer */ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ @@ -729,19 +727,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ } } break; - case "tile.container.slot": - if($data["tile"]->getLevel() === $this->getLevel()){ - foreach($this->windows as $id => $w){ - if($w === $data["tile"]){ - $pk = new ContainerSetSlotPacket; - $pk->windowid = $id; - $pk->slot = $data["slot"] + (isset($data["offset"]) ? $data["offset"] : 0); - $pk->item = $data["slotdata"]; - $this->dataPacket($pk); - } - } - } - break; case "entity.metadata": if($data->getID() === $this->id){ $eid = 0; @@ -755,19 +740,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->dataPacket($pk); } break; - case "entity.event": - if($data["entity"]->getID() === $this->id){ - $eid = 0; - }else{ - $eid = $data["entity"]->getID(); - } - if($data["entity"]->getLevel() === $this->getLevel()){ - $pk = new EntityEventPacket; - $pk->eid = $eid; - $pk->event = $data["event"]; - $this->dataPacket($pk); - } - break; } }*/ diff --git a/src/pocketmine/block/Beetroot.php b/src/pocketmine/block/Beetroot.php index 20c6bfc9c..b26c68716 100644 --- a/src/pocketmine/block/Beetroot.php +++ b/src/pocketmine/block/Beetroot.php @@ -57,9 +57,8 @@ class Beetroot extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace with common break method - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get(BEETROOT_SEEDS, 0, 1)); + if($this->getSide(0)->isTransparent === true){ //TODO: Replace with common break method + $this->getLevel()->dropItem($this, Item::get(Item::BEETROOT_SEEDS, 0, 1)); $this->getLevel()->setBlock($this, new Air(), false, false, true); return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/block/BrownMushroom.php b/src/pocketmine/block/BrownMushroom.php index 5f07c2912..b06232293 100644 --- a/src/pocketmine/block/BrownMushroom.php +++ b/src/pocketmine/block/BrownMushroom.php @@ -34,8 +34,7 @@ class BrownMushroom extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ if($this->getSide(0)->isTransparent === true){ //Replace with common break method - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get($this->id)); + $this->getLevel()->dropItem($this, Item::get($this->id)); $this->getLevel()->setBlock($this, new Air(), false, false, true); return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/block/Carpet.php b/src/pocketmine/block/Carpet.php index 9cb5d3ccc..0159e45cf 100644 --- a/src/pocketmine/block/Carpet.php +++ b/src/pocketmine/block/Carpet.php @@ -65,9 +65,8 @@ class Carpet extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get($this->id, $this->meta, 1)); + if($this->getSide(0)->getID() === self::AIR){ //TODO: Replace with common break method + $this->getLevel()->dropItem($this, Item::get($this->id, $this->meta, 1)); $this->getLevel()->setBlock($this, new Air(), true, false, true); return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/block/CyanFlower.php b/src/pocketmine/block/CyanFlower.php index 5d43e6d75..af93a48f4 100644 --- a/src/pocketmine/block/CyanFlower.php +++ b/src/pocketmine/block/CyanFlower.php @@ -44,9 +44,8 @@ class CyanFlower extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace with common break method - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get($this->id)); + if($this->getSide(0)->isTransparent === true){ //TODO: Replace with common break method + $this->getLevel()->dropItem($this, Item::get($this->id, 0, 1)); $this->getLevel()->setBlock($this, new Air(), false, false, true); return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/block/Leaves.php b/src/pocketmine/block/Leaves.php index a01dbf12b..5232bd57d 100644 --- a/src/pocketmine/block/Leaves.php +++ b/src/pocketmine/block/Leaves.php @@ -124,12 +124,10 @@ class Leaves extends Transparent{ }else{ $this->getLevel()->setBlock($this, new Air(), false, false, true); if(mt_rand(1, 20) === 1){ //Saplings - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get(Item::SAPLING, $this->meta & 0x03, 1)); + $this->getLevel()->dropItem($this, Item::get($this->id, $this->meta & 0x03, 1)); } if(($this->meta & 0x03) === self::OAK and mt_rand(1, 200) === 1){ //Apples - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get(Item::APPLE, 0, 1)); + $this->getLevel()->dropItem($this, Item::get(Item::APPLE, 0, 1)); } return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/block/MelonStem.php b/src/pocketmine/block/MelonStem.php index e35c0c5e6..672db32a0 100644 --- a/src/pocketmine/block/MelonStem.php +++ b/src/pocketmine/block/MelonStem.php @@ -45,9 +45,8 @@ class MelonStem extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace with common break method - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get(MELON_SEEDS, 0, mt_rand(0, 2))); + if($this->getSide(0)->isTransparent === true){ //TODO: Replace with common break method + $this->getLevel()->dropItem($this, Item::get(Item::MELON_SEEDS, 0, mt_rand(0, 2))); $this->getLevel()->setBlock($this, new Air(), false, false, true); return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/block/Potato.php b/src/pocketmine/block/Potato.php index ba2abd832..c5cdf93b5 100644 --- a/src/pocketmine/block/Potato.php +++ b/src/pocketmine/block/Potato.php @@ -59,9 +59,8 @@ class Potato extends Flowable{ public function onUpdate($type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace with common break method - //TODO - //Server::getInstance()->api->entity->drop($this, Item::get(POTATO, 0, 1)); + if($this->getSide(0)->isTransparent === true){ //TODO: Replace with common break method + $this->getLevel()->dropItem($this, Item::get(Item::POTATO, 0, 1)); $this->getLevel()->setBlock($this, new Air(), false, false, true); return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/command/Command.php b/src/pocketmine/command/Command.php index 538571b96..d2a65b670 100644 --- a/src/pocketmine/command/Command.php +++ b/src/pocketmine/command/Command.php @@ -274,8 +274,6 @@ abstract class Command{ } /** - * TODO: static::broadcastCommandMessage() - * * @param CommandSender $source * @param string $message * @param bool $sendToSource diff --git a/src/pocketmine/command/defaults/VanillaCommand.php b/src/pocketmine/command/defaults/VanillaCommand.php index f0510fa21..ba74e7584 100644 --- a/src/pocketmine/command/defaults/VanillaCommand.php +++ b/src/pocketmine/command/defaults/VanillaCommand.php @@ -25,9 +25,8 @@ use pocketmine\command\Command; use pocketmine\command\CommandSender; abstract class VanillaCommand extends Command{ - //TODO: increment chunk indexes - const MAX_COORD = 524288; - const MIN_COORD = -524288; + const MAX_COORD = 30000000; + const MIN_COORD = -30000000; public function __construct($name, $description = "", $usageMessage = null, array $aliases = []){ parent::__construct($name, $description, $usageMessage, $aliases); diff --git a/src/pocketmine/inventory/DoubleChestInventory.php b/src/pocketmine/inventory/DoubleChestInventory.php index e56056336..3e3351def 100644 --- a/src/pocketmine/inventory/DoubleChestInventory.php +++ b/src/pocketmine/inventory/DoubleChestInventory.php @@ -36,12 +36,10 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{ BaseInventory::__construct($this, InventoryType::get(InventoryType::DOUBLE_CHEST)); } - //TODO public function getInventory(){ return $this; } - //TODO public function getHolder(){ return $this->left; }