Separate WoodenTrapdoor from Trapdoor, fixed iron trapdoors being valid furnace fuel, closes #2914 for bleeding-edge

This commit is contained in:
Dylan K. Taylor 2019-05-09 19:30:18 +01:00
parent 5eb3c52a37
commit 3be5de4570
3 changed files with 41 additions and 14 deletions

View File

@ -392,7 +392,7 @@ class BlockFactory{
self::register(new WoodenButton(new BID($woodenButtonIds[$treeType]), $treeType->getDisplayName() . " Button"));
self::register(new WoodenPressurePlate(new BID($woodenPressurePlateIds[$treeType]), $treeType->getDisplayName() . " Pressure Plate"));
self::register(new Trapdoor(new BID($woodenTrapdoorIds[$treeType]), $treeType->getDisplayName() . " Trapdoor"));
self::register(new WoodenTrapdoor(new BID($woodenTrapdoorIds[$treeType]), $treeType->getDisplayName() . " Trapdoor"));
self::register(new Sign($woodenSignIds[$treeType], $treeType->getDisplayName() . " Sign"));
}

View File

@ -31,7 +31,7 @@ use pocketmine\math\Vector3;
use pocketmine\Player;
use pocketmine\world\sound\DoorSound;
class Trapdoor extends Transparent{
abstract class Trapdoor extends Transparent{
private const MASK_UPPER = 0x04;
private const MASK_OPENED = 0x08;
@ -58,10 +58,6 @@ class Trapdoor extends Transparent{
return 0b1111;
}
public function getHardness() : float{
return 3;
}
protected function recalculateBoundingBox() : ?AxisAlignedBB{
return AxisAlignedBB::one()->trim($this->open ? $this->facing : ($this->top ? Facing::DOWN : Facing::UP), 13 / 16);
}
@ -83,12 +79,4 @@ class Trapdoor extends Transparent{
$this->world->addSound($this, new DoorSound());
return true;
}
public function getToolType() : int{
return BlockToolType::TYPE_AXE;
}
public function getFuelTime() : int{
return 300;
}
}

View File

@ -0,0 +1,39 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\block;
class WoodenTrapdoor extends Trapdoor{
public function getHardness() : float{
return 3;
}
public function getToolType() : int{
return BlockToolType::TYPE_AXE;
}
public function getFuelTime() : int{
return 300;
}
}