diff --git a/src/pocketmine/block/FenceGate.php b/src/pocketmine/block/FenceGate.php index 582ddc92c..7c0e0f8ea 100644 --- a/src/pocketmine/block/FenceGate.php +++ b/src/pocketmine/block/FenceGate.php @@ -107,7 +107,7 @@ class FenceGate extends Transparent{ ]; $this->meta = ($faces[$player instanceof Player ? $player->getDirection() : 0] & 0x03) | ((~$this->meta) & 0x04); $this->getLevel()->setBlock($this, $this, true); - + $this->level->addSound(new DoorSound($this)); return true; } -} \ No newline at end of file +} diff --git a/src/pocketmine/block/Trapdoor.php b/src/pocketmine/block/Trapdoor.php index c3b8f8a70..434b3264b 100644 --- a/src/pocketmine/block/Trapdoor.php +++ b/src/pocketmine/block/Trapdoor.php @@ -146,11 +146,11 @@ class Trapdoor extends Transparent{ public function onActivate(Item $item, Player $player = null){ $this->meta ^= 0x04; $this->getLevel()->setBlock($this, $this, true); - + $this->level->addSound(new DoorSound($this)); return true; } public function getToolType(){ return Tool::TYPE_AXE; } -} \ No newline at end of file +} diff --git a/src/pocketmine/item/CookedFish.php b/src/pocketmine/item/CookedFish.php index 4b4089fbe..9c7441ea4 100644 --- a/src/pocketmine/item/CookedFish.php +++ b/src/pocketmine/item/CookedFish.php @@ -24,10 +24,10 @@ namespace pocketmine\item; class CookedFish extends Item{ public function __construct($meta = 0, $count = 1){ - parent::__construct(self::RAW_FISH, $meta, $count, "Cooked Fish"); + parent::__construct(self::COOKED_FISH, $meta, $count, "Cooked Fish"); if($this->meta === 1){ $this->name = "Cooked Salmon"; } } -} \ No newline at end of file +} diff --git a/src/pocketmine/plugin/PluginManager.php b/src/pocketmine/plugin/PluginManager.php index c01bee4c7..3a09bc0c5 100644 --- a/src/pocketmine/plugin/PluginManager.php +++ b/src/pocketmine/plugin/PluginManager.php @@ -748,8 +748,15 @@ class PluginManager{ * @throws PluginException */ public function registerEvent($event, Listener $listener, $priority, EventExecutor $executor, Plugin $plugin, $ignoreCancelled = false){ - if(!is_subclass_of($event, Event::class) or (new \ReflectionClass($event))->isAbstract()){ - throw new PluginException($event . " is not a valid Event"); + if(!is_subclass_of($event, Event::class)){ + throw new PluginException($event . " is not an Event"); + } + $class = new \ReflectionClass($event); + if($class->isAbstract()){ + throw new PluginException($event . " is an abstract Event"); + } + if($class->getProperty("handlerList")->getDeclaringClass()->getName() !== $event){ + throw new PluginException($event . " does not have a handler list"); } if(!$plugin->isEnabled()){