Cleaned up fuel duration handling, fixed some fuel items not working in furnaces

This commit is contained in:
Dylan K. Taylor
2017-08-17 10:22:47 +01:00
parent dc3f13cd30
commit 6efa4343b1
30 changed files with 123 additions and 71 deletions

View File

@@ -718,6 +718,14 @@ class Block extends Position implements BlockIds, Metadatable{
return $this->getHardness() !== -1;
}
/**
* Returns the time in ticks which the block will fuel a furnace for.
* @return int
*/
public function getFuelTime() : int{
return 0;
}
/**
* Returns the Block on the side $side, works like Vector3::side()
*

View File

@@ -52,4 +52,8 @@ class Bookshelf extends Solid{
];
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -174,4 +174,8 @@ class Chest extends Transparent{
[$this->id, 0, 1],
];
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -55,4 +55,8 @@ class Coal extends Solid{
return [];
}
}
public function getFuelTime() : int{
return 16000;
}
}

View File

@@ -60,4 +60,8 @@ class CraftingTable extends Solid{
[$this->id, 0, 1],
];
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -38,4 +38,8 @@ class DaylightSensor extends Transparent{
public function getHardness(){
return 0.2;
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -88,4 +88,8 @@ class Fence extends Transparent{
return ($block instanceof Fence or $block instanceof FenceGate) ? true : $block->isSolid() and !$block->isTransparent();
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -92,4 +92,8 @@ class FenceGate extends Transparent{
$this->level->addSound(new DoorSound($this));
return true;
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -34,4 +34,8 @@ class NoteBlock extends Solid{
public function getName(){
return "Note Block";
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -59,4 +59,8 @@ class Planks extends Solid{
return $names[$this->meta & 0x07] ?? "Unknown";
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -112,4 +112,8 @@ class Sapling extends Flowable{
[$this->id, $this->meta & 0x07, 1],
];
}
public function getFuelTime() : int{
return 100;
}
}

View File

@@ -75,4 +75,8 @@ class StoneSlab extends WoodenSlab{
return [];
}
}
public function getFuelTime() : int{
return 0;
}
}

View File

@@ -156,4 +156,8 @@ class Trapdoor extends Transparent{
public function getToolType(){
return Tool::TYPE_AXE;
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -78,4 +78,8 @@ class Wood extends Solid{
public function getToolType(){
return Tool::TYPE_AXE;
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -34,4 +34,8 @@ class WoodenPressurePlate extends StonePressurePlate{
public function getName(){
return "Wooden Pressure Plate";
}
public function getFuelTime() : int{
return 300;
}
}

View File

@@ -134,4 +134,8 @@ class WoodenSlab extends Transparent{
[$this->id, $this->meta & 0x07, 1],
];
}
public function getFuelTime() : int{
return 300;
}
}