mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fix some non-properly-implemented blocks killing people and bad inheritances
This commit is contained in:
parent
408f63f8fa
commit
f933107af0
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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){
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user