This commit is contained in:
Shoghi Cervantes 2013-06-08 12:51:28 +02:00
parent 883b18078f
commit 97dd718e4f
3 changed files with 3 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class DirtBlock extends SolidBlock{
public function onActivate(Item $item, Player $player){ public function onActivate(Item $item, Player $player){
if($item->isHoe()){ if($item->isHoe()){
if(($this->gamemode & 0x01) === 0){ if(($player->gamemode & 0x01) === 0){
$item->useOn($this); $item->useOn($this);
} }
$this->level->setBlock($this, BlockAPI::get(FARMLAND, 0)); $this->level->setBlock($this, BlockAPI::get(FARMLAND, 0));

View File

@ -44,7 +44,7 @@ class GrassBlock extends SolidBlock{
TallGrassObject::growGrass($this->level, $this, new Random()); TallGrassObject::growGrass($this->level, $this, new Random());
return true; return true;
}elseif($item->isHoe()){ }elseif($item->isHoe()){
if(($this->gamemode & 0x01) === 0){ if(($player->gamemode & 0x01) === 0){
$item->useOn($this); $item->useOn($this);
} }
$this->level->setBlock($this, new FarmlandBlock()); $this->level->setBlock($this, new FarmlandBlock());

View File

@ -171,6 +171,7 @@ class MinecraftInterface{
$raw = str_split(gzdeflate($raw, DEFLATEPACKET_LEVEL), $MTU - 9); // - 1 - 2 - 2 - 2 - 2 $raw = str_split(gzdeflate($raw, DEFLATEPACKET_LEVEL), $MTU - 9); // - 1 - 2 - 2 - 2 - 2
$count = count($raw); $count = count($raw);
$messageID = $this->chunked[$CID][0][0]++; $messageID = $this->chunked[$CID][0][0]++;
$this->chunked[$CID][0][0] &= 0xFFFF;
if(!isset($this->needCheck[$CID])){ if(!isset($this->needCheck[$CID])){
$this->needCheck[$CID] = array(); $this->needCheck[$CID] = array();
} }