diff --git a/composer.json b/composer.json index 7bf1e54..71449f7 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,14 @@ "ext-yaml": ">=2.0.0", "ext-zip": "*", "ext-zlib": ">=1.2.11", - "pocketmine/pocketmine-mp": "^3.0", + "pocketmine/pocketmine-mp": "^3.5", "pocketmine/raklib": "^0.12.0", "pocketmine/spl": "^0.3.0", "pocketmine/binaryutils": "^0.1.0", "pocketmine/nbt": "^0.2.0", "pocketmine/math": "^0.2.0", "pocketmine/snooze": "^0.1.0", + "daverandom/callback-validator": "dev-master", "fuyutsuki/libform": "^0.4" }, "autoload": { diff --git a/composer.lock b/composer.lock index 6f17f13..9fa4982 100644 --- a/composer.lock +++ b/composer.lock @@ -4,11 +4,51 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9cdce27cde4903028c45eb52ec211f73", + "content-hash": "99e726c8c679f2dbd814c968ef875b07", "packages": [ + { + "name": "daverandom/callback-validator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/DaveRandom/CallbackValidator.git", + "reference": "d87a08cddbc6099816ed01e50ce25cdfc43b542f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DaveRandom/CallbackValidator/zipball/d87a08cddbc6099816ed01e50ce25cdfc43b542f", + "reference": "d87a08cddbc6099816ed01e50ce25cdfc43b542f", + "shasum": "" + }, + "require": { + "ext-reflection": "*", + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "DaveRandom\\CallbackValidator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Wright", + "email": "cw@daverandom.com" + } + ], + "description": "Tools for validating callback signatures", + "time": "2017-04-03T15:22:41+00:00" + }, { "name": "fuyutsuki/libform", - "version": "v0.4.0", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/fuyutsuki/libform.git", @@ -134,19 +174,20 @@ }, { "name": "pocketmine/nbt", - "version": "0.2.1", + "version": "0.2.3", "source": { "type": "git", "url": "https://github.com/pmmp/NBT.git", - "reference": "a4ee39f313c6870153fb7c7e513b211217f7daf8" + "reference": "291bf5cc2a94500eada1edbda51d15bed25a1e1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/NBT/zipball/a4ee39f313c6870153fb7c7e513b211217f7daf8", - "reference": "a4ee39f313c6870153fb7c7e513b211217f7daf8", + "url": "https://api.github.com/repos/pmmp/NBT/zipball/291bf5cc2a94500eada1edbda51d15bed25a1e1c", + "reference": "291bf5cc2a94500eada1edbda51d15bed25a1e1c", "shasum": "" }, "require": { + "ext-zlib": "*", "php": ">=7.2.0", "php-64bit": "*", "pocketmine/binaryutils": "^0.1.0" @@ -167,26 +208,27 @@ ], "description": "PHP library for working with Named Binary Tags", "support": { - "source": "https://github.com/pmmp/NBT/tree/0.2.1", + "source": "https://github.com/pmmp/NBT/tree/0.2.3", "issues": "https://github.com/pmmp/NBT/issues" }, - "time": "2018-09-04T10:36:02+00:00" + "time": "2018-12-03T16:08:28+00:00" }, { "name": "pocketmine/pocketmine-mp", - "version": "3.2.4", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/pmmp/PocketMine-MP.git", - "reference": "a66dd4a7d95c49792d39c7e70442b1ee4b855988" + "reference": "2323601f98bf5f48901cd57b96d0e680a7d5e56e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pmmp/PocketMine-MP/zipball/a66dd4a7d95c49792d39c7e70442b1ee4b855988", - "reference": "a66dd4a7d95c49792d39c7e70442b1ee4b855988", + "url": "https://api.github.com/repos/pmmp/PocketMine-MP/zipball/2323601f98bf5f48901cd57b96d0e680a7d5e56e", + "reference": "2323601f98bf5f48901cd57b96d0e680a7d5e56e", "shasum": "" }, "require": { + "daverandom/callback-validator": "dev-master", "ext-bcmath": "*", "ext-ctype": "*", "ext-curl": "*", @@ -232,10 +274,10 @@ "description": "A server software for Minecraft: Pocket Edition written in PHP", "homepage": "https://pmmp.io", "support": { - "source": "https://github.com/pmmp/PocketMine-MP/tree/3.2.4", + "source": "https://github.com/pmmp/PocketMine-MP/tree/3.5.0", "issues": "https://github.com/pmmp/PocketMine-MP/issues" }, - "time": "2018-10-07T18:32:04+00:00" + "time": "2018-12-12T19:03:07+00:00" }, { "name": "pocketmine/raklib", @@ -349,7 +391,8 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "ext-pthreads": 20 + "ext-pthreads": 20, + "daverandom/callback-validator": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/plugin.yml b/plugin.yml index dd46d6d..223e7b2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: Texter main: tokyo\pmmp\Texter\Core -version: 3.0.4 +version: 3.0.5 api: 3.0.0 # pmmp/PocketMine-MP softdepend: - DEVirion diff --git a/src/tokyo/pmmp/Texter/Core.php b/src/tokyo/pmmp/Texter/Core.php index eaf22c3..75c7936 100644 --- a/src/tokyo/pmmp/Texter/Core.php +++ b/src/tokyo/pmmp/Texter/Core.php @@ -70,6 +70,8 @@ public function onEnable(): void { FormApi::register($this); $listener = new EventListener; $this->getServer()->getPluginManager()->registerEvents($listener, $this); + }else { + $this->getServer()->getPluginManager()->disablePlugin($this); } } @@ -179,7 +181,6 @@ private function checkPackaged(): bool { }else { $message = $cl->translateString("error.on.enable.not.packaged"); $this->getLogger()->critical($message); - $this->getServer()->getPluginManager()->disablePlugin($this); return false; } }else { @@ -189,13 +190,11 @@ private function checkPackaged(): bool { }else { $message = $cl->translateString("error.on.enable.not.found.libform"); $this->getLogger()->critical($message); - $this->getServer()->getPluginManager()->disablePlugin($this); return false; } }else { $message = $cl->translateString("error.on.enable.not.packaged"); $this->getLogger()->critical($message); - $this->getServer()->getPluginManager()->disablePlugin($this); return false; } } diff --git a/src/tokyo/pmmp/Texter/text/FloatingText.php b/src/tokyo/pmmp/Texter/text/FloatingText.php index 09a253a..69d25f9 100644 --- a/src/tokyo/pmmp/Texter/text/FloatingText.php +++ b/src/tokyo/pmmp/Texter/text/FloatingText.php @@ -224,12 +224,10 @@ public function asPacket(int $type = Text::SEND_TYPE_ADD, bool $owned = false): $pk->entityUniqueId = $this->eid; $pk->position = $this; $pk->item = Item::get(Item::AIR); - $flags = - 1 << Entity::DATA_FLAG_CAN_SHOW_NAMETAG | - 1 << Entity::DATA_FLAG_ALWAYS_SHOW_NAMETAG | - 1 << Entity::DATA_FLAG_IMMOBILE; - $flags |= $this->isInvisible ? - 1 << Entity::DATA_FLAG_INVISIBLE : 1; + $flags = 1 << Entity::DATA_FLAG_IMMOBILE; + if ($this->isInvisible) { + $flags |= 1 << Entity::DATA_FLAG_INVISIBLE; + } $pk->metadata = [ Entity::DATA_FLAGS => [Entity::DATA_TYPE_LONG, $flags], Entity::DATA_SCALE => [Entity::DATA_TYPE_FLOAT, 0]