Shut some inspections up

This commit is contained in:
Dylan K. Taylor
2017-02-13 14:27:17 +00:00
parent 8a3c30ee7e
commit 903534572d
4 changed files with 12 additions and 5 deletions

View File

@ -101,7 +101,8 @@ class BurningFurnace extends Solid{
public function onActivate(Item $item, Player $player = null){
if($player instanceof Player){
if(!(($furnace = $this->getLevel()->getTile($this)) instanceof TileFurnace)){
$furnace = $this->getLevel()->getTile($this);
if(!($furnace instanceof TileFurnace)){
$nbt = new CompoundTag("", [
new ListTag("Items", []),
new StringTag("id", Tile::FURNACE),

View File

@ -46,7 +46,8 @@ class ItemFrame extends Flowable{
}
public function onActivate(Item $item, Player $player = null){
if(!(($tile = $this->level->getTile($this)) instanceof TileItemFrame)){
$tile = $this->level->getTile($this);
if(!($tile instanceof TileItemFrame)){
$nbt = new CompoundTag("", [
new StringTag("id", Tile::ITEM_FRAME),
new IntTag("x", $this->x),
@ -76,7 +77,8 @@ class ItemFrame extends Flowable{
}
public function onBreak(Item $item){
if(($tile = $this->level->getTile($this)) instanceof TileItemFrame){
$tile = $this->level->getTile($this);
if($tile instanceof TileItemFrame){
//TODO: add events
if(lcg_value() <= $tile->getItemDropChance() and $tile->getItem()->getId() !== Item::AIR){
$this->level->dropItem($tile->getBlock(), $tile->getItem());

View File

@ -107,7 +107,8 @@ class MobHead extends Flowable{
}
public function getDrops(Item $item){
if(($tile = $this->level->getTile($this)) instanceof SkullTile){
$tile = $this->level->getTile($this);
if($tile instanceof SkullTile){
return [
[Item::MOB_HEAD, $tile->getType(), 1]
];