Fixed some bugs
This commit is contained in:
parent
f8bb45fcff
commit
0f7c710596
3 changed files with 9 additions and 8 deletions
|
|
@ -169,7 +169,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||
/** @var SourceInterface */
|
||||
protected $interface;
|
||||
|
||||
/** @var bool */
|
||||
/** @var bool */
|
||||
public $playedBefore = false;
|
||||
public $spawned = false;
|
||||
public $loggedIn = false;
|
||||
|
|
@ -323,11 +323,11 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||
}
|
||||
$this->fishingHook = $entity;
|
||||
}
|
||||
|
||||
|
||||
public function getItemInHand(){
|
||||
return $this->inventory->getItemInHand();
|
||||
}
|
||||
|
||||
|
||||
public function getLeaveMessage(){
|
||||
return new TranslationContainer(TextFormat::YELLOW . "%multiplayer.player.left", [
|
||||
$this->getDisplayName()
|
||||
|
|
@ -3325,7 +3325,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||
break;
|
||||
}
|
||||
|
||||
if(!$this->inventory->contains($packet->item)) {
|
||||
if(!$this->inventory->contains($packet->item) or ($this->isCreative() and $this->server->limitedCreative)){
|
||||
$this->inventory->sendContents($this);
|
||||
break;
|
||||
}
|
||||
|
|
@ -3335,7 +3335,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||
break;
|
||||
}
|
||||
$dropItem = $this->inventory->getItem($slot);
|
||||
$ev = new PlayerDropItemEvent($this, $item);
|
||||
$ev = new PlayerDropItemEvent($this, $dropItem);
|
||||
$this->server->getPluginManager()->callEvent($ev);
|
||||
if($ev->isCancelled()){
|
||||
$this->inventory->sendSlot($slot, $this);
|
||||
|
|
@ -3343,7 +3343,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||
}
|
||||
|
||||
$this->inventory->remove($dropItem);
|
||||
$this->inventory->setItemInHand(Item::get(Item::AIR, 0, 1));
|
||||
//$this->inventory->setItemInHand(Item::get(Item::AIR, 0, 1));
|
||||
$motion = $this->getDirectionVector()->multiply(0.4);
|
||||
|
||||
$this->level->dropItem($this->add(0, 1.3, 0), $dropItem, $motion, 40);
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ class SimpleCommandMap implements CommandMap{
|
|||
private function dispatchAdvanced(CommandSender $sender, Command $command, $label, array $args, $offset = 0){
|
||||
if(!$sender->isOp()){
|
||||
$sender->sendMessage(TextFormat::RED . "You don't have permission to use Command Selector!");
|
||||
$command->execute($sender, $label, $args);
|
||||
return;
|
||||
}
|
||||
if(isset($args[$offset])){
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@
|
|||
namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\event\Listener;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\tile\ItemFrame;
|
||||
|
||||
class ItemFrameDropItemEvent extends BlockEvent implements Listener{
|
||||
class ItemFrameDropItemEvent extends BlockEvent implements Cancellable{
|
||||
public static $handlerList = null;
|
||||
/** @var Item */
|
||||
private $item;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue