mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Merge branch 'php/7.0' into mcpe-1.2
This commit is contained in:
@@ -27,6 +27,7 @@ use pocketmine\block\Air;
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\block\Liquid;
|
||||
use pocketmine\event\player\PlayerBucketEmptyEvent;
|
||||
use pocketmine\event\player\PlayerBucketFillEvent;
|
||||
use pocketmine\level\Level;
|
||||
use pocketmine\math\Vector3;
|
||||
@@ -70,7 +71,7 @@ class Bucket extends Item{
|
||||
}elseif($targetBlock instanceof Liquid){
|
||||
$result = clone $this;
|
||||
$result->setDamage(0);
|
||||
$player->getServer()->getPluginManager()->callEvent($ev = new PlayerBucketFillEvent($player, $block, $face, $this, $result));
|
||||
$player->getServer()->getPluginManager()->callEvent($ev = new PlayerBucketEmptyEvent($player, $block, $face, $this, $result));
|
||||
if(!$ev->isCancelled()){
|
||||
$player->getLevel()->setBlock($block, $targetBlock, true, true);
|
||||
if($player->isSurvival()){
|
||||
|
@@ -202,7 +202,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
$this->id = $id & 0xffff;
|
||||
$this->meta = $meta !== -1 ? $meta & 0xffff : -1;
|
||||
$this->name = $name;
|
||||
if(!isset($this->block) and $this->id <= 0xff and isset(BlockFactory::$list[$this->id])){
|
||||
if(!isset($this->block) and $this->id <= 0xff){
|
||||
$this->block = BlockFactory::get($this->id, $this->meta);
|
||||
$this->name = $this->block->getName();
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ use pocketmine\nbt\tag\CompoundTag;
|
||||
class ItemFactory{
|
||||
|
||||
/** @var \SplFixedArray */
|
||||
public static $list = null;
|
||||
private static $list = null;
|
||||
|
||||
public static function init(){
|
||||
if(self::$list === null){
|
||||
|
Reference in New Issue
Block a user