Preparing to merge

This commit is contained in:
Shoghi Cervantes 2014-06-05 01:22:04 +02:00
parent 596f4ddb0e
commit 2674902eaa
11 changed files with 15 additions and 56 deletions

View File

@ -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;
}
}*/

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -274,8 +274,6 @@ abstract class Command{
}
/**
* TODO: static::broadcastCommandMessage()
*
* @param CommandSender $source
* @param string $message
* @param bool $sendToSource

View File

@ -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);

View File

@ -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;
}