Merge branch 'master' into mcpe-1.2

This commit is contained in:
Dylan K. Taylor
2017-08-17 17:14:16 +01:00
215 changed files with 1482 additions and 1257 deletions

View File

@ -27,4 +27,8 @@ class Boat extends Item{
public function __construct($meta = 0, $count = 1){
parent::__construct(self::BOAT, $meta, $count, "Boat");
}
public function getFuelTime() : int{
return 1200; //400 in PC
}
}

View File

@ -29,4 +29,8 @@ class Bow extends Tool{
parent::__construct(self::BOW, $meta, $count, "Bow");
}
public function getFuelTime() : int{
return 200;
}
}

View File

@ -39,6 +39,14 @@ class Bucket extends Item{
return 1;
}
public function getFuelTime() : int{
if($this->meta === Block::LAVA or $this->meta === Block::FLOWING_LAVA){
return 20000;
}
return 0;
}
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$targetBlock = Block::get($this->meta);

View File

@ -32,4 +32,8 @@ class Coal extends Item{
}
}
public function getFuelTime() : int{
return 1600;
}
}

View File

@ -28,7 +28,6 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\entity\Entity;
use pocketmine\inventory\Fuel;
use pocketmine\item\enchantment\Enchantment;
use pocketmine\level\Level;
use pocketmine\nbt\NBT;
@ -437,11 +436,8 @@ class Item implements ItemIds, \JsonSerializable{
}
$tag = $this->getNamedTag();
if(isset($tag->BlockEntityTag) and $tag->BlockEntityTag instanceof CompoundTag){
return true;
}
return false;
return isset($tag->BlockEntityTag) and $tag->BlockEntityTag instanceof CompoundTag;
}
public function clearCustomBlockData(){
@ -924,15 +920,12 @@ class Item implements ItemIds, \JsonSerializable{
return 64;
}
final public function getFuelTime(){
if(!isset(Fuel::$duration[$this->id])){
return null;
}
if($this->id !== self::BUCKET or $this->meta === 10){
return Fuel::$duration[$this->id];
}
return null;
/**
* Returns the time in ticks which the item will fuel a furnace for.
* @return int
*/
public function getFuelTime() : int{
return 0;
}
/**

View File

@ -43,4 +43,8 @@ class ItemBlock extends Item{
return $this->block;
}
public function getFuelTime() : int{
return $this->block->getFuelTime();
}
}

View File

@ -29,4 +29,8 @@ class Stick extends Item{
parent::__construct(self::STICK, $meta, $count, "Stick");
}
public function getFuelTime() : int{
return 5;
}
}

View File

@ -32,4 +32,8 @@ class WoodenAxe extends Tool{
public function isAxe(){
return Tool::TIER_WOODEN;
}
public function getFuelTime() : int{
return 200;
}
}

View File

@ -32,4 +32,8 @@ class WoodenHoe extends Tool{
public function isHoe(){
return Tool::TIER_WOODEN;
}
public function getFuelTime() : int{
return 200;
}
}

View File

@ -32,4 +32,8 @@ class WoodenPickaxe extends Tool{
public function isPickaxe(){
return Tool::TIER_WOODEN;
}
public function getFuelTime() : int{
return 200;
}
}

View File

@ -32,4 +32,8 @@ class WoodenShovel extends Tool{
public function isShovel(){
return Tool::TIER_WOODEN;
}
public function getFuelTime() : int{
return 200;
}
}

View File

@ -32,4 +32,8 @@ class WoodenSword extends Tool{
public function isSword(){
return Tool::TIER_WOODEN;
}
public function getFuelTime() : int{
return 200;
}
}