mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Cleaned up fuel duration handling, fixed some fuel items not working in furnaces
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -29,4 +29,8 @@ class Bow extends Tool{
|
||||
parent::__construct(self::BOW, $meta, $count, "Bow");
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
|
||||
|
@ -32,4 +32,8 @@ class Coal extends Item{
|
||||
}
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 1600;
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
@ -917,15 +916,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,4 +43,8 @@ class ItemBlock extends Item{
|
||||
return $this->block;
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return $this->block->getFuelTime();
|
||||
}
|
||||
|
||||
}
|
@ -29,4 +29,8 @@ class Stick extends Item{
|
||||
parent::__construct(self::STICK, $meta, $count, "Stick");
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 5;
|
||||
}
|
||||
|
||||
}
|
@ -32,4 +32,8 @@ class WoodenAxe extends Tool{
|
||||
public function isAxe(){
|
||||
return Tool::TIER_WOODEN;
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class WoodenHoe extends Tool{
|
||||
public function isHoe(){
|
||||
return Tool::TIER_WOODEN;
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
}
|
@ -32,4 +32,8 @@ class WoodenPickaxe extends Tool{
|
||||
public function isPickaxe(){
|
||||
return Tool::TIER_WOODEN;
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class WoodenShovel extends Tool{
|
||||
public function isShovel(){
|
||||
return Tool::TIER_WOODEN;
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
|
@ -32,4 +32,8 @@ class WoodenSword extends Tool{
|
||||
public function isSword(){
|
||||
return Tool::TIER_WOODEN;
|
||||
}
|
||||
|
||||
public function getFuelTime() : int{
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user