├── .gitignore ├── .poggit.yml ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── src └── tedo0627 │ └── inventoryui │ ├── CustomInventory.php │ ├── EventListener.php │ ├── InventoryEntity.php │ ├── InventoryTickTask.php │ ├── InventoryUI.php │ └── exception │ ├── IllegalInventorySizeException.php │ └── InventoryUIResourcePackException.php └── virion.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | vendor/ -------------------------------------------------------------------------------- /.poggit.yml: -------------------------------------------------------------------------------- 1 | --- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/tedo0627/InventoryUI 2 | build-by-default: true 3 | branches: 4 | - master 5 | projects: 6 | InventoryUI: 7 | path: "" 8 | model: virion 9 | type: library 10 | ... 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 tedo0627 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # InventoryUI 2 | This is the PocketMine virion that implements the dummy inventory. 3 | 4 | ## Differences from previous APIs 5 | * Chests and other blocks are not placed. 6 | * If a player falls or moves by water or other means when the inventory is open, the inventory will not close. 7 | * You can specify any number of slots in your inventory. (Up to 1000 confirmed) 8 | * Vertical length of inventory slots can be specified. (max. 6) 9 | 10 | ## Demo 11 | https://github.com/tedo0627/InventoryUI/assets/24734045/3a0f3c90-2c02-4e1e-b9fd-69a868dbfbad 12 | 13 | ## How to install 14 | 1. Download [InventoryUIResourcePack.mcpack](https://github.com/tedo0627/InventoryUIResourcePack/releases/) and put it in the resource_packs folder 15 | 2. Open file ```resource_packs.yml```, set **force_resources** to ```true``` and **resource_stack** to ```InventoryUIResourcePack.mcpack``` 16 | ```yml 17 | force_resources: true 18 | resource_stack: 19 | - InventoryUIResourcePack.mcpack 20 | ``` 21 | 22 | ## Usage 23 | The following code must be called when the plugin is enabled. 24 | ```php 25 | InventoryUI::setup($this); 26 | ``` 27 | ### Open custom inventory 28 | ```$slot``` specifies the number of slots in the inventory and must be a number greater than zero. 29 | ```$title``` is the name of the inventory. 30 | ```$length``` is entered as the vertical length of the inventory. If null, it is automatically adjusted. 31 | ```php 32 | /** @var Player $player */ 33 | $player->setCurrentWindow(new CustomInventory($slot, $title, $length)); 34 | ``` 35 | 36 | ### Extend custom inventory 37 | ```php 38 | class SampleInventory extends CustomInventory { 39 | 40 | public function __construct() { 41 | parent::__construct(54, "Sample Inventory"); 42 | } 43 | 44 | public function open(Player $player): void { 45 | // Called when a player opens this inventory. 46 | } 47 | 48 | public function tick(int $tick): void { 49 | // Called every tick when someone opens inventory. 50 | } 51 | 52 | public function click(Player $player, int $slot, Item $sourceItem, Item $targetItem): bool { 53 | // It is called when a slot in the inventory is operated. 54 | // If the return value is true, the operation is canceled. 55 | return false; 56 | } 57 | 58 | public function close(Player $player): void { 59 | // Called when the player closes the inventory. 60 | } 61 | } 62 | ``` 63 | 64 | Sample plugin [here](https://github.com/tedo0627/SampleInventoryUI) 65 | 66 | ## License 67 | "InventoryUI" is under [MIT License](https://github.com/tedo0627/InventoryUI/blob/master/LICENSE) 68 | 69 | ## Special Thanks 70 | Help resource pack [@yuyaprgrm](https://github.com/yuyaprgrm) 71 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tedo0627/inventoryui", 3 | "description": "This is the PocketMine virion that implements the dummy inventory.", 4 | "minimum-stability": "stable", 5 | "license": "MIT", 6 | "require-dev": { 7 | "pocketmine/pocketmine-mp": "^5.20.0" 8 | }, 9 | "autoload": { 10 | "psr-4": { 11 | "tedo0627\\inventoryui\\": "src/tedo0627/inventoryui/" 12 | } 13 | }, 14 | "extra": { 15 | "virion":{ 16 | "spec": "3.0", 17 | "namespace-root": "tedo0627\\inventoryui" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "dd0996e1ad1066036f623a2e473a8553", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "adhocore/json-comment", 12 | "version": "1.2.1", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/adhocore/php-json-comment.git", 16 | "reference": "651023f9fe52e9efa2198cbaf6e481d1968e2377" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/adhocore/php-json-comment/zipball/651023f9fe52e9efa2198cbaf6e481d1968e2377", 21 | "reference": "651023f9fe52e9efa2198cbaf6e481d1968e2377", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "ext-ctype": "*", 26 | "php": ">=7.0" 27 | }, 28 | "require-dev": { 29 | "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5" 30 | }, 31 | "type": "library", 32 | "autoload": { 33 | "psr-4": { 34 | "Ahc\\Json\\": "src/" 35 | } 36 | }, 37 | "notification-url": "https://packagist.org/downloads/", 38 | "license": [ 39 | "MIT" 40 | ], 41 | "authors": [ 42 | { 43 | "name": "Jitendra Adhikari", 44 | "email": "jiten.adhikary@gmail.com" 45 | } 46 | ], 47 | "description": "Lightweight JSON comment stripper library for PHP", 48 | "keywords": [ 49 | "comment", 50 | "json", 51 | "strip-comment" 52 | ], 53 | "support": { 54 | "issues": "https://github.com/adhocore/php-json-comment/issues", 55 | "source": "https://github.com/adhocore/php-json-comment/tree/1.2.1" 56 | }, 57 | "funding": [ 58 | { 59 | "url": "https://paypal.me/ji10", 60 | "type": "custom" 61 | }, 62 | { 63 | "url": "https://github.com/adhocore", 64 | "type": "github" 65 | } 66 | ], 67 | "time": "2022-10-02T11:22:07+00:00" 68 | }, 69 | { 70 | "name": "brick/math", 71 | "version": "0.12.1", 72 | "source": { 73 | "type": "git", 74 | "url": "https://github.com/brick/math.git", 75 | "reference": "f510c0a40911935b77b86859eb5223d58d660df1" 76 | }, 77 | "dist": { 78 | "type": "zip", 79 | "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", 80 | "reference": "f510c0a40911935b77b86859eb5223d58d660df1", 81 | "shasum": "" 82 | }, 83 | "require": { 84 | "php": "^8.1" 85 | }, 86 | "require-dev": { 87 | "php-coveralls/php-coveralls": "^2.2", 88 | "phpunit/phpunit": "^10.1", 89 | "vimeo/psalm": "5.16.0" 90 | }, 91 | "type": "library", 92 | "autoload": { 93 | "psr-4": { 94 | "Brick\\Math\\": "src/" 95 | } 96 | }, 97 | "notification-url": "https://packagist.org/downloads/", 98 | "license": [ 99 | "MIT" 100 | ], 101 | "description": "Arbitrary-precision arithmetic library", 102 | "keywords": [ 103 | "Arbitrary-precision", 104 | "BigInteger", 105 | "BigRational", 106 | "arithmetic", 107 | "bigdecimal", 108 | "bignum", 109 | "bignumber", 110 | "brick", 111 | "decimal", 112 | "integer", 113 | "math", 114 | "mathematics", 115 | "rational" 116 | ], 117 | "support": { 118 | "issues": "https://github.com/brick/math/issues", 119 | "source": "https://github.com/brick/math/tree/0.12.1" 120 | }, 121 | "funding": [ 122 | { 123 | "url": "https://github.com/BenMorel", 124 | "type": "github" 125 | } 126 | ], 127 | "time": "2023-11-29T23:19:16+00:00" 128 | }, 129 | { 130 | "name": "pocketmine/bedrock-block-upgrade-schema", 131 | "version": "4.5.0", 132 | "source": { 133 | "type": "git", 134 | "url": "https://github.com/pmmp/BedrockBlockUpgradeSchema.git", 135 | "reference": "7943b894e050d68dd21b5c7fa609827a4e2e30f1" 136 | }, 137 | "dist": { 138 | "type": "zip", 139 | "url": "https://api.github.com/repos/pmmp/BedrockBlockUpgradeSchema/zipball/7943b894e050d68dd21b5c7fa609827a4e2e30f1", 140 | "reference": "7943b894e050d68dd21b5c7fa609827a4e2e30f1", 141 | "shasum": "" 142 | }, 143 | "type": "library", 144 | "notification-url": "https://packagist.org/downloads/", 145 | "license": [ 146 | "CC0-1.0" 147 | ], 148 | "description": "Schemas describing how to upgrade saved block data in older Minecraft: Bedrock Edition world saves", 149 | "support": { 150 | "issues": "https://github.com/pmmp/BedrockBlockUpgradeSchema/issues", 151 | "source": "https://github.com/pmmp/BedrockBlockUpgradeSchema/tree/4.5.0" 152 | }, 153 | "time": "2024-10-23T16:15:24+00:00" 154 | }, 155 | { 156 | "name": "pocketmine/bedrock-data", 157 | "version": "2.14.0+bedrock-1.21.40", 158 | "source": { 159 | "type": "git", 160 | "url": "https://github.com/pmmp/BedrockData.git", 161 | "reference": "606d32ae426164b0615898b95d10e23293bed6ac" 162 | }, 163 | "dist": { 164 | "type": "zip", 165 | "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/606d32ae426164b0615898b95d10e23293bed6ac", 166 | "reference": "606d32ae426164b0615898b95d10e23293bed6ac", 167 | "shasum": "" 168 | }, 169 | "type": "library", 170 | "notification-url": "https://packagist.org/downloads/", 171 | "license": [ 172 | "CC0-1.0" 173 | ], 174 | "description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP", 175 | "support": { 176 | "issues": "https://github.com/pmmp/BedrockData/issues", 177 | "source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.21.40" 178 | }, 179 | "time": "2024-10-23T19:19:16+00:00" 180 | }, 181 | { 182 | "name": "pocketmine/bedrock-item-upgrade-schema", 183 | "version": "1.13.0", 184 | "source": { 185 | "type": "git", 186 | "url": "https://github.com/pmmp/BedrockItemUpgradeSchema.git", 187 | "reference": "1dee9bbd0aaa65ed108b377b402746defe10b3b0" 188 | }, 189 | "dist": { 190 | "type": "zip", 191 | "url": "https://api.github.com/repos/pmmp/BedrockItemUpgradeSchema/zipball/1dee9bbd0aaa65ed108b377b402746defe10b3b0", 192 | "reference": "1dee9bbd0aaa65ed108b377b402746defe10b3b0", 193 | "shasum": "" 194 | }, 195 | "type": "library", 196 | "notification-url": "https://packagist.org/downloads/", 197 | "license": [ 198 | "CC0-1.0" 199 | ], 200 | "description": "JSON schemas for upgrading items found in older Minecraft: Bedrock world saves", 201 | "support": { 202 | "issues": "https://github.com/pmmp/BedrockItemUpgradeSchema/issues", 203 | "source": "https://github.com/pmmp/BedrockItemUpgradeSchema/tree/1.13.0" 204 | }, 205 | "time": "2024-10-23T18:38:43+00:00" 206 | }, 207 | { 208 | "name": "pocketmine/bedrock-protocol", 209 | "version": "35.0.0+bedrock-1.21.40", 210 | "source": { 211 | "type": "git", 212 | "url": "https://github.com/pmmp/BedrockProtocol.git", 213 | "reference": "6aa7cbeb4a7ec6fa58f9024aeaddad7c5c65a459" 214 | }, 215 | "dist": { 216 | "type": "zip", 217 | "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/6aa7cbeb4a7ec6fa58f9024aeaddad7c5c65a459", 218 | "reference": "6aa7cbeb4a7ec6fa58f9024aeaddad7c5c65a459", 219 | "shasum": "" 220 | }, 221 | "require": { 222 | "ext-json": "*", 223 | "php": "^8.1", 224 | "pocketmine/binaryutils": "^0.2.0", 225 | "pocketmine/color": "^0.2.0 || ^0.3.0", 226 | "pocketmine/math": "^0.3.0 || ^0.4.0 || ^1.0.0", 227 | "pocketmine/nbt": "^1.0.0", 228 | "ramsey/uuid": "^4.1" 229 | }, 230 | "require-dev": { 231 | "phpstan/phpstan": "1.11.9", 232 | "phpstan/phpstan-phpunit": "^1.0.0", 233 | "phpstan/phpstan-strict-rules": "^1.0.0", 234 | "phpunit/phpunit": "^9.5 || ^10.0" 235 | }, 236 | "type": "library", 237 | "autoload": { 238 | "psr-4": { 239 | "pocketmine\\network\\mcpe\\protocol\\": "src/" 240 | } 241 | }, 242 | "notification-url": "https://packagist.org/downloads/", 243 | "license": [ 244 | "LGPL-3.0" 245 | ], 246 | "description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP", 247 | "support": { 248 | "issues": "https://github.com/pmmp/BedrockProtocol/issues", 249 | "source": "https://github.com/pmmp/BedrockProtocol/tree/35.0.0+bedrock-1.21.40" 250 | }, 251 | "time": "2024-10-24T15:45:43+00:00" 252 | }, 253 | { 254 | "name": "pocketmine/binaryutils", 255 | "version": "0.2.6", 256 | "source": { 257 | "type": "git", 258 | "url": "https://github.com/pmmp/BinaryUtils.git", 259 | "reference": "ccfc1899b859d45814ea3592e20ebec4cb731c84" 260 | }, 261 | "dist": { 262 | "type": "zip", 263 | "url": "https://api.github.com/repos/pmmp/BinaryUtils/zipball/ccfc1899b859d45814ea3592e20ebec4cb731c84", 264 | "reference": "ccfc1899b859d45814ea3592e20ebec4cb731c84", 265 | "shasum": "" 266 | }, 267 | "require": { 268 | "php": "^7.4 || ^8.0", 269 | "php-64bit": "*" 270 | }, 271 | "require-dev": { 272 | "phpstan/extension-installer": "^1.0", 273 | "phpstan/phpstan": "~1.10.3", 274 | "phpstan/phpstan-phpunit": "^1.0", 275 | "phpstan/phpstan-strict-rules": "^1.0.0", 276 | "phpunit/phpunit": "^9.5 || ^10.0 || ^11.0" 277 | }, 278 | "type": "library", 279 | "autoload": { 280 | "psr-4": { 281 | "pocketmine\\utils\\": "src/" 282 | } 283 | }, 284 | "notification-url": "https://packagist.org/downloads/", 285 | "license": [ 286 | "LGPL-3.0" 287 | ], 288 | "description": "Classes and methods for conveniently handling binary data", 289 | "support": { 290 | "issues": "https://github.com/pmmp/BinaryUtils/issues", 291 | "source": "https://github.com/pmmp/BinaryUtils/tree/0.2.6" 292 | }, 293 | "time": "2024-03-04T15:04:17+00:00" 294 | }, 295 | { 296 | "name": "pocketmine/callback-validator", 297 | "version": "1.0.3", 298 | "source": { 299 | "type": "git", 300 | "url": "https://github.com/pmmp/CallbackValidator.git", 301 | "reference": "64787469766bcaa7e5885242e85c23c25e8c55a2" 302 | }, 303 | "dist": { 304 | "type": "zip", 305 | "url": "https://api.github.com/repos/pmmp/CallbackValidator/zipball/64787469766bcaa7e5885242e85c23c25e8c55a2", 306 | "reference": "64787469766bcaa7e5885242e85c23c25e8c55a2", 307 | "shasum": "" 308 | }, 309 | "require": { 310 | "ext-reflection": "*", 311 | "php": "^7.1 || ^8.0" 312 | }, 313 | "replace": { 314 | "daverandom/callback-validator": "*" 315 | }, 316 | "require-dev": { 317 | "phpstan/extension-installer": "^1.0", 318 | "phpstan/phpstan": "0.12.59", 319 | "phpstan/phpstan-strict-rules": "^0.12.4", 320 | "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" 321 | }, 322 | "type": "library", 323 | "autoload": { 324 | "psr-4": { 325 | "DaveRandom\\CallbackValidator\\": "src/" 326 | } 327 | }, 328 | "notification-url": "https://packagist.org/downloads/", 329 | "license": [ 330 | "MIT" 331 | ], 332 | "authors": [ 333 | { 334 | "name": "Chris Wright", 335 | "email": "cw@daverandom.com" 336 | } 337 | ], 338 | "description": "Fork of daverandom/callback-validator - Tools for validating callback signatures", 339 | "support": { 340 | "issues": "https://github.com/pmmp/CallbackValidator/issues", 341 | "source": "https://github.com/pmmp/CallbackValidator/tree/1.0.3" 342 | }, 343 | "time": "2020-12-11T01:45:37+00:00" 344 | }, 345 | { 346 | "name": "pocketmine/color", 347 | "version": "0.3.1", 348 | "source": { 349 | "type": "git", 350 | "url": "https://github.com/pmmp/Color.git", 351 | "reference": "a0421f1e9e0b0c619300fb92d593283378f6a5e1" 352 | }, 353 | "dist": { 354 | "type": "zip", 355 | "url": "https://api.github.com/repos/pmmp/Color/zipball/a0421f1e9e0b0c619300fb92d593283378f6a5e1", 356 | "reference": "a0421f1e9e0b0c619300fb92d593283378f6a5e1", 357 | "shasum": "" 358 | }, 359 | "require": { 360 | "php": "^8.0" 361 | }, 362 | "require-dev": { 363 | "phpstan/phpstan": "1.10.3", 364 | "phpstan/phpstan-strict-rules": "^1.2.0" 365 | }, 366 | "type": "library", 367 | "autoload": { 368 | "psr-4": { 369 | "pocketmine\\color\\": "src/" 370 | } 371 | }, 372 | "notification-url": "https://packagist.org/downloads/", 373 | "license": [ 374 | "LGPL-3.0" 375 | ], 376 | "description": "Color handling library used by PocketMine-MP and related projects", 377 | "support": { 378 | "issues": "https://github.com/pmmp/Color/issues", 379 | "source": "https://github.com/pmmp/Color/tree/0.3.1" 380 | }, 381 | "time": "2023-04-10T11:38:05+00:00" 382 | }, 383 | { 384 | "name": "pocketmine/errorhandler", 385 | "version": "0.7.0", 386 | "source": { 387 | "type": "git", 388 | "url": "https://github.com/pmmp/ErrorHandler.git", 389 | "reference": "cae94884368a74ece5294b9ff7fef18732dcd921" 390 | }, 391 | "dist": { 392 | "type": "zip", 393 | "url": "https://api.github.com/repos/pmmp/ErrorHandler/zipball/cae94884368a74ece5294b9ff7fef18732dcd921", 394 | "reference": "cae94884368a74ece5294b9ff7fef18732dcd921", 395 | "shasum": "" 396 | }, 397 | "require": { 398 | "php": "^8.0" 399 | }, 400 | "require-dev": { 401 | "phpstan/phpstan": "~1.10.3", 402 | "phpstan/phpstan-strict-rules": "^1.0", 403 | "phpunit/phpunit": "^9.5 || ^10.0 || ^11.0" 404 | }, 405 | "type": "library", 406 | "autoload": { 407 | "psr-4": { 408 | "pocketmine\\errorhandler\\": "src/" 409 | } 410 | }, 411 | "notification-url": "https://packagist.org/downloads/", 412 | "license": [ 413 | "LGPL-3.0" 414 | ], 415 | "description": "Utilities to handle nasty PHP E_* errors in a usable way", 416 | "support": { 417 | "issues": "https://github.com/pmmp/ErrorHandler/issues", 418 | "source": "https://github.com/pmmp/ErrorHandler/tree/0.7.0" 419 | }, 420 | "time": "2024-04-02T18:29:54+00:00" 421 | }, 422 | { 423 | "name": "pocketmine/locale-data", 424 | "version": "2.19.6", 425 | "source": { 426 | "type": "git", 427 | "url": "https://github.com/pmmp/Language.git", 428 | "reference": "93e473e20e7f4515ecf45c5ef0f9155b9247a86e" 429 | }, 430 | "dist": { 431 | "type": "zip", 432 | "url": "https://api.github.com/repos/pmmp/Language/zipball/93e473e20e7f4515ecf45c5ef0f9155b9247a86e", 433 | "reference": "93e473e20e7f4515ecf45c5ef0f9155b9247a86e", 434 | "shasum": "" 435 | }, 436 | "type": "library", 437 | "notification-url": "https://packagist.org/downloads/", 438 | "description": "Language resources used by PocketMine-MP", 439 | "support": { 440 | "issues": "https://github.com/pmmp/Language/issues", 441 | "source": "https://github.com/pmmp/Language/tree/2.19.6" 442 | }, 443 | "time": "2023-08-08T16:53:23+00:00" 444 | }, 445 | { 446 | "name": "pocketmine/log", 447 | "version": "0.4.0", 448 | "source": { 449 | "type": "git", 450 | "url": "https://github.com/pmmp/Log.git", 451 | "reference": "e6c912c0f9055c81d23108ec2d179b96f404c043" 452 | }, 453 | "dist": { 454 | "type": "zip", 455 | "url": "https://api.github.com/repos/pmmp/Log/zipball/e6c912c0f9055c81d23108ec2d179b96f404c043", 456 | "reference": "e6c912c0f9055c81d23108ec2d179b96f404c043", 457 | "shasum": "" 458 | }, 459 | "require": { 460 | "php": "^7.4 || ^8.0" 461 | }, 462 | "conflict": { 463 | "pocketmine/spl": "<0.4" 464 | }, 465 | "require-dev": { 466 | "phpstan/phpstan": "0.12.88", 467 | "phpstan/phpstan-strict-rules": "^0.12.2" 468 | }, 469 | "type": "library", 470 | "autoload": { 471 | "classmap": [ 472 | "./src" 473 | ] 474 | }, 475 | "notification-url": "https://packagist.org/downloads/", 476 | "license": [ 477 | "LGPL-3.0" 478 | ], 479 | "description": "Logging components used by PocketMine-MP and related projects", 480 | "support": { 481 | "issues": "https://github.com/pmmp/Log/issues", 482 | "source": "https://github.com/pmmp/Log/tree/0.4.0" 483 | }, 484 | "time": "2021-06-18T19:08:09+00:00" 485 | }, 486 | { 487 | "name": "pocketmine/math", 488 | "version": "1.0.0", 489 | "source": { 490 | "type": "git", 491 | "url": "https://github.com/pmmp/Math.git", 492 | "reference": "dc132d93595b32e9f210d78b3c8d43c662a5edbf" 493 | }, 494 | "dist": { 495 | "type": "zip", 496 | "url": "https://api.github.com/repos/pmmp/Math/zipball/dc132d93595b32e9f210d78b3c8d43c662a5edbf", 497 | "reference": "dc132d93595b32e9f210d78b3c8d43c662a5edbf", 498 | "shasum": "" 499 | }, 500 | "require": { 501 | "php": "^8.0", 502 | "php-64bit": "*" 503 | }, 504 | "require-dev": { 505 | "phpstan/extension-installer": "^1.0", 506 | "phpstan/phpstan": "~1.10.3", 507 | "phpstan/phpstan-strict-rules": "^1.0", 508 | "phpunit/phpunit": "^8.5 || ^9.5" 509 | }, 510 | "type": "library", 511 | "autoload": { 512 | "psr-4": { 513 | "pocketmine\\math\\": "src/" 514 | } 515 | }, 516 | "notification-url": "https://packagist.org/downloads/", 517 | "license": [ 518 | "LGPL-3.0" 519 | ], 520 | "description": "PHP library containing math related code used in PocketMine-MP", 521 | "support": { 522 | "issues": "https://github.com/pmmp/Math/issues", 523 | "source": "https://github.com/pmmp/Math/tree/1.0.0" 524 | }, 525 | "time": "2023-08-03T12:56:33+00:00" 526 | }, 527 | { 528 | "name": "pocketmine/nbt", 529 | "version": "1.0.0", 530 | "source": { 531 | "type": "git", 532 | "url": "https://github.com/pmmp/NBT.git", 533 | "reference": "20540271cb59e04672cb163dca73366f207974f1" 534 | }, 535 | "dist": { 536 | "type": "zip", 537 | "url": "https://api.github.com/repos/pmmp/NBT/zipball/20540271cb59e04672cb163dca73366f207974f1", 538 | "reference": "20540271cb59e04672cb163dca73366f207974f1", 539 | "shasum": "" 540 | }, 541 | "require": { 542 | "php": "^7.4 || ^8.0", 543 | "php-64bit": "*", 544 | "pocketmine/binaryutils": "^0.2.0" 545 | }, 546 | "require-dev": { 547 | "phpstan/extension-installer": "^1.0", 548 | "phpstan/phpstan": "1.10.25", 549 | "phpstan/phpstan-strict-rules": "^1.0", 550 | "phpunit/phpunit": "^9.5" 551 | }, 552 | "type": "library", 553 | "autoload": { 554 | "psr-4": { 555 | "pocketmine\\nbt\\": "src/" 556 | } 557 | }, 558 | "notification-url": "https://packagist.org/downloads/", 559 | "license": [ 560 | "LGPL-3.0" 561 | ], 562 | "description": "PHP library for working with Named Binary Tags", 563 | "support": { 564 | "issues": "https://github.com/pmmp/NBT/issues", 565 | "source": "https://github.com/pmmp/NBT/tree/1.0.0" 566 | }, 567 | "time": "2023-07-14T13:01:49+00:00" 568 | }, 569 | { 570 | "name": "pocketmine/netresearch-jsonmapper", 571 | "version": "v4.4.999", 572 | "source": { 573 | "type": "git", 574 | "url": "https://github.com/pmmp/netresearch-jsonmapper.git", 575 | "reference": "9a6610033d56e358e86a3e4fd5f87063c7318833" 576 | }, 577 | "dist": { 578 | "type": "zip", 579 | "url": "https://api.github.com/repos/pmmp/netresearch-jsonmapper/zipball/9a6610033d56e358e86a3e4fd5f87063c7318833", 580 | "reference": "9a6610033d56e358e86a3e4fd5f87063c7318833", 581 | "shasum": "" 582 | }, 583 | "require": { 584 | "ext-json": "*", 585 | "ext-pcre": "*", 586 | "ext-reflection": "*", 587 | "ext-spl": "*", 588 | "php": ">=7.1" 589 | }, 590 | "replace": { 591 | "netresearch/jsonmapper": "~4.2.0" 592 | }, 593 | "require-dev": { 594 | "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0 || ~10.0", 595 | "squizlabs/php_codesniffer": "~3.5" 596 | }, 597 | "type": "library", 598 | "autoload": { 599 | "psr-0": { 600 | "JsonMapper": "src/" 601 | } 602 | }, 603 | "notification-url": "https://packagist.org/downloads/", 604 | "license": [ 605 | "OSL-3.0" 606 | ], 607 | "authors": [ 608 | { 609 | "name": "Christian Weiske", 610 | "email": "cweiske@cweiske.de", 611 | "homepage": "http://github.com/cweiske/jsonmapper/", 612 | "role": "Developer" 613 | } 614 | ], 615 | "description": "Fork of netresearch/jsonmapper with security fixes needed by pocketmine/pocketmine-mp", 616 | "support": { 617 | "email": "cweiske@cweiske.de", 618 | "issues": "https://github.com/cweiske/jsonmapper/issues", 619 | "source": "https://github.com/pmmp/netresearch-jsonmapper/tree/v4.4.999" 620 | }, 621 | "time": "2024-02-23T13:17:01+00:00" 622 | }, 623 | { 624 | "name": "pocketmine/pocketmine-mp", 625 | "version": "5.20.0", 626 | "source": { 627 | "type": "git", 628 | "url": "https://github.com/pmmp/PocketMine-MP.git", 629 | "reference": "414e8acf8c6d451e2614201a5dabc0b2f2887486" 630 | }, 631 | "dist": { 632 | "type": "zip", 633 | "url": "https://api.github.com/repos/pmmp/PocketMine-MP/zipball/414e8acf8c6d451e2614201a5dabc0b2f2887486", 634 | "reference": "414e8acf8c6d451e2614201a5dabc0b2f2887486", 635 | "shasum": "" 636 | }, 637 | "require": { 638 | "adhocore/json-comment": "~1.2.0", 639 | "composer-runtime-api": "^2.0", 640 | "ext-chunkutils2": "^0.3.1", 641 | "ext-crypto": "^0.3.1", 642 | "ext-ctype": "*", 643 | "ext-curl": "*", 644 | "ext-date": "*", 645 | "ext-gmp": "*", 646 | "ext-hash": "*", 647 | "ext-igbinary": "^3.0.1", 648 | "ext-json": "*", 649 | "ext-leveldb": "^0.2.1 || ^0.3.0", 650 | "ext-mbstring": "*", 651 | "ext-morton": "^0.1.0", 652 | "ext-openssl": "*", 653 | "ext-pcre": "*", 654 | "ext-phar": "*", 655 | "ext-pmmpthread": "^6.1.0", 656 | "ext-reflection": "*", 657 | "ext-simplexml": "*", 658 | "ext-sockets": "*", 659 | "ext-spl": "*", 660 | "ext-yaml": ">=2.0.0", 661 | "ext-zip": "*", 662 | "ext-zlib": ">=1.2.11", 663 | "php": "^8.1", 664 | "php-64bit": "*", 665 | "pocketmine/bedrock-block-upgrade-schema": "~4.5.0+bedrock-1.21.40", 666 | "pocketmine/bedrock-data": "~2.14.0+bedrock-1.21.40", 667 | "pocketmine/bedrock-item-upgrade-schema": "~1.13.0+bedrock-1.21.40", 668 | "pocketmine/bedrock-protocol": "~35.0.0+bedrock-1.21.40", 669 | "pocketmine/binaryutils": "^0.2.1", 670 | "pocketmine/callback-validator": "^1.0.2", 671 | "pocketmine/color": "^0.3.0", 672 | "pocketmine/errorhandler": "^0.7.0", 673 | "pocketmine/locale-data": "~2.19.0", 674 | "pocketmine/log": "^0.4.0", 675 | "pocketmine/math": "~1.0.0", 676 | "pocketmine/nbt": "~1.0.0", 677 | "pocketmine/netresearch-jsonmapper": "~v4.4.999", 678 | "pocketmine/raklib": "~1.1.0", 679 | "pocketmine/raklib-ipc": "~1.0.0", 680 | "pocketmine/snooze": "^0.5.0", 681 | "ramsey/uuid": "~4.7.0", 682 | "symfony/filesystem": "~6.4.0" 683 | }, 684 | "require-dev": { 685 | "phpstan/phpstan": "1.11.11", 686 | "phpstan/phpstan-phpunit": "^1.1.0", 687 | "phpstan/phpstan-strict-rules": "^1.2.0", 688 | "phpunit/phpunit": "^10.5.24" 689 | }, 690 | "type": "project", 691 | "autoload": { 692 | "files": [ 693 | "src/CoreConstants.php" 694 | ], 695 | "psr-4": { 696 | "pocketmine\\": "src/" 697 | } 698 | }, 699 | "notification-url": "https://packagist.org/downloads/", 700 | "license": [ 701 | "LGPL-3.0" 702 | ], 703 | "description": "A server software for Minecraft: Bedrock Edition written in PHP", 704 | "homepage": "https://pmmp.io", 705 | "support": { 706 | "issues": "https://github.com/pmmp/PocketMine-MP/issues", 707 | "source": "https://github.com/pmmp/PocketMine-MP/tree/5.20.0" 708 | }, 709 | "funding": [ 710 | { 711 | "url": "https://github.com/pmmp/PocketMine-MP#donate", 712 | "type": "custom" 713 | }, 714 | { 715 | "url": "https://www.patreon.com/pocketminemp", 716 | "type": "patreon" 717 | } 718 | ], 719 | "time": "2024-10-26T14:42:43+00:00" 720 | }, 721 | { 722 | "name": "pocketmine/raklib", 723 | "version": "1.1.1", 724 | "source": { 725 | "type": "git", 726 | "url": "https://github.com/pmmp/RakLib.git", 727 | "reference": "be2783be516bf6e2872ff5c81fb9048596617b97" 728 | }, 729 | "dist": { 730 | "type": "zip", 731 | "url": "https://api.github.com/repos/pmmp/RakLib/zipball/be2783be516bf6e2872ff5c81fb9048596617b97", 732 | "reference": "be2783be516bf6e2872ff5c81fb9048596617b97", 733 | "shasum": "" 734 | }, 735 | "require": { 736 | "ext-sockets": "*", 737 | "php": "^8.1", 738 | "php-64bit": "*", 739 | "php-ipv6": "*", 740 | "pocketmine/binaryutils": "^0.2.0", 741 | "pocketmine/log": "^0.3.0 || ^0.4.0" 742 | }, 743 | "require-dev": { 744 | "phpstan/phpstan": "1.10.1", 745 | "phpstan/phpstan-strict-rules": "^1.0" 746 | }, 747 | "type": "library", 748 | "autoload": { 749 | "psr-4": { 750 | "raklib\\": "src/" 751 | } 752 | }, 753 | "notification-url": "https://packagist.org/downloads/", 754 | "license": [ 755 | "GPL-3.0" 756 | ], 757 | "description": "A RakNet server implementation written in PHP", 758 | "support": { 759 | "issues": "https://github.com/pmmp/RakLib/issues", 760 | "source": "https://github.com/pmmp/RakLib/tree/1.1.1" 761 | }, 762 | "time": "2024-03-04T14:02:14+00:00" 763 | }, 764 | { 765 | "name": "pocketmine/raklib-ipc", 766 | "version": "1.0.1", 767 | "source": { 768 | "type": "git", 769 | "url": "https://github.com/pmmp/RakLibIpc.git", 770 | "reference": "ce632ef2c6743e71eddb5dc329c49af6555f90bc" 771 | }, 772 | "dist": { 773 | "type": "zip", 774 | "url": "https://api.github.com/repos/pmmp/RakLibIpc/zipball/ce632ef2c6743e71eddb5dc329c49af6555f90bc", 775 | "reference": "ce632ef2c6743e71eddb5dc329c49af6555f90bc", 776 | "shasum": "" 777 | }, 778 | "require": { 779 | "php": "^8.0", 780 | "php-64bit": "*", 781 | "pocketmine/binaryutils": "^0.2.0", 782 | "pocketmine/raklib": "^0.15.0 || ^1.0.0" 783 | }, 784 | "require-dev": { 785 | "phpstan/phpstan": "1.10.1", 786 | "phpstan/phpstan-strict-rules": "^1.0.0" 787 | }, 788 | "type": "library", 789 | "autoload": { 790 | "psr-4": { 791 | "raklib\\server\\ipc\\": "src/" 792 | } 793 | }, 794 | "notification-url": "https://packagist.org/downloads/", 795 | "license": [ 796 | "GPL-3.0" 797 | ], 798 | "description": "Channel-based protocols for inter-thread/inter-process communication with RakLib", 799 | "support": { 800 | "issues": "https://github.com/pmmp/RakLibIpc/issues", 801 | "source": "https://github.com/pmmp/RakLibIpc/tree/1.0.1" 802 | }, 803 | "time": "2024-03-01T15:55:05+00:00" 804 | }, 805 | { 806 | "name": "pocketmine/snooze", 807 | "version": "0.5.0", 808 | "source": { 809 | "type": "git", 810 | "url": "https://github.com/pmmp/Snooze.git", 811 | "reference": "a86d9ee60ce44755d166d3c7ba4b8b8be8360915" 812 | }, 813 | "dist": { 814 | "type": "zip", 815 | "url": "https://api.github.com/repos/pmmp/Snooze/zipball/a86d9ee60ce44755d166d3c7ba4b8b8be8360915", 816 | "reference": "a86d9ee60ce44755d166d3c7ba4b8b8be8360915", 817 | "shasum": "" 818 | }, 819 | "require": { 820 | "ext-pmmpthread": "^6.0", 821 | "php-64bit": "^8.1" 822 | }, 823 | "require-dev": { 824 | "phpstan/extension-installer": "^1.0", 825 | "phpstan/phpstan": "1.10.3", 826 | "phpstan/phpstan-strict-rules": "^1.0" 827 | }, 828 | "type": "library", 829 | "autoload": { 830 | "psr-4": { 831 | "pocketmine\\snooze\\": "src/" 832 | } 833 | }, 834 | "notification-url": "https://packagist.org/downloads/", 835 | "license": [ 836 | "LGPL-3.0" 837 | ], 838 | "description": "Thread notification management library for code using the pthreads extension", 839 | "support": { 840 | "issues": "https://github.com/pmmp/Snooze/issues", 841 | "source": "https://github.com/pmmp/Snooze/tree/0.5.0" 842 | }, 843 | "time": "2023-05-22T23:43:01+00:00" 844 | }, 845 | { 846 | "name": "ramsey/collection", 847 | "version": "2.0.0", 848 | "source": { 849 | "type": "git", 850 | "url": "https://github.com/ramsey/collection.git", 851 | "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" 852 | }, 853 | "dist": { 854 | "type": "zip", 855 | "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", 856 | "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", 857 | "shasum": "" 858 | }, 859 | "require": { 860 | "php": "^8.1" 861 | }, 862 | "require-dev": { 863 | "captainhook/plugin-composer": "^5.3", 864 | "ergebnis/composer-normalize": "^2.28.3", 865 | "fakerphp/faker": "^1.21", 866 | "hamcrest/hamcrest-php": "^2.0", 867 | "jangregor/phpstan-prophecy": "^1.0", 868 | "mockery/mockery": "^1.5", 869 | "php-parallel-lint/php-console-highlighter": "^1.0", 870 | "php-parallel-lint/php-parallel-lint": "^1.3", 871 | "phpcsstandards/phpcsutils": "^1.0.0-rc1", 872 | "phpspec/prophecy-phpunit": "^2.0", 873 | "phpstan/extension-installer": "^1.2", 874 | "phpstan/phpstan": "^1.9", 875 | "phpstan/phpstan-mockery": "^1.1", 876 | "phpstan/phpstan-phpunit": "^1.3", 877 | "phpunit/phpunit": "^9.5", 878 | "psalm/plugin-mockery": "^1.1", 879 | "psalm/plugin-phpunit": "^0.18.4", 880 | "ramsey/coding-standard": "^2.0.3", 881 | "ramsey/conventional-commits": "^1.3", 882 | "vimeo/psalm": "^5.4" 883 | }, 884 | "type": "library", 885 | "extra": { 886 | "captainhook": { 887 | "force-install": true 888 | }, 889 | "ramsey/conventional-commits": { 890 | "configFile": "conventional-commits.json" 891 | } 892 | }, 893 | "autoload": { 894 | "psr-4": { 895 | "Ramsey\\Collection\\": "src/" 896 | } 897 | }, 898 | "notification-url": "https://packagist.org/downloads/", 899 | "license": [ 900 | "MIT" 901 | ], 902 | "authors": [ 903 | { 904 | "name": "Ben Ramsey", 905 | "email": "ben@benramsey.com", 906 | "homepage": "https://benramsey.com" 907 | } 908 | ], 909 | "description": "A PHP library for representing and manipulating collections.", 910 | "keywords": [ 911 | "array", 912 | "collection", 913 | "hash", 914 | "map", 915 | "queue", 916 | "set" 917 | ], 918 | "support": { 919 | "issues": "https://github.com/ramsey/collection/issues", 920 | "source": "https://github.com/ramsey/collection/tree/2.0.0" 921 | }, 922 | "funding": [ 923 | { 924 | "url": "https://github.com/ramsey", 925 | "type": "github" 926 | }, 927 | { 928 | "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", 929 | "type": "tidelift" 930 | } 931 | ], 932 | "time": "2022-12-31T21:50:55+00:00" 933 | }, 934 | { 935 | "name": "ramsey/uuid", 936 | "version": "4.7.6", 937 | "source": { 938 | "type": "git", 939 | "url": "https://github.com/ramsey/uuid.git", 940 | "reference": "91039bc1faa45ba123c4328958e620d382ec7088" 941 | }, 942 | "dist": { 943 | "type": "zip", 944 | "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", 945 | "reference": "91039bc1faa45ba123c4328958e620d382ec7088", 946 | "shasum": "" 947 | }, 948 | "require": { 949 | "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", 950 | "ext-json": "*", 951 | "php": "^8.0", 952 | "ramsey/collection": "^1.2 || ^2.0" 953 | }, 954 | "replace": { 955 | "rhumsaa/uuid": "self.version" 956 | }, 957 | "require-dev": { 958 | "captainhook/captainhook": "^5.10", 959 | "captainhook/plugin-composer": "^5.3", 960 | "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", 961 | "doctrine/annotations": "^1.8", 962 | "ergebnis/composer-normalize": "^2.15", 963 | "mockery/mockery": "^1.3", 964 | "paragonie/random-lib": "^2", 965 | "php-mock/php-mock": "^2.2", 966 | "php-mock/php-mock-mockery": "^1.3", 967 | "php-parallel-lint/php-parallel-lint": "^1.1", 968 | "phpbench/phpbench": "^1.0", 969 | "phpstan/extension-installer": "^1.1", 970 | "phpstan/phpstan": "^1.8", 971 | "phpstan/phpstan-mockery": "^1.1", 972 | "phpstan/phpstan-phpunit": "^1.1", 973 | "phpunit/phpunit": "^8.5 || ^9", 974 | "ramsey/composer-repl": "^1.4", 975 | "slevomat/coding-standard": "^8.4", 976 | "squizlabs/php_codesniffer": "^3.5", 977 | "vimeo/psalm": "^4.9" 978 | }, 979 | "suggest": { 980 | "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", 981 | "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", 982 | "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", 983 | "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", 984 | "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." 985 | }, 986 | "type": "library", 987 | "extra": { 988 | "captainhook": { 989 | "force-install": true 990 | } 991 | }, 992 | "autoload": { 993 | "files": [ 994 | "src/functions.php" 995 | ], 996 | "psr-4": { 997 | "Ramsey\\Uuid\\": "src/" 998 | } 999 | }, 1000 | "notification-url": "https://packagist.org/downloads/", 1001 | "license": [ 1002 | "MIT" 1003 | ], 1004 | "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", 1005 | "keywords": [ 1006 | "guid", 1007 | "identifier", 1008 | "uuid" 1009 | ], 1010 | "support": { 1011 | "issues": "https://github.com/ramsey/uuid/issues", 1012 | "source": "https://github.com/ramsey/uuid/tree/4.7.6" 1013 | }, 1014 | "funding": [ 1015 | { 1016 | "url": "https://github.com/ramsey", 1017 | "type": "github" 1018 | }, 1019 | { 1020 | "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", 1021 | "type": "tidelift" 1022 | } 1023 | ], 1024 | "time": "2024-04-27T21:32:50+00:00" 1025 | }, 1026 | { 1027 | "name": "symfony/filesystem", 1028 | "version": "v6.4.13", 1029 | "source": { 1030 | "type": "git", 1031 | "url": "https://github.com/symfony/filesystem.git", 1032 | "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" 1033 | }, 1034 | "dist": { 1035 | "type": "zip", 1036 | "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", 1037 | "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", 1038 | "shasum": "" 1039 | }, 1040 | "require": { 1041 | "php": ">=8.1", 1042 | "symfony/polyfill-ctype": "~1.8", 1043 | "symfony/polyfill-mbstring": "~1.8" 1044 | }, 1045 | "require-dev": { 1046 | "symfony/process": "^5.4|^6.4|^7.0" 1047 | }, 1048 | "type": "library", 1049 | "autoload": { 1050 | "psr-4": { 1051 | "Symfony\\Component\\Filesystem\\": "" 1052 | }, 1053 | "exclude-from-classmap": [ 1054 | "/Tests/" 1055 | ] 1056 | }, 1057 | "notification-url": "https://packagist.org/downloads/", 1058 | "license": [ 1059 | "MIT" 1060 | ], 1061 | "authors": [ 1062 | { 1063 | "name": "Fabien Potencier", 1064 | "email": "fabien@symfony.com" 1065 | }, 1066 | { 1067 | "name": "Symfony Community", 1068 | "homepage": "https://symfony.com/contributors" 1069 | } 1070 | ], 1071 | "description": "Provides basic utilities for the filesystem", 1072 | "homepage": "https://symfony.com", 1073 | "support": { 1074 | "source": "https://github.com/symfony/filesystem/tree/v6.4.13" 1075 | }, 1076 | "funding": [ 1077 | { 1078 | "url": "https://symfony.com/sponsor", 1079 | "type": "custom" 1080 | }, 1081 | { 1082 | "url": "https://github.com/fabpot", 1083 | "type": "github" 1084 | }, 1085 | { 1086 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1087 | "type": "tidelift" 1088 | } 1089 | ], 1090 | "time": "2024-10-25T15:07:50+00:00" 1091 | }, 1092 | { 1093 | "name": "symfony/polyfill-ctype", 1094 | "version": "v1.31.0", 1095 | "source": { 1096 | "type": "git", 1097 | "url": "https://github.com/symfony/polyfill-ctype.git", 1098 | "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" 1099 | }, 1100 | "dist": { 1101 | "type": "zip", 1102 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", 1103 | "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", 1104 | "shasum": "" 1105 | }, 1106 | "require": { 1107 | "php": ">=7.2" 1108 | }, 1109 | "provide": { 1110 | "ext-ctype": "*" 1111 | }, 1112 | "suggest": { 1113 | "ext-ctype": "For best performance" 1114 | }, 1115 | "type": "library", 1116 | "extra": { 1117 | "thanks": { 1118 | "name": "symfony/polyfill", 1119 | "url": "https://github.com/symfony/polyfill" 1120 | } 1121 | }, 1122 | "autoload": { 1123 | "files": [ 1124 | "bootstrap.php" 1125 | ], 1126 | "psr-4": { 1127 | "Symfony\\Polyfill\\Ctype\\": "" 1128 | } 1129 | }, 1130 | "notification-url": "https://packagist.org/downloads/", 1131 | "license": [ 1132 | "MIT" 1133 | ], 1134 | "authors": [ 1135 | { 1136 | "name": "Gert de Pagter", 1137 | "email": "BackEndTea@gmail.com" 1138 | }, 1139 | { 1140 | "name": "Symfony Community", 1141 | "homepage": "https://symfony.com/contributors" 1142 | } 1143 | ], 1144 | "description": "Symfony polyfill for ctype functions", 1145 | "homepage": "https://symfony.com", 1146 | "keywords": [ 1147 | "compatibility", 1148 | "ctype", 1149 | "polyfill", 1150 | "portable" 1151 | ], 1152 | "support": { 1153 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" 1154 | }, 1155 | "funding": [ 1156 | { 1157 | "url": "https://symfony.com/sponsor", 1158 | "type": "custom" 1159 | }, 1160 | { 1161 | "url": "https://github.com/fabpot", 1162 | "type": "github" 1163 | }, 1164 | { 1165 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1166 | "type": "tidelift" 1167 | } 1168 | ], 1169 | "time": "2024-09-09T11:45:10+00:00" 1170 | }, 1171 | { 1172 | "name": "symfony/polyfill-mbstring", 1173 | "version": "v1.31.0", 1174 | "source": { 1175 | "type": "git", 1176 | "url": "https://github.com/symfony/polyfill-mbstring.git", 1177 | "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" 1178 | }, 1179 | "dist": { 1180 | "type": "zip", 1181 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", 1182 | "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", 1183 | "shasum": "" 1184 | }, 1185 | "require": { 1186 | "php": ">=7.2" 1187 | }, 1188 | "provide": { 1189 | "ext-mbstring": "*" 1190 | }, 1191 | "suggest": { 1192 | "ext-mbstring": "For best performance" 1193 | }, 1194 | "type": "library", 1195 | "extra": { 1196 | "thanks": { 1197 | "name": "symfony/polyfill", 1198 | "url": "https://github.com/symfony/polyfill" 1199 | } 1200 | }, 1201 | "autoload": { 1202 | "files": [ 1203 | "bootstrap.php" 1204 | ], 1205 | "psr-4": { 1206 | "Symfony\\Polyfill\\Mbstring\\": "" 1207 | } 1208 | }, 1209 | "notification-url": "https://packagist.org/downloads/", 1210 | "license": [ 1211 | "MIT" 1212 | ], 1213 | "authors": [ 1214 | { 1215 | "name": "Nicolas Grekas", 1216 | "email": "p@tchwork.com" 1217 | }, 1218 | { 1219 | "name": "Symfony Community", 1220 | "homepage": "https://symfony.com/contributors" 1221 | } 1222 | ], 1223 | "description": "Symfony polyfill for the Mbstring extension", 1224 | "homepage": "https://symfony.com", 1225 | "keywords": [ 1226 | "compatibility", 1227 | "mbstring", 1228 | "polyfill", 1229 | "portable", 1230 | "shim" 1231 | ], 1232 | "support": { 1233 | "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" 1234 | }, 1235 | "funding": [ 1236 | { 1237 | "url": "https://symfony.com/sponsor", 1238 | "type": "custom" 1239 | }, 1240 | { 1241 | "url": "https://github.com/fabpot", 1242 | "type": "github" 1243 | }, 1244 | { 1245 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1246 | "type": "tidelift" 1247 | } 1248 | ], 1249 | "time": "2024-09-09T11:45:10+00:00" 1250 | } 1251 | ], 1252 | "aliases": [], 1253 | "minimum-stability": "stable", 1254 | "stability-flags": [], 1255 | "prefer-stable": false, 1256 | "prefer-lowest": false, 1257 | "platform": [], 1258 | "platform-dev": [], 1259 | "plugin-api-version": "2.3.0" 1260 | } 1261 | -------------------------------------------------------------------------------- /src/tedo0627/inventoryui/CustomInventory.php: -------------------------------------------------------------------------------- 1 | title = $title; 31 | if ($verticalLength != null && 0 <= $verticalLength && $verticalLength <= 6) { 32 | $this->length = $verticalLength; 33 | } else { 34 | $length = intval($size / 9) + ($size % 9 == 0 ? 0 : 1); 35 | if ($length > 6) $length = 6; 36 | 37 | $this->length = $length; 38 | } 39 | 40 | $this->scroll = $this->length * 9 < $size; 41 | } 42 | 43 | public function getPackets(Player $player, int $id): array { 44 | $name = $player->getName(); 45 | if (!array_key_exists($name, $this->entities)) { 46 | $entity = new InventoryEntity($player->getLocation()); 47 | $entity->setSlot($this->getSize()); 48 | $scrollFlag = $this->scroll ? 1 : 0; 49 | $entity->setNameTag("§" . $this->length . "§" . $scrollFlag . "§r§r§r§r§r§r§r§r§r" . $this->title); 50 | $this->entities[$name] = $entity; 51 | } else { 52 | $entity = $this->entities[$name]; 53 | } 54 | 55 | $entity->spawnTo($player); 56 | 57 | $link = new EntityLink($player->getId(), $entity->getId(), EntityLink::TYPE_RIDER, true, true, 0.0); 58 | $pk1 = SetActorLinkPacket::create($link); 59 | 60 | $pk2 = ContainerOpenPacket::entityInv($id, WindowTypes::CONTAINER, $entity->getId()); 61 | $pk2->blockPosition = BlockPosition::fromVector3($entity->getLocation()); 62 | 63 | return [$pk1, $pk2]; 64 | } 65 | 66 | public final function onOpen(Player $who): void { 67 | parent::onOpen($who); 68 | 69 | $this->open($who); 70 | } 71 | 72 | public final function onClose(Player $who): void { 73 | parent::onClose($who); 74 | 75 | $name = $who->getName(); 76 | if (array_key_exists($name, $this->entities)) { 77 | $this->entities[$name]->close(); 78 | unset($this->entities[$name]); 79 | } 80 | 81 | $this->close($who); 82 | } 83 | 84 | public final function onTick(int $tick): void { 85 | if ($this->tick === $tick) return; 86 | 87 | $this->tick = $tick; 88 | $this->tick($tick); 89 | } 90 | 91 | public function getTitle(): string { 92 | return $this->title; 93 | } 94 | 95 | public function getVerticalLength(): int { 96 | return $this->length; 97 | } 98 | 99 | /** 100 | * Called when a player opens this inventory. 101 | */ 102 | public function open(Player $player): void { 103 | 104 | } 105 | 106 | /** 107 | * Called every tick when someone opens inventory. 108 | */ 109 | public function close(Player $player): void { 110 | 111 | } 112 | 113 | /** 114 | * Called when a slot in the inventory is operated. 115 | * 116 | * @return bool If true, the operation is canceled. 117 | */ 118 | public function click(Player $player, int $slot, Item $sourceItem, Item $targetItem): bool { 119 | return false; 120 | } 121 | 122 | /** 123 | * Called when the player closes the inventory. 124 | */ 125 | public function tick(int $tick): void { 126 | 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/tedo0627/inventoryui/EventListener.php: -------------------------------------------------------------------------------- 1 | getPlayer(); 15 | $player->getNetworkSession() 16 | ->getInvManager() 17 | ?->getContainerOpenCallbacks() 18 | ->add(function(int $id, Inventory $inventory) use($player): ?array { 19 | if (!$inventory instanceof CustomInventory) return null; 20 | 21 | return $inventory->getPackets($player, $id); 22 | }); 23 | } 24 | 25 | public function onInventoryTransaction(InventoryTransactionEvent $event): void { 26 | $transaction = $event->getTransaction(); 27 | foreach ($transaction->getActions() as $action) { 28 | if (!$action instanceof SlotChangeAction) continue; 29 | 30 | $inventory = $action->getInventory(); 31 | if (!$inventory instanceof CustomInventory) continue; 32 | 33 | $player = $transaction->getSource(); 34 | $slot = $action->getSlot(); 35 | if (!$inventory->click($player, $slot, $action->getSourceItem(), $action->getTargetItem())) continue; 36 | 37 | $event->cancel(); 38 | return; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/tedo0627/inventoryui/InventoryEntity.php: -------------------------------------------------------------------------------- 1 | setCanSaveWithChunk(false); 32 | $this->networkPropertiesDirty = true; 33 | } 34 | 35 | protected function syncNetworkData(EntityMetadataCollection $properties): void { 36 | parent::syncNetworkData($properties); 37 | 38 | $properties->setByte(EntityMetadataProperties::CONTAINER_TYPE, WindowTypes::INVENTORY); 39 | $properties->setInt(EntityMetadataProperties::CONTAINER_BASE_SIZE, $this->slot); 40 | } 41 | 42 | protected int $slot = 9; 43 | 44 | public function getSlot(): int { 45 | return $this->slot; 46 | } 47 | 48 | public function setSlot(int $slot): void { 49 | $this->slot = $slot; 50 | $this->networkPropertiesDirty = true; 51 | 52 | $changedProperties = $this->getDirtyNetworkData(); 53 | if (count($changedProperties) <= 0) return; 54 | 55 | $this->sendData(null, $changedProperties); 56 | $this->getNetworkProperties()->clearDirtyProperties(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/tedo0627/inventoryui/InventoryTickTask.php: -------------------------------------------------------------------------------- 1 | server->getOnlinePlayers() as $player) { 16 | $inventory = $player->getCurrentWindow(); 17 | if ($inventory instanceof CustomInventory) $inventory->onTick($this->tick); 18 | } 19 | 20 | $this->tick++; 21 | } 22 | } -------------------------------------------------------------------------------- /src/tedo0627/inventoryui/InventoryUI.php: -------------------------------------------------------------------------------- 1 | getServer(); 21 | 22 | $manager = $server->getResourcePackManager(); 23 | if (!$manager->resourcePacksRequired()) { 24 | throw new InventoryUIResourcePackException("'force_resources' must be set to 'true'"); 25 | } 26 | 27 | $pack = $manager->getPackById(self::uuid); 28 | if ($pack === null) { 29 | throw new InventoryUIResourcePackException("Resource pack 'Inventory UI Resource Pack' not found"); 30 | } 31 | 32 | if ($pack->getPackVersion() !== self::version) { 33 | throw new InventoryUIResourcePackException("'Inventory UI Resource Pack' version did not match"); 34 | } 35 | 36 | $server->getPluginManager()->registerEvents(new EventListener(), $plugin); 37 | 38 | $plugin->getScheduler()->scheduleRepeatingTask(new InventoryTickTask($server), 1); 39 | 40 | $nbt = new CompoundTag(); 41 | $nbt->setString("bid", ""); 42 | $nbt->setByte("hasspawnegg", false); 43 | $nbt->setString("id", "inventoryui:inventoryui"); 44 | $nbt->setByte("summonable", false); 45 | 46 | $packet = StaticPacketCache::getInstance()->getAvailableActorIdentifiers(); 47 | $tag = $packet->identifiers->getRoot(); 48 | if ($tag instanceof CompoundTag) { 49 | $tag->getListTag("idlist")->push($nbt); 50 | } 51 | 52 | self::$setup = true; 53 | } 54 | } -------------------------------------------------------------------------------- /src/tedo0627/inventoryui/exception/IllegalInventorySizeException.php: -------------------------------------------------------------------------------- 1 |