New VIEW gamemode

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-18 16:40:30 +02:00
parent 5848d283da
commit 3577667039
10 changed files with 58 additions and 32 deletions

View file

@ -191,7 +191,7 @@ abstract class Block extends Vector3{
}
public function getBreakTime(Item $item, Player $player){
if($player->gamemode === CREATIVE){
if(($player->gamemode & 0x01) === 0x01){
return 0.25;
}
return $this->breakTime;

View file

@ -32,7 +32,7 @@ class BedrockBlock extends SolidBlock{
}
public function isBreakable(Item $item, Player $player){
if($player->gamemode === CREATIVE){
if(($player->gamemode & 0x01) === 0x01){
return true;
}
return false;

View file

@ -60,7 +60,7 @@ class PaintingItem extends Item{
$server = ServerAPI::request();
$e = $server->api->entity->add(ENTITY_OBJECT, OBJECT_PAINTING, $data);
$server->api->entity->spawnToAll($e->eid);
if($player->gamemode !== CREATIVE){
if(($player->gamemode & 0x01) === 0x00){
$player->removeItem($this->getID(), $this->getMetadata(), 1);
}
return true;