Fix some non-properly-implemented blocks killing people and bad inheritances

This commit is contained in:
Dylan K. Taylor 2017-02-21 11:17:33 +00:00
parent 408f63f8fa
commit f933107af0
19 changed files with 29 additions and 42 deletions

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class ActivatorRail extends Solid{ class ActivatorRail extends Rail{
protected $id = self::ACTIVATOR_RAIL; protected $id = self::ACTIVATOR_RAIL;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class DaylightSensor extends Solid{ class DaylightSensor extends Transparent{
protected $id = self::DAYLIGHT_SENSOR; protected $id = self::DAYLIGHT_SENSOR;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class DetectorRail extends Solid{ class DetectorRail extends Rail{
protected $id = self::DETECTOR_RAIL; protected $id = self::DETECTOR_RAIL;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class Lever extends Solid{ class Lever extends Flowable{
protected $id = self::LEVER; protected $id = self::LEVER;

View File

@ -25,7 +25,7 @@ use pocketmine\item\Item;
use pocketmine\item\Tool; use pocketmine\item\Tool;
use pocketmine\Player; use pocketmine\Player;
class LitPumpkin extends Solid{ class LitPumpkin extends Pumpkin{
protected $id = self::LIT_PUMPKIN; protected $id = self::LIT_PUMPKIN;
@ -33,28 +33,7 @@ class LitPumpkin extends Solid{
return 15; return 15;
} }
public function getHardness(){
return 1;
}
public function getToolType(){
return Tool::TYPE_AXE;
}
public function getName(){ public function getName(){
return "Jack o'Lantern"; return "Jack o'Lantern";
} }
public function __construct($meta = 0){
$this->meta = $meta;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
if($player instanceof Player){
$this->meta = ((int) $player->getDirection() + 5) % 4;
}
$this->getLevel()->setBlock($block, $this, true, true);
return true;
}
} }

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class LitRedstoneLamp extends Solid{ class LitRedstoneLamp extends RedstoneLamp{
protected $id = self::LIT_REDSTONE_LAMP; protected $id = self::LIT_REDSTONE_LAMP;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class LitRedstoneTorch extends Solid{ class LitRedstoneTorch extends RedstoneTorch{
protected $id = self::REDSTONE_TORCH; protected $id = self::REDSTONE_TORCH;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class PoweredRail extends Solid{ class PoweredRail extends Rail{
protected $id = self::POWERED_RAIL; protected $id = self::POWERED_RAIL;
public function __construct($meta = 0){ public function __construct($meta = 0){

View File

@ -29,8 +29,8 @@ class Pumpkin extends Solid{
protected $id = self::PUMPKIN; protected $id = self::PUMPKIN;
public function __construct(){ public function __construct($meta = 0){
$this->meta = $meta;
} }
public function getHardness(){ public function getHardness(){
@ -47,7 +47,7 @@ class Pumpkin extends Solid{
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
if($player instanceof Player){ if($player instanceof Player){
$this->meta = ((int) $player->getDirection() + 5) % 4; $this->meta = ((int) $player->getDirection() + 1) % 4;
} }
$this->getLevel()->setBlock($block, $this, true, true); $this->getLevel()->setBlock($block, $this, true, true);

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class Rail extends Solid{ class Rail extends Flowable{
protected $id = self::RAIL; protected $id = self::RAIL;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class RedstoneTorch extends Solid{ class RedstoneTorch extends Torch{
protected $id = self::REDSTONE_TORCH; protected $id = self::REDSTONE_TORCH;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class StoneButton extends Solid{ class StoneButton extends Flowable{
protected $id = self::STONE_BUTTON; protected $id = self::STONE_BUTTON;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class StonePressurePlate extends Solid{ class StonePressurePlate extends Transparent{
protected $id = self::STONE_PRESSURE_PLATE; protected $id = self::STONE_PRESSURE_PLATE;
@ -32,4 +32,8 @@ class StonePressurePlate extends Solid{
public function getName(){ public function getName(){
return "Stone Pressure Plate"; return "Stone Pressure Plate";
} }
public function isSolid(){
return false;
}
} }

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class Tripwire extends Solid{ class Tripwire extends Flowable{
protected $id = self::TRIPWIRE; protected $id = self::TRIPWIRE;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class TripwireHook extends Solid{ class TripwireHook extends Flowable{
protected $id = self::TRIPWIRE_HOOK; protected $id = self::TRIPWIRE_HOOK;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class WeightedPressurePlateHeavy extends Solid{ class WeightedPressurePlateHeavy extends WeightedPressurePlateLight{
protected $id = self::WEIGHTED_PRESSURE_PLATE_HEAVY; protected $id = self::WEIGHTED_PRESSURE_PLATE_HEAVY;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class WeightedPressurePlateLight extends Solid{ class WeightedPressurePlateLight extends Transparent{
protected $id = self::WEIGHTED_PRESSURE_PLATE_LIGHT; protected $id = self::WEIGHTED_PRESSURE_PLATE_LIGHT;
@ -32,4 +32,8 @@ class WeightedPressurePlateLight extends Solid{
public function getName(){ public function getName(){
return "Weighted Pressure Plate Light"; return "Weighted Pressure Plate Light";
} }
public function isSolid(){
return false;
}
} }

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class WoodenButton extends Solid{ class WoodenButton extends StoneButton{
protected $id = self::WOODEN_BUTTON; protected $id = self::WOODEN_BUTTON;

View File

@ -21,7 +21,7 @@
namespace pocketmine\block; namespace pocketmine\block;
class WoodenPressurePlate extends Solid{ class WoodenPressurePlate extends StonePressurePlate{
protected $id = self::WOODEN_PRESSURE_PLATE; protected $id = self::WOODEN_PRESSURE_PLATE;