project uses tabs instead of spaces(as in CONTRIBUTING.md)

This commit is contained in:
GameHerobrine 2022-12-26 07:01:28 +03:00
parent f00318b6ed
commit 62571f26cd
115 changed files with 2291 additions and 2364 deletions

View file

@ -29,7 +29,7 @@ class PaintingItem extends Item{
array("Flaming Skull", 4, 4),
);
private static $direction = array(2, 0, 1, 3);
private static $right = array(4, 5, 3, 2);
private static $right = array(4, 5, 3, 2);
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($target->isTransparent === false and $face > 1 and $block->isSolid === false){
@ -56,17 +56,17 @@ class PaintingItem extends Item{
for($y = 0; $y <= $motive[2]; $y++){
if ($target->getSide(PaintingItem::$right[$face - 2], $x)->isTransparent || $target->getSide(1, $y)->isTransparent
|| $block->getSide(PaintingItem::$right[$face - 2], $x)->isSolid || $block->getSide(1, $y)->isSolid) {
$valid = false;
$valid = false;
break;
}
}
}
if(!$valid){
break;
}
}
if ($valid) {
$validMotives[] = $motive;
}
$validMotives[] = $motive;
}
}
$motive = $validMotives[array_rand($validMotives)];
$data = array(

View file

@ -2,7 +2,7 @@
class SignItem extends Item{
public function __construct($meta = 0, $count = 1){
parent::__construct(SIGN, 0, $count, "Sign");
parent::__construct(SIGN, 0, $count, "Sign");
$this->block = BlockAPI::get(SIGN_POST);
$this->maxStackSize = 16;
}

View file

@ -8,18 +8,18 @@ class SpawnEggItem extends Item{
}
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$ageable = $this->meta === MOB_CHICKEN || $this->meta === MOB_COW || $this->meta === MOB_SHEEP || $this->meta === MOB_PIG;
$data = array(
"x" => $block->x + 0.5,
"y" => $block->y,
"z" => $block->z + 0.5,
"IsBaby" => $ageable ? Utils::chance(5) ? 1 : 0 : 0
);
$e = ServerAPI::request()->api->entity->add($block->level, ENTITY_MOB, $this->meta, $data);
ServerAPI::request()->api->entity->spawnToAll($e);
if(($player->gamemode & 0x01) === 0){
-- $this->count;
}
return true;
$ageable = $this->meta === MOB_CHICKEN || $this->meta === MOB_COW || $this->meta === MOB_SHEEP || $this->meta === MOB_PIG;
$data = array(
"x" => $block->x + 0.5,
"y" => $block->y,
"z" => $block->z + 0.5,
"IsBaby" => $ageable ? Utils::chance(5) ? 1 : 0 : 0
);
$e = ServerAPI::request()->api->entity->add($block->level, ENTITY_MOB, $this->meta, $data);
ServerAPI::request()->api->entity->spawnToAll($e);
if(($player->gamemode & 0x01) === 0){
-- $this->count;
}
return true;
}
}