mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Merge branch 'release/3.3'
This commit is contained in:
commit
960fdb433e
@ -147,12 +147,18 @@ namespace pocketmine {
|
|||||||
define('pocketmine\PATH', dirname(__FILE__, 3) . DIRECTORY_SEPARATOR);
|
define('pocketmine\PATH', dirname(__FILE__, 3) . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
define('pocketmine\COMPOSER_AUTOLOADER_PATH', \pocketmine\PATH . 'vendor/autoload.php');
|
$opts = getopt("", ["bootstrap:"]);
|
||||||
|
if(isset($opts["bootstrap"])){
|
||||||
|
$bootstrap = $opts["bootstrap"];
|
||||||
|
}else{
|
||||||
|
$bootstrap = \pocketmine\PATH . 'vendor/autoload.php';
|
||||||
|
}
|
||||||
|
define('pocketmine\COMPOSER_AUTOLOADER_PATH', realpath($bootstrap));
|
||||||
|
|
||||||
if(is_file(\pocketmine\COMPOSER_AUTOLOADER_PATH)){
|
if(\pocketmine\COMPOSER_AUTOLOADER_PATH !== false and is_file(\pocketmine\COMPOSER_AUTOLOADER_PATH)){
|
||||||
require_once(\pocketmine\COMPOSER_AUTOLOADER_PATH);
|
require_once(\pocketmine\COMPOSER_AUTOLOADER_PATH);
|
||||||
}else{
|
}else{
|
||||||
critical_error("Composer autoloader not found.");
|
critical_error("Composer autoloader not found at " . $bootstrap);
|
||||||
critical_error("Please install/update Composer dependencies or use provided builds.");
|
critical_error("Please install/update Composer dependencies or use provided builds.");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,8 @@ class Cake extends Transparent implements FoodSource{
|
|||||||
|
|
||||||
protected $id = self::CAKE_BLOCK;
|
protected $id = self::CAKE_BLOCK;
|
||||||
|
|
||||||
|
protected $itemId = Item::CAKE;
|
||||||
|
|
||||||
public function __construct(int $meta = 0){
|
public function __construct(int $meta = 0){
|
||||||
$this->setDamage($meta);
|
$this->setDamage($meta);
|
||||||
}
|
}
|
||||||
|
@ -103,4 +103,8 @@ class Farmland extends Transparent{
|
|||||||
public function isAffectedBySilkTouch() : bool{
|
public function isAffectedBySilkTouch() : bool{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPickedItem() : Item{
|
||||||
|
return ItemFactory::get(Item::DIRT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,8 @@ class RedstoneOre extends Solid{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onActivate(Item $item, Player $player = null) : bool{
|
public function onActivate(Item $item, Player $player = null) : bool{
|
||||||
return $this->getLevel()->setBlock($this, BlockFactory::get(Block::GLOWING_REDSTONE_ORE, $this->meta));
|
$this->getLevel()->setBlock($this, BlockFactory::get(Block::GLOWING_REDSTONE_ORE, $this->meta));
|
||||||
|
return false; //this shouldn't prevent block placement
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
public function onNearbyBlockChange() : void{
|
||||||
|
@ -68,18 +68,20 @@ class Skull extends Flowable{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDropsForCompatibleTool(Item $item) : array{
|
private function getItem() : Item{
|
||||||
$tile = $this->level->getTile($this);
|
$tile = $this->level->getTile($this);
|
||||||
if($tile instanceof TileSkull){
|
return ItemFactory::get(Item::SKULL, $tile instanceof TileSkull ? $tile->getType() : 0);
|
||||||
return [
|
|
||||||
ItemFactory::get(Item::SKULL, $tile->getType())
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [];
|
public function getDropsForCompatibleTool(Item $item) : array{
|
||||||
|
return [$this->getItem()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isAffectedBySilkTouch() : bool{
|
public function isAffectedBySilkTouch() : bool{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPickedItem() : Item{
|
||||||
|
return $this->getItem();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user