mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Compare commits
199 Commits
5.32.0
...
block-laye
Author | SHA1 | Date | |
---|---|---|---|
a0f5ad1669 | |||
0f932f7cc0 | |||
f01d87474d | |||
7472c5b73d | |||
941632bed9 | |||
e5a38f270c | |||
7c651928ea | |||
48cc87d066 | |||
72781f4042 | |||
30d13508b4 | |||
ba2a7cceaf | |||
98f0417611 | |||
6e861afd9e | |||
8005c74681 | |||
afcd6b4e12 | |||
45e350ddf7 | |||
7082522509 | |||
68126b308a | |||
258923cc78 | |||
e4b6f96535 | |||
f8ed7efb3f | |||
6340d12881 | |||
6d32ea5850 | |||
8229ee1812 | |||
950fb48bcb | |||
9e773ed439 | |||
6b5ff5016e | |||
215da7e3f4 | |||
c3ea6edc22 | |||
0330b25768 | |||
d5a1007c80 | |||
dca2665e17 | |||
05eda887b1 | |||
18b6b1742c | |||
b20d1b84b5 | |||
a8e898b13b | |||
d907d72e9b | |||
9d532b6e95 | |||
bb7bfee0cd | |||
88cdc2eb67 | |||
112bcf7af9 | |||
1c70cee72e | |||
7847524df6 | |||
1d26b21fe0 | |||
eb3922fc7e | |||
912a5d6ad0 | |||
2a42e2c75d | |||
3de604ef95 | |||
cb4364f8fd | |||
5bfa40618d | |||
8e1426e25e | |||
d86943fa8c | |||
baee0110c7 | |||
5617347949 | |||
0bbe56beb4 | |||
94caea97e0 | |||
ad95f392c1 | |||
9af3cde03f | |||
72f1391bd9 | |||
a90e5a6aa2 | |||
df5f87e309 | |||
510ef94698 | |||
d3f40b7b0c | |||
dae3e2b336 | |||
f2fa5933ea | |||
95a324755b | |||
1d13054608 | |||
ec140f7861 | |||
66f5bdcb94 | |||
5d24d8de0b | |||
1ad08e2432 | |||
a43ebcf217 | |||
c637d852e2 | |||
c58c64de85 | |||
694aa17cc9 | |||
c9441e1078 | |||
b0ac8863c4 | |||
e9df0baffb | |||
b3723b5b3e | |||
b370b5458f | |||
8af2d05ec0 | |||
4d186b52da | |||
e6ff55823f | |||
d556389b11 | |||
976fc63567 | |||
02ac512b4e | |||
708784b0a2 | |||
3f7f11b812 | |||
984e995659 | |||
46604b26f2 | |||
6b2fb9c4f8 | |||
80b761627a | |||
882d8c4ab9 | |||
1c35987ead | |||
88ae00fc4d | |||
47a1aa6470 | |||
3e69ee87e4 | |||
a2a2ec9d8b | |||
3a0f15ef0d | |||
7a2427ace2 | |||
f82c8dd3d3 | |||
851bbd7384 | |||
1ee52b69b0 | |||
851f7a9d80 | |||
6d2329128a | |||
07045dd424 | |||
c5b0df4578 | |||
5e9dbace90 | |||
205aabe11f | |||
3091e1325f | |||
779e80a961 | |||
007673cb96 | |||
0dae786a21 | |||
02d181d0c8 | |||
2fc6bbe84e | |||
002383be89 | |||
00bdb6be73 | |||
c3c917bb05 | |||
a078f653f4 | |||
ed33983792 | |||
15eaf67a0c | |||
d72941c36c | |||
e51903d7ea | |||
3e9a96b43a | |||
9fce27eaa8 | |||
7208733d62 | |||
c61434d87b | |||
dcc258706f | |||
820e2d4a2f | |||
0fb1415f7f | |||
a6534ecbbb | |||
330bcd2423 | |||
e71b9e8dc6 | |||
9e2d91bae6 | |||
b6f55b78a9 | |||
ab5176baf9 | |||
ef6fce4091 | |||
cc335889f3 | |||
80b7f6aba4 | |||
82c5a3160c | |||
85de28d6c3 | |||
1ef854f2d1 | |||
082af9978c | |||
e8620ef94d | |||
83a91634c3 | |||
3c73bd22dd | |||
0e1824451b | |||
6c5ae634fd | |||
041944ed16 | |||
603527c6e8 | |||
1ac08ea73b | |||
c9e8d382c5 | |||
12179aa03a | |||
e781c64540 | |||
644693ffee | |||
6b66cbfb1c | |||
4d337add7c | |||
9d75c45bf5 | |||
c7a537abbb | |||
54694df48c | |||
15aae721cd | |||
d565be93a8 | |||
e32a90be72 | |||
d4d7d02067 | |||
a45e143e81 | |||
05981d2669 | |||
fa9bba470c | |||
361626d236 | |||
16d8522245 | |||
a4f3476190 | |||
e96e68d221 | |||
f1a6d71cc1 | |||
89f42c80d4 | |||
cd6b780d31 | |||
ed61a68013 | |||
4dc9d696d0 | |||
258038c9a9 | |||
5c915a3dfe | |||
8c594fd126 | |||
9fd6653f36 | |||
32d67080e5 | |||
ed9d057ca2 | |||
5ec0e0f20b | |||
cb251069dd | |||
e0ad39b70a | |||
9997b614bc | |||
89f8f421a6 | |||
c4ff6d7757 | |||
3c0e7ae492 | |||
b944205f60 | |||
2ab3393568 | |||
1e1b95e1b8 | |||
62465fa676 | |||
aac5944396 | |||
74cfd687d7 | |||
f2f30143b0 | |||
d98adf127f | |||
280bf60830 | |||
1ffa945fbf |
4
.github/workflows/discord-release-notify.yml
vendored
4
.github/workflows/discord-release-notify.yml
vendored
@ -13,9 +13,9 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP and tools
|
||||
uses: shivammathur/setup-php@2.34.1
|
||||
uses: shivammathur/setup-php@2.33.0
|
||||
with:
|
||||
php-version: 8.2
|
||||
php-version: 8.3
|
||||
|
||||
- name: Restore Composer package cache
|
||||
uses: actions/cache@v4
|
||||
|
4
.github/workflows/draft-release-pr-check.yml
vendored
4
.github/workflows/draft-release-pr-check.yml
vendored
@ -49,9 +49,9 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@2.34.1
|
||||
uses: shivammathur/setup-php@2.33.0
|
||||
with:
|
||||
php-version: 8.2
|
||||
php-version: 8.3
|
||||
|
||||
- name: Restore Composer package cache
|
||||
uses: actions/cache@v4
|
||||
|
6
.github/workflows/draft-release.yml
vendored
6
.github/workflows/draft-release.yml
vendored
@ -18,7 +18,7 @@ on:
|
||||
- "*"
|
||||
|
||||
env:
|
||||
PHP_VERSION: "8.2"
|
||||
PHP_VERSION: "8.3"
|
||||
|
||||
jobs:
|
||||
skip:
|
||||
@ -87,7 +87,7 @@ jobs:
|
||||
submodules: true
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@2.34.1
|
||||
uses: shivammathur/setup-php@2.33.0
|
||||
with:
|
||||
php-version: ${{ env.PHP_VERSION }}
|
||||
|
||||
@ -165,7 +165,7 @@ jobs:
|
||||
${{ github.workspace }}/core-permissions.rst
|
||||
|
||||
- name: Create draft release
|
||||
uses: ncipollo/release-action@v1.18.0
|
||||
uses: ncipollo/release-action@v1.16.0
|
||||
id: create-draft
|
||||
with:
|
||||
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json,${{ github.workspace }}/core-permissions.rst
|
||||
|
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: ["8.1", "8.2", "8.3"]
|
||||
php: ["8.3"]
|
||||
|
||||
uses: ./.github/workflows/main-php-matrix.yml
|
||||
with:
|
||||
@ -28,7 +28,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PHP and tools
|
||||
uses: shivammathur/setup-php@2.34.1
|
||||
uses: shivammathur/setup-php@2.33.0
|
||||
with:
|
||||
php-version: 8.3
|
||||
tools: php-cs-fixer:3.75
|
||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,6 +1,3 @@
|
||||
[submodule "tests/plugins/DevTools"]
|
||||
path = tests/plugins/DevTools
|
||||
url = https://github.com/pmmp/DevTools.git
|
||||
[submodule "build/php"]
|
||||
path = build/php
|
||||
url = https://github.com/pmmp/php-build-scripts.git
|
||||
|
@ -5,7 +5,7 @@ $finder = PhpCsFixer\Finder::create()
|
||||
->in(__DIR__ . '/build')
|
||||
->in(__DIR__ . '/tests')
|
||||
->in(__DIR__ . '/tools')
|
||||
->notPath('plugins/DevTools')
|
||||
|
||||
//JsonMapper will break if the FQNs in the doc comments for these are shortened :(
|
||||
->notPath('crafting/json')
|
||||
->notPath('inventory/json')
|
||||
|
@ -12,7 +12,7 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/pmmp/PocketMine-MP/actions/workflows/main.yml"><img src="https://github.com/pmmp/PocketMine-MP/actions/workflows/main.yml/badge.svg" alt="CI" /></a>
|
||||
<a href="https://github.com/pmmp/PocketMine-MP/actions/workflows/main.yml"><img src="https://github.com/pmmp/PocketMine-MP/workflows/CI/badge.svg" alt="CI" /></a>
|
||||
<a href="https://github.com/pmmp/PocketMine-MP/releases/latest"><img alt="GitHub release (latest SemVer)" src="https://img.shields.io/github/v/release/pmmp/PocketMine-MP?label=release&sort=semver"></a>
|
||||
<a href="https://discord.gg/bmSAZBG"><img src="https://img.shields.io/discord/373199722573201408?label=discord&color=7289DA&logo=discord" alt="Discord" /></a>
|
||||
<br>
|
||||
|
@ -1,14 +0,0 @@
|
||||
# 5.31.0
|
||||
Released 8th July 2025.
|
||||
|
||||
This is a support release for Minecraft: Bedrock Edition 1.21.93.
|
||||
|
||||
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
|
||||
Do not update plugin minimum API versions unless you need new features added in this release.
|
||||
|
||||
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
|
||||
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
|
||||
|
||||
## General
|
||||
- Added support for Minecraft: Bedrock Edition 1.21.93.
|
||||
- Removed support for earlier versions.
|
@ -1,17 +0,0 @@
|
||||
# 5.32.0
|
||||
Released 6th August 2025.
|
||||
|
||||
This is a support release for Minecraft: Bedrock Edition 1.21.100.
|
||||
|
||||
**Plugin compatibility:** Plugins for previous 5.x versions will run unchanged on this release, unless they use internal APIs, reflection, or packages like the `pocketmine\network\mcpe` or `pocketmine\data` namespace.
|
||||
Do not update plugin minimum API versions unless you need new features added in this release.
|
||||
|
||||
**WARNING: If your plugin uses the `pocketmine\network\mcpe` namespace, you're not shielded by API change constraints.**
|
||||
Consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you're using packets directly.
|
||||
|
||||
## General
|
||||
- Added support for Minecraft: Bedrock Edition 1.21.100.
|
||||
- Removed support for earlier versions.
|
||||
|
||||
## Fixes
|
||||
- Fixed deadlock on RakLib thread crash (e.g. due to port binding failure).
|
@ -5,7 +5,7 @@
|
||||
"homepage": "https://pmmp.io",
|
||||
"license": "LGPL-3.0",
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"php": "^8.3",
|
||||
"php-64bit": "*",
|
||||
"ext-chunkutils2": "^0.3.1",
|
||||
"ext-crypto": "^0.3.1",
|
||||
@ -34,9 +34,9 @@
|
||||
"adhocore/json-comment": "~1.2.0",
|
||||
"netresearch/jsonmapper": "~v5.0.0",
|
||||
"pocketmine/bedrock-block-upgrade-schema": "~5.1.0+bedrock-1.21.60",
|
||||
"pocketmine/bedrock-data": "~5.3.0+bedrock-1.21.100",
|
||||
"pocketmine/bedrock-item-upgrade-schema": "~1.15.0+bedrock-1.21.100",
|
||||
"pocketmine/bedrock-protocol": "~40.0.0+bedrock-1.21.100",
|
||||
"pocketmine/bedrock-data": "~5.1.0+bedrock-1.21.90",
|
||||
"pocketmine/bedrock-item-upgrade-schema": "~1.14.0+bedrock-1.21.50",
|
||||
"pocketmine/bedrock-protocol": "~39.0.0+bedrock-1.21.90",
|
||||
"pocketmine/binaryutils": "^0.2.1",
|
||||
"pocketmine/callback-validator": "^1.0.2",
|
||||
"pocketmine/color": "^0.3.0",
|
||||
@ -48,14 +48,14 @@
|
||||
"pocketmine/raklib": "~1.2.0",
|
||||
"pocketmine/raklib-ipc": "~1.0.0",
|
||||
"pocketmine/snooze": "^0.5.0",
|
||||
"ramsey/uuid": "~4.9.0",
|
||||
"symfony/filesystem": "~6.4.0"
|
||||
"ramsey/uuid": "~4.8.0",
|
||||
"symfony/filesystem": "~7.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "2.1.17",
|
||||
"phpstan/phpstan-phpunit": "^2.0.0",
|
||||
"phpstan/phpstan-strict-rules": "^2.0.0",
|
||||
"phpunit/phpunit": "^10.5.24"
|
||||
"phpunit/phpunit": "^12.2.1"
|
||||
},
|
||||
"replace": {
|
||||
"symfony/polyfill-ctype": "*",
|
||||
@ -77,12 +77,11 @@
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "8.1.0"
|
||||
"php": "8.3.0"
|
||||
},
|
||||
"sort-packages": true
|
||||
},
|
||||
"scripts": {
|
||||
"make-devtools": "@php -dphar.readonly=0 tests/plugins/DevTools/src/ConsoleScript.php --make ./ --relative tests/plugins/DevTools --out plugins/DevTools.phar",
|
||||
"make-server": [
|
||||
"@composer install --no-dev --classmap-authoritative --ignore-platform-reqs",
|
||||
"@php -dphar.readonly=0 build/server-phar.php"
|
||||
|
687
composer.lock
generated
687
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -10,9 +10,7 @@ includes:
|
||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||
|
||||
rules:
|
||||
- pocketmine\phpstan\rules\DeprecatedLegacyEnumAccessRule
|
||||
- pocketmine\phpstan\rules\DisallowDynamicNewRule
|
||||
- pocketmine\phpstan\rules\DisallowEnumComparisonRule
|
||||
- pocketmine\phpstan\rules\DisallowForeachByReferenceRule
|
||||
- pocketmine\phpstan\rules\ExplodeLimitRule
|
||||
- pocketmine\phpstan\rules\UnsafeForeachRule
|
||||
|
@ -123,13 +123,6 @@ class MemoryManager{
|
||||
return $this->globalMemoryLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function canUseChunkCache() : bool{
|
||||
return !$this->lowMemory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the allowed chunk radius based on the current memory usage.
|
||||
*/
|
||||
@ -236,13 +229,4 @@ class MemoryManager{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Static memory dumper accessible from any thread.
|
||||
* @deprecated
|
||||
* @see MemoryDump
|
||||
*/
|
||||
public static function dumpMemory(mixed $startingObject, string $outputFolder, int $maxNesting, int $maxStringSize, \Logger $logger) : void{
|
||||
MemoryDump::dumpMemory($startingObject, $outputFolder, $maxNesting, $maxStringSize, $logger);
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace pocketmine {
|
||||
|
||||
require_once __DIR__ . '/VersionInfo.php';
|
||||
|
||||
const MIN_PHP_VERSION = "8.1.0";
|
||||
const MIN_PHP_VERSION = "8.3.0";
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
|
@ -80,6 +80,7 @@ use pocketmine\player\PlayerDataLoadException;
|
||||
use pocketmine\player\PlayerDataProvider;
|
||||
use pocketmine\player\PlayerDataSaveException;
|
||||
use pocketmine\player\PlayerInfo;
|
||||
use pocketmine\plugin\FolderPluginLoader;
|
||||
use pocketmine\plugin\PharPluginLoader;
|
||||
use pocketmine\plugin\PluginEnableOrder;
|
||||
use pocketmine\plugin\PluginGraylist;
|
||||
@ -346,6 +347,10 @@ class Server{
|
||||
return $this->maxPlayers;
|
||||
}
|
||||
|
||||
public function setMaxPlayers(int $maxPlayers) : void{
|
||||
$this->maxPlayers = $maxPlayers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the server requires that players be authenticated to Xbox Live. If true, connecting players who
|
||||
* are not logged into Xbox Live will be disconnected.
|
||||
@ -1029,6 +1034,7 @@ class Server{
|
||||
$this->pluginManager = new PluginManager($this, $this->configGroup->getPropertyBool(Yml::PLUGINS_LEGACY_DATA_DIR, true) ? null : Path::join($this->dataPath, "plugin_data"), $pluginGraylist);
|
||||
$this->pluginManager->registerInterface(new PharPluginLoader($this->autoloader));
|
||||
$this->pluginManager->registerInterface(new ScriptPluginLoader());
|
||||
$this->pluginManager->registerInterface(new FolderPluginLoader($this->autoloader));
|
||||
|
||||
$providerManager = new WorldProviderManager();
|
||||
if(
|
||||
|
@ -31,8 +31,8 @@ use function str_repeat;
|
||||
|
||||
final class VersionInfo{
|
||||
public const NAME = "PocketMine-MP";
|
||||
public const BASE_VERSION = "5.32.0";
|
||||
public const IS_DEVELOPMENT_BUILD = false;
|
||||
public const BASE_VERSION = "5.30.2";
|
||||
public const IS_DEVELOPMENT_BUILD = true;
|
||||
public const BUILD_CHANNEL = "stable";
|
||||
|
||||
/**
|
||||
|
@ -58,17 +58,10 @@ class SweetBerryBush extends Flowable{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
protected function canBeSupportedBy(Block $block) : bool{
|
||||
return $block->getTypeId() !== BlockTypeIds::FARMLAND && //bedrock-specific thing (bug?)
|
||||
($block->hasTypeTag(BlockTypeTags::DIRT) || $block->hasTypeTag(BlockTypeTags::MUD));
|
||||
}
|
||||
|
||||
private function canBeSupportedAt(Block $block) : bool{
|
||||
$supportBlock = $block->getSide(Facing::DOWN);
|
||||
return $this->canBeSupportedBy($supportBlock);
|
||||
return $supportBlock->getTypeId() !== BlockTypeIds::FARMLAND && //bedrock-specific thing (bug?)
|
||||
($supportBlock->hasTypeTag(BlockTypeTags::DIRT) || $supportBlock->hasTypeTag(BlockTypeTags::MUD));
|
||||
}
|
||||
|
||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
|
||||
|
@ -805,8 +805,8 @@ use function strtolower;
|
||||
* @method static Water WATER()
|
||||
* @method static WaterCauldron WATER_CAULDRON()
|
||||
* @method static NetherVines WEEPING_VINES()
|
||||
* @method static WeightedPressurePlateHeavy WEIGHTED_PRESSURE_PLATE_HEAVY()
|
||||
* @method static WeightedPressurePlateLight WEIGHTED_PRESSURE_PLATE_LIGHT()
|
||||
* @method static WeightedPressurePlate WEIGHTED_PRESSURE_PLATE_HEAVY()
|
||||
* @method static WeightedPressurePlate WEIGHTED_PRESSURE_PLATE_LIGHT()
|
||||
* @method static Wheat WHEAT()
|
||||
* @method static Flower WHITE_TULIP()
|
||||
* @method static WitherRose WITHER_ROSE()
|
||||
@ -1203,14 +1203,14 @@ final class VanillaBlocks{
|
||||
self::register("lily_pad", fn(BID $id) => new WaterLily($id, "Lily Pad", new Info(BreakInfo::instant())));
|
||||
|
||||
$weightedPressurePlateBreakInfo = new Info(BreakInfo::pickaxe(0.5));
|
||||
self::register("weighted_pressure_plate_heavy", fn(BID $id) => new WeightedPressurePlateHeavy(
|
||||
self::register("weighted_pressure_plate_heavy", fn(BID $id) => new WeightedPressurePlate(
|
||||
$id,
|
||||
"Weighted Pressure Plate Heavy",
|
||||
$weightedPressurePlateBreakInfo,
|
||||
deactivationDelayTicks: 10,
|
||||
signalStrengthFactor: 0.1
|
||||
));
|
||||
self::register("weighted_pressure_plate_light", fn(BID $id) => new WeightedPressurePlateLight(
|
||||
self::register("weighted_pressure_plate_light", fn(BID $id) => new WeightedPressurePlate(
|
||||
$id,
|
||||
"Weighted Pressure Plate Light",
|
||||
$weightedPressurePlateBreakInfo,
|
||||
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
class WeightedPressurePlateHeavy extends WeightedPressurePlate{
|
||||
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
class WeightedPressurePlateLight extends WeightedPressurePlate{
|
||||
|
||||
}
|
@ -35,20 +35,6 @@ abstract class Spawnable extends Tile{
|
||||
/** @phpstan-var CacheableNbt<CompoundTag>|null */
|
||||
private ?CacheableNbt $spawnCompoundCache = null;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function isDirty() : bool{
|
||||
return $this->spawnCompoundCache === null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public function setDirty(bool $dirty = true) : void{
|
||||
$this->clearSpawnCompoundCache();
|
||||
}
|
||||
|
||||
public function clearSpawnCompoundCache() : void{
|
||||
$this->spawnCompoundCache = null;
|
||||
}
|
||||
|
@ -23,54 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static BannerPatternType BORDER()
|
||||
* @method static BannerPatternType BRICKS()
|
||||
* @method static BannerPatternType CIRCLE()
|
||||
* @method static BannerPatternType CREEPER()
|
||||
* @method static BannerPatternType CROSS()
|
||||
* @method static BannerPatternType CURLY_BORDER()
|
||||
* @method static BannerPatternType DIAGONAL_LEFT()
|
||||
* @method static BannerPatternType DIAGONAL_RIGHT()
|
||||
* @method static BannerPatternType DIAGONAL_UP_LEFT()
|
||||
* @method static BannerPatternType DIAGONAL_UP_RIGHT()
|
||||
* @method static BannerPatternType FLOWER()
|
||||
* @method static BannerPatternType GRADIENT()
|
||||
* @method static BannerPatternType GRADIENT_UP()
|
||||
* @method static BannerPatternType HALF_HORIZONTAL()
|
||||
* @method static BannerPatternType HALF_HORIZONTAL_BOTTOM()
|
||||
* @method static BannerPatternType HALF_VERTICAL()
|
||||
* @method static BannerPatternType HALF_VERTICAL_RIGHT()
|
||||
* @method static BannerPatternType MOJANG()
|
||||
* @method static BannerPatternType RHOMBUS()
|
||||
* @method static BannerPatternType SKULL()
|
||||
* @method static BannerPatternType SMALL_STRIPES()
|
||||
* @method static BannerPatternType SQUARE_BOTTOM_LEFT()
|
||||
* @method static BannerPatternType SQUARE_BOTTOM_RIGHT()
|
||||
* @method static BannerPatternType SQUARE_TOP_LEFT()
|
||||
* @method static BannerPatternType SQUARE_TOP_RIGHT()
|
||||
* @method static BannerPatternType STRAIGHT_CROSS()
|
||||
* @method static BannerPatternType STRIPE_BOTTOM()
|
||||
* @method static BannerPatternType STRIPE_CENTER()
|
||||
* @method static BannerPatternType STRIPE_DOWNLEFT()
|
||||
* @method static BannerPatternType STRIPE_DOWNRIGHT()
|
||||
* @method static BannerPatternType STRIPE_LEFT()
|
||||
* @method static BannerPatternType STRIPE_MIDDLE()
|
||||
* @method static BannerPatternType STRIPE_RIGHT()
|
||||
* @method static BannerPatternType STRIPE_TOP()
|
||||
* @method static BannerPatternType TRIANGLES_BOTTOM()
|
||||
* @method static BannerPatternType TRIANGLES_TOP()
|
||||
* @method static BannerPatternType TRIANGLE_BOTTOM()
|
||||
* @method static BannerPatternType TRIANGLE_TOP()
|
||||
*/
|
||||
enum BannerPatternType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case BORDER;
|
||||
case BRICKS;
|
||||
case CIRCLE;
|
||||
|
@ -23,20 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static BellAttachmentType CEILING()
|
||||
* @method static BellAttachmentType FLOOR()
|
||||
* @method static BellAttachmentType ONE_WALL()
|
||||
* @method static BellAttachmentType TWO_WALLS()
|
||||
*/
|
||||
enum BellAttachmentType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case CEILING;
|
||||
case FLOOR;
|
||||
case ONE_WALL;
|
||||
|
@ -24,19 +24,8 @@ declare(strict_types=1);
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\block\inventory\BrewingStandInventory;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static BrewingStandSlot EAST()
|
||||
* @method static BrewingStandSlot NORTHWEST()
|
||||
* @method static BrewingStandSlot SOUTHWEST()
|
||||
*/
|
||||
enum BrewingStandSlot{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case EAST;
|
||||
case NORTHWEST;
|
||||
case SOUTHWEST;
|
||||
|
@ -23,20 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static CopperOxidation EXPOSED()
|
||||
* @method static CopperOxidation NONE()
|
||||
* @method static CopperOxidation OXIDIZED()
|
||||
* @method static CopperOxidation WEATHERED()
|
||||
*/
|
||||
enum CopperOxidation : int{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case NONE = 0;
|
||||
case EXPOSED = 1;
|
||||
case WEATHERED = 2;
|
||||
|
@ -23,21 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static CoralType BRAIN()
|
||||
* @method static CoralType BUBBLE()
|
||||
* @method static CoralType FIRE()
|
||||
* @method static CoralType HORN()
|
||||
* @method static CoralType TUBE()
|
||||
*/
|
||||
enum CoralType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case TUBE;
|
||||
case BRAIN;
|
||||
case BUBBLE;
|
||||
|
@ -23,19 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static DirtType COARSE()
|
||||
* @method static DirtType NORMAL()
|
||||
* @method static DirtType ROOTED()
|
||||
*/
|
||||
enum DirtType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case NORMAL;
|
||||
case COARSE;
|
||||
case ROOTED;
|
||||
|
@ -23,20 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static DripleafState FULL_TILT()
|
||||
* @method static DripleafState PARTIAL_TILT()
|
||||
* @method static DripleafState STABLE()
|
||||
* @method static DripleafState UNSTABLE()
|
||||
*/
|
||||
enum DripleafState{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case STABLE;
|
||||
case UNSTABLE;
|
||||
case PARTIAL_TILT;
|
||||
|
@ -24,35 +24,12 @@ declare(strict_types=1);
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\color\Color;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
use function spl_object_id;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static DyeColor BLACK()
|
||||
* @method static DyeColor BLUE()
|
||||
* @method static DyeColor BROWN()
|
||||
* @method static DyeColor CYAN()
|
||||
* @method static DyeColor GRAY()
|
||||
* @method static DyeColor GREEN()
|
||||
* @method static DyeColor LIGHT_BLUE()
|
||||
* @method static DyeColor LIGHT_GRAY()
|
||||
* @method static DyeColor LIME()
|
||||
* @method static DyeColor MAGENTA()
|
||||
* @method static DyeColor ORANGE()
|
||||
* @method static DyeColor PINK()
|
||||
* @method static DyeColor PURPLE()
|
||||
* @method static DyeColor RED()
|
||||
* @method static DyeColor WHITE()
|
||||
* @method static DyeColor YELLOW()
|
||||
*
|
||||
* @phpstan-type TMetadata array{0: string, 1: Color}
|
||||
*/
|
||||
enum DyeColor{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case WHITE;
|
||||
case ORANGE;
|
||||
case MAGENTA;
|
||||
|
@ -23,19 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static FroglightType OCHRE()
|
||||
* @method static FroglightType PEARLESCENT()
|
||||
* @method static FroglightType VERDANT()
|
||||
*/
|
||||
enum FroglightType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case OCHRE;
|
||||
case PEARLESCENT;
|
||||
case VERDANT;
|
||||
|
@ -23,26 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static LeavesType ACACIA()
|
||||
* @method static LeavesType AZALEA()
|
||||
* @method static LeavesType BIRCH()
|
||||
* @method static LeavesType CHERRY()
|
||||
* @method static LeavesType DARK_OAK()
|
||||
* @method static LeavesType FLOWERING_AZALEA()
|
||||
* @method static LeavesType JUNGLE()
|
||||
* @method static LeavesType MANGROVE()
|
||||
* @method static LeavesType OAK()
|
||||
* @method static LeavesType SPRUCE()
|
||||
*/
|
||||
enum LeavesType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case OAK;
|
||||
case SPRUCE;
|
||||
case BIRCH;
|
||||
|
@ -24,24 +24,8 @@ declare(strict_types=1);
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\math\Facing;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static LeverFacing DOWN_AXIS_X()
|
||||
* @method static LeverFacing DOWN_AXIS_Z()
|
||||
* @method static LeverFacing EAST()
|
||||
* @method static LeverFacing NORTH()
|
||||
* @method static LeverFacing SOUTH()
|
||||
* @method static LeverFacing UP_AXIS_X()
|
||||
* @method static LeverFacing UP_AXIS_Z()
|
||||
* @method static LeverFacing WEST()
|
||||
*/
|
||||
enum LeverFacing{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case UP_AXIS_X;
|
||||
case UP_AXIS_Z;
|
||||
case DOWN_AXIS_X;
|
||||
|
@ -23,23 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static MobHeadType CREEPER()
|
||||
* @method static MobHeadType DRAGON()
|
||||
* @method static MobHeadType PIGLIN()
|
||||
* @method static MobHeadType PLAYER()
|
||||
* @method static MobHeadType SKELETON()
|
||||
* @method static MobHeadType WITHER_SKELETON()
|
||||
* @method static MobHeadType ZOMBIE()
|
||||
*/
|
||||
enum MobHeadType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case SKELETON;
|
||||
case WITHER_SKELETON;
|
||||
case ZOMBIE;
|
||||
|
@ -23,27 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static MushroomBlockType ALL_CAP()
|
||||
* @method static MushroomBlockType CAP_EAST()
|
||||
* @method static MushroomBlockType CAP_MIDDLE()
|
||||
* @method static MushroomBlockType CAP_NORTH()
|
||||
* @method static MushroomBlockType CAP_NORTHEAST()
|
||||
* @method static MushroomBlockType CAP_NORTHWEST()
|
||||
* @method static MushroomBlockType CAP_SOUTH()
|
||||
* @method static MushroomBlockType CAP_SOUTHEAST()
|
||||
* @method static MushroomBlockType CAP_SOUTHWEST()
|
||||
* @method static MushroomBlockType CAP_WEST()
|
||||
* @method static MushroomBlockType PORES()
|
||||
*/
|
||||
enum MushroomBlockType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case PORES;
|
||||
case CAP_NORTHWEST;
|
||||
case CAP_NORTH;
|
||||
|
@ -26,34 +26,12 @@ namespace pocketmine\block\utils;
|
||||
use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\lang\Translatable;
|
||||
use pocketmine\network\mcpe\protocol\types\LevelSoundEvent;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
use function spl_object_id;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static RecordType DISK_11()
|
||||
* @method static RecordType DISK_13()
|
||||
* @method static RecordType DISK_5()
|
||||
* @method static RecordType DISK_BLOCKS()
|
||||
* @method static RecordType DISK_CAT()
|
||||
* @method static RecordType DISK_CHIRP()
|
||||
* @method static RecordType DISK_FAR()
|
||||
* @method static RecordType DISK_MALL()
|
||||
* @method static RecordType DISK_MELLOHI()
|
||||
* @method static RecordType DISK_OTHERSIDE()
|
||||
* @method static RecordType DISK_PIGSTEP()
|
||||
* @method static RecordType DISK_STAL()
|
||||
* @method static RecordType DISK_STRAD()
|
||||
* @method static RecordType DISK_WAIT()
|
||||
* @method static RecordType DISK_WARD()
|
||||
*
|
||||
* @phpstan-type TMetadata array{0: string, 1: LevelSoundEvent::*, 2: Translatable}
|
||||
*/
|
||||
enum RecordType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case DISK_13;
|
||||
case DISK_5;
|
||||
case DISK_CAT;
|
||||
|
@ -23,23 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
use pocketmine\world\generator\object\TreeType;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static SaplingType ACACIA()
|
||||
* @method static SaplingType BIRCH()
|
||||
* @method static SaplingType DARK_OAK()
|
||||
* @method static SaplingType JUNGLE()
|
||||
* @method static SaplingType OAK()
|
||||
* @method static SaplingType SPRUCE()
|
||||
*/
|
||||
enum SaplingType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case OAK;
|
||||
case SPRUCE;
|
||||
case BIRCH;
|
||||
|
@ -23,19 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static SlabType BOTTOM()
|
||||
* @method static SlabType DOUBLE()
|
||||
* @method static SlabType TOP()
|
||||
*/
|
||||
enum SlabType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case BOTTOM;
|
||||
case TOP;
|
||||
case DOUBLE;
|
||||
|
@ -23,21 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static StairShape INNER_LEFT()
|
||||
* @method static StairShape INNER_RIGHT()
|
||||
* @method static StairShape OUTER_LEFT()
|
||||
* @method static StairShape OUTER_RIGHT()
|
||||
* @method static StairShape STRAIGHT()
|
||||
*/
|
||||
enum StairShape{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case STRAIGHT;
|
||||
case INNER_LEFT;
|
||||
case INNER_RIGHT;
|
||||
|
@ -23,20 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static SupportType CENTER()
|
||||
* @method static SupportType EDGE()
|
||||
* @method static SupportType FULL()
|
||||
* @method static SupportType NONE()
|
||||
*/
|
||||
enum SupportType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case FULL;
|
||||
case CENTER;
|
||||
case EDGE;
|
||||
|
@ -23,18 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static WallConnectionType SHORT()
|
||||
* @method static WallConnectionType TALL()
|
||||
*/
|
||||
enum WallConnectionType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case SHORT;
|
||||
case TALL;
|
||||
}
|
||||
|
@ -23,26 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\block\utils;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static WoodType ACACIA()
|
||||
* @method static WoodType BIRCH()
|
||||
* @method static WoodType CHERRY()
|
||||
* @method static WoodType CRIMSON()
|
||||
* @method static WoodType DARK_OAK()
|
||||
* @method static WoodType JUNGLE()
|
||||
* @method static WoodType MANGROVE()
|
||||
* @method static WoodType OAK()
|
||||
* @method static WoodType SPRUCE()
|
||||
* @method static WoodType WARPED()
|
||||
*/
|
||||
enum WoodType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case OAK;
|
||||
case SPRUCE;
|
||||
case BIRCH;
|
||||
|
@ -66,7 +66,7 @@ abstract class Command{
|
||||
|
||||
/** @var string[] */
|
||||
private array $permission = [];
|
||||
private ?string $permissionMessage = null;
|
||||
private Translatable|string|null $permissionMessage = null;
|
||||
|
||||
/**
|
||||
* @param string[] $aliases
|
||||
@ -122,10 +122,11 @@ abstract class Command{
|
||||
return true;
|
||||
}
|
||||
|
||||
if($this->permissionMessage === null){
|
||||
$target->sendMessage(KnownTranslationFactory::pocketmine_command_error_permission($this->name)->prefix(TextFormat::RED));
|
||||
}elseif($this->permissionMessage !== ""){
|
||||
$target->sendMessage(str_replace("<permission>", $permission ?? implode(";", $this->permission), $this->permissionMessage));
|
||||
$message = $this->permissionMessage ?? KnownTranslationFactory::pocketmine_command_error_permission($this->name);
|
||||
if($message instanceof Translatable){
|
||||
$target->sendMessage($message->prefix(TextFormat::RED));
|
||||
}elseif($message !== ""){
|
||||
$target->sendMessage(str_replace("<permission>", $permission ?? implode(";", $this->permission), $message));
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -198,7 +199,7 @@ abstract class Command{
|
||||
return $this->activeAliases;
|
||||
}
|
||||
|
||||
public function getPermissionMessage() : ?string{
|
||||
public function getPermissionMessage() : Translatable|string|null{
|
||||
return $this->permissionMessage;
|
||||
}
|
||||
|
||||
@ -226,7 +227,7 @@ abstract class Command{
|
||||
$this->description = $description;
|
||||
}
|
||||
|
||||
public function setPermissionMessage(string $permissionMessage) : void{
|
||||
public function setPermissionMessage(Translatable|string $permissionMessage) : void{
|
||||
$this->permissionMessage = $permissionMessage;
|
||||
}
|
||||
|
||||
|
@ -152,10 +152,10 @@ final class CraftingManagerFromDataHelper{
|
||||
* @return mixed[]
|
||||
*
|
||||
* @phpstan-template TData of object
|
||||
* @phpstan-param class-string<TData> $modelCLass
|
||||
* @phpstan-param class-string<TData> $modelClass
|
||||
* @phpstan-return list<TData>
|
||||
*/
|
||||
public static function loadJsonArrayOfObjectsFile(string $filePath, string $modelCLass) : array{
|
||||
public static function loadJsonArrayOfObjectsFile(string $filePath, string $modelClass) : array{
|
||||
$recipes = json_decode(Filesystem::fileGetContents($filePath));
|
||||
if(!is_array($recipes)){
|
||||
throw new SavedDataLoadingException("$filePath root should be an array, got " . get_debug_type($recipes));
|
||||
@ -166,7 +166,7 @@ final class CraftingManagerFromDataHelper{
|
||||
$mapper->bExceptionOnUndefinedProperty = true;
|
||||
$mapper->bExceptionOnMissingData = true;
|
||||
|
||||
return self::loadJsonObjectListIntoModel($mapper, $modelCLass, $recipes);
|
||||
return self::loadJsonObjectListIntoModel($mapper, $modelClass, $recipes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\crafting;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
use pocketmine\world\sound\BlastFurnaceSound;
|
||||
use pocketmine\world\sound\CampfireSound;
|
||||
use pocketmine\world\sound\FurnaceSound;
|
||||
@ -32,20 +31,9 @@ use pocketmine\world\sound\Sound;
|
||||
use function spl_object_id;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static FurnaceType BLAST_FURNACE()
|
||||
* @method static FurnaceType CAMPFIRE()
|
||||
* @method static FurnaceType FURNACE()
|
||||
* @method static FurnaceType SMOKER()
|
||||
* @method static FurnaceType SOUL_CAMPFIRE()
|
||||
*
|
||||
* @phpstan-type TMetadata array{0: int, 1: Sound}
|
||||
*/
|
||||
enum FurnaceType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case FURNACE;
|
||||
case BLAST_FURNACE;
|
||||
case SMOKER;
|
||||
|
@ -23,20 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\crafting;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static ShapelessRecipeType CARTOGRAPHY()
|
||||
* @method static ShapelessRecipeType CRAFTING()
|
||||
* @method static ShapelessRecipeType SMITHING()
|
||||
* @method static ShapelessRecipeType STONECUTTER()
|
||||
*/
|
||||
enum ShapelessRecipeType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case CRAFTING;
|
||||
case STONECUTTER;
|
||||
case SMITHING;
|
||||
|
@ -26,7 +26,6 @@ namespace pocketmine\crash;
|
||||
use Composer\InstalledVersions;
|
||||
use pocketmine\errorhandler\ErrorTypeToStringMap;
|
||||
use pocketmine\network\mcpe\protocol\ProtocolInfo;
|
||||
use pocketmine\plugin\PluginBase;
|
||||
use pocketmine\plugin\PluginManager;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\thread\ThreadCrashInfoFrame;
|
||||
@ -259,10 +258,8 @@ class CrashDump{
|
||||
}
|
||||
|
||||
if(file_exists($filePath)){
|
||||
$reflection = new \ReflectionClass(PluginBase::class);
|
||||
$file = $reflection->getProperty("file");
|
||||
foreach($this->server->getPluginManager()->getPlugins() as $plugin){
|
||||
$filePath = Filesystem::cleanPath($file->getValue($plugin));
|
||||
$filePath = Filesystem::cleanPath($plugin->getFile());
|
||||
if(str_starts_with($frameCleanPath, $filePath)){
|
||||
$this->data->plugin = $plugin->getName();
|
||||
break;
|
||||
|
@ -54,13 +54,13 @@ final class WorldDataVersions{
|
||||
* This may be lower than the current protocol version if PocketMine-MP does not yet support features of the newer
|
||||
* version. This allows the protocol to be updated independently of world format support.
|
||||
*/
|
||||
public const NETWORK = 827;
|
||||
public const NETWORK = 818;
|
||||
|
||||
public const LAST_OPENED_IN = [
|
||||
1, //major
|
||||
21, //minor
|
||||
100, //patch
|
||||
23, //revision
|
||||
90, //patch
|
||||
3, //revision
|
||||
0 //is beta
|
||||
];
|
||||
}
|
||||
|
@ -255,7 +255,6 @@ final class BlockTypeNames{
|
||||
public const CONDUIT = "minecraft:conduit";
|
||||
public const COPPER_BLOCK = "minecraft:copper_block";
|
||||
public const COPPER_BULB = "minecraft:copper_bulb";
|
||||
public const COPPER_CHEST = "minecraft:copper_chest";
|
||||
public const COPPER_DOOR = "minecraft:copper_door";
|
||||
public const COPPER_GRATE = "minecraft:copper_grate";
|
||||
public const COPPER_ORE = "minecraft:copper_ore";
|
||||
@ -534,7 +533,6 @@ final class BlockTypeNames{
|
||||
public const EXPOSED_CHISELED_COPPER = "minecraft:exposed_chiseled_copper";
|
||||
public const EXPOSED_COPPER = "minecraft:exposed_copper";
|
||||
public const EXPOSED_COPPER_BULB = "minecraft:exposed_copper_bulb";
|
||||
public const EXPOSED_COPPER_CHEST = "minecraft:exposed_copper_chest";
|
||||
public const EXPOSED_COPPER_DOOR = "minecraft:exposed_copper_door";
|
||||
public const EXPOSED_COPPER_GRATE = "minecraft:exposed_copper_grate";
|
||||
public const EXPOSED_COPPER_TRAPDOOR = "minecraft:exposed_copper_trapdoor";
|
||||
@ -859,7 +857,6 @@ final class BlockTypeNames{
|
||||
public const OXIDIZED_CHISELED_COPPER = "minecraft:oxidized_chiseled_copper";
|
||||
public const OXIDIZED_COPPER = "minecraft:oxidized_copper";
|
||||
public const OXIDIZED_COPPER_BULB = "minecraft:oxidized_copper_bulb";
|
||||
public const OXIDIZED_COPPER_CHEST = "minecraft:oxidized_copper_chest";
|
||||
public const OXIDIZED_COPPER_DOOR = "minecraft:oxidized_copper_door";
|
||||
public const OXIDIZED_COPPER_GRATE = "minecraft:oxidized_copper_grate";
|
||||
public const OXIDIZED_COPPER_TRAPDOOR = "minecraft:oxidized_copper_trapdoor";
|
||||
@ -1214,7 +1211,6 @@ final class BlockTypeNames{
|
||||
public const WAXED_CHISELED_COPPER = "minecraft:waxed_chiseled_copper";
|
||||
public const WAXED_COPPER = "minecraft:waxed_copper";
|
||||
public const WAXED_COPPER_BULB = "minecraft:waxed_copper_bulb";
|
||||
public const WAXED_COPPER_CHEST = "minecraft:waxed_copper_chest";
|
||||
public const WAXED_COPPER_DOOR = "minecraft:waxed_copper_door";
|
||||
public const WAXED_COPPER_GRATE = "minecraft:waxed_copper_grate";
|
||||
public const WAXED_COPPER_TRAPDOOR = "minecraft:waxed_copper_trapdoor";
|
||||
@ -1225,7 +1221,6 @@ final class BlockTypeNames{
|
||||
public const WAXED_EXPOSED_CHISELED_COPPER = "minecraft:waxed_exposed_chiseled_copper";
|
||||
public const WAXED_EXPOSED_COPPER = "minecraft:waxed_exposed_copper";
|
||||
public const WAXED_EXPOSED_COPPER_BULB = "minecraft:waxed_exposed_copper_bulb";
|
||||
public const WAXED_EXPOSED_COPPER_CHEST = "minecraft:waxed_exposed_copper_chest";
|
||||
public const WAXED_EXPOSED_COPPER_DOOR = "minecraft:waxed_exposed_copper_door";
|
||||
public const WAXED_EXPOSED_COPPER_GRATE = "minecraft:waxed_exposed_copper_grate";
|
||||
public const WAXED_EXPOSED_COPPER_TRAPDOOR = "minecraft:waxed_exposed_copper_trapdoor";
|
||||
@ -1236,7 +1231,6 @@ final class BlockTypeNames{
|
||||
public const WAXED_OXIDIZED_CHISELED_COPPER = "minecraft:waxed_oxidized_chiseled_copper";
|
||||
public const WAXED_OXIDIZED_COPPER = "minecraft:waxed_oxidized_copper";
|
||||
public const WAXED_OXIDIZED_COPPER_BULB = "minecraft:waxed_oxidized_copper_bulb";
|
||||
public const WAXED_OXIDIZED_COPPER_CHEST = "minecraft:waxed_oxidized_copper_chest";
|
||||
public const WAXED_OXIDIZED_COPPER_DOOR = "minecraft:waxed_oxidized_copper_door";
|
||||
public const WAXED_OXIDIZED_COPPER_GRATE = "minecraft:waxed_oxidized_copper_grate";
|
||||
public const WAXED_OXIDIZED_COPPER_TRAPDOOR = "minecraft:waxed_oxidized_copper_trapdoor";
|
||||
@ -1247,7 +1241,6 @@ final class BlockTypeNames{
|
||||
public const WAXED_WEATHERED_CHISELED_COPPER = "minecraft:waxed_weathered_chiseled_copper";
|
||||
public const WAXED_WEATHERED_COPPER = "minecraft:waxed_weathered_copper";
|
||||
public const WAXED_WEATHERED_COPPER_BULB = "minecraft:waxed_weathered_copper_bulb";
|
||||
public const WAXED_WEATHERED_COPPER_CHEST = "minecraft:waxed_weathered_copper_chest";
|
||||
public const WAXED_WEATHERED_COPPER_DOOR = "minecraft:waxed_weathered_copper_door";
|
||||
public const WAXED_WEATHERED_COPPER_GRATE = "minecraft:waxed_weathered_copper_grate";
|
||||
public const WAXED_WEATHERED_COPPER_TRAPDOOR = "minecraft:waxed_weathered_copper_trapdoor";
|
||||
@ -1258,7 +1251,6 @@ final class BlockTypeNames{
|
||||
public const WEATHERED_CHISELED_COPPER = "minecraft:weathered_chiseled_copper";
|
||||
public const WEATHERED_COPPER = "minecraft:weathered_copper";
|
||||
public const WEATHERED_COPPER_BULB = "minecraft:weathered_copper_bulb";
|
||||
public const WEATHERED_COPPER_CHEST = "minecraft:weathered_copper_chest";
|
||||
public const WEATHERED_COPPER_DOOR = "minecraft:weathered_copper_door";
|
||||
public const WEATHERED_COPPER_GRATE = "minecraft:weathered_copper_grate";
|
||||
public const WEATHERED_COPPER_TRAPDOOR = "minecraft:weathered_copper_trapdoor";
|
||||
|
@ -167,8 +167,7 @@ use pocketmine\block\WallBanner;
|
||||
use pocketmine\block\WallCoralFan;
|
||||
use pocketmine\block\WallSign;
|
||||
use pocketmine\block\Water;
|
||||
use pocketmine\block\WeightedPressurePlateHeavy;
|
||||
use pocketmine\block\WeightedPressurePlateLight;
|
||||
use pocketmine\block\WeightedPressurePlate;
|
||||
use pocketmine\block\Wheat;
|
||||
use pocketmine\block\Wood;
|
||||
use pocketmine\block\WoodenButton;
|
||||
@ -1878,11 +1877,11 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
|
||||
return Writer::create(Ids::WEEPING_VINES)
|
||||
->writeInt(StateNames::WEEPING_VINES_AGE, $block->getAge());
|
||||
});
|
||||
$this->map(Blocks::WEIGHTED_PRESSURE_PLATE_HEAVY(), function(WeightedPressurePlateHeavy $block) : Writer{
|
||||
$this->map(Blocks::WEIGHTED_PRESSURE_PLATE_HEAVY(), function(WeightedPressurePlate $block) : Writer{
|
||||
return Writer::create(Ids::HEAVY_WEIGHTED_PRESSURE_PLATE)
|
||||
->writeInt(StateNames::REDSTONE_SIGNAL, $block->getOutputSignalStrength());
|
||||
});
|
||||
$this->map(Blocks::WEIGHTED_PRESSURE_PLATE_LIGHT(), function(WeightedPressurePlateLight $block) : Writer{
|
||||
$this->map(Blocks::WEIGHTED_PRESSURE_PLATE_LIGHT(), function(WeightedPressurePlate $block) : Writer{
|
||||
return Writer::create(Ids::LIGHT_WEIGHTED_PRESSURE_PLATE)
|
||||
->writeInt(StateNames::REDSTONE_SIGNAL, $block->getOutputSignalStrength());
|
||||
});
|
||||
|
@ -153,19 +153,8 @@ final class ItemTypeNames{
|
||||
public const COOKED_RABBIT = "minecraft:cooked_rabbit";
|
||||
public const COOKED_SALMON = "minecraft:cooked_salmon";
|
||||
public const COOKIE = "minecraft:cookie";
|
||||
public const COPPER_AXE = "minecraft:copper_axe";
|
||||
public const COPPER_BOOTS = "minecraft:copper_boots";
|
||||
public const COPPER_CHESTPLATE = "minecraft:copper_chestplate";
|
||||
public const COPPER_DOOR = "minecraft:copper_door";
|
||||
public const COPPER_GOLEM_SPAWN_EGG = "minecraft:copper_golem_spawn_egg";
|
||||
public const COPPER_HELMET = "minecraft:copper_helmet";
|
||||
public const COPPER_HOE = "minecraft:copper_hoe";
|
||||
public const COPPER_INGOT = "minecraft:copper_ingot";
|
||||
public const COPPER_LEGGINGS = "minecraft:copper_leggings";
|
||||
public const COPPER_NUGGET = "minecraft:copper_nugget";
|
||||
public const COPPER_PICKAXE = "minecraft:copper_pickaxe";
|
||||
public const COPPER_SHOVEL = "minecraft:copper_shovel";
|
||||
public const COPPER_SWORD = "minecraft:copper_sword";
|
||||
public const CORAL = "minecraft:coral";
|
||||
public const CORAL_BLOCK = "minecraft:coral_block";
|
||||
public const CORAL_FAN = "minecraft:coral_fan";
|
||||
@ -383,7 +372,6 @@ final class ItemTypeNames{
|
||||
public const MUSIC_DISC_CREATOR = "minecraft:music_disc_creator";
|
||||
public const MUSIC_DISC_CREATOR_MUSIC_BOX = "minecraft:music_disc_creator_music_box";
|
||||
public const MUSIC_DISC_FAR = "minecraft:music_disc_far";
|
||||
public const MUSIC_DISC_LAVA_CHICKEN = "minecraft:music_disc_lava_chicken";
|
||||
public const MUSIC_DISC_MALL = "minecraft:music_disc_mall";
|
||||
public const MUSIC_DISC_MELLOHI = "minecraft:music_disc_mellohi";
|
||||
public const MUSIC_DISC_OTHERSIDE = "minecraft:music_disc_otherside";
|
||||
|
@ -1,89 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\data\runtime;
|
||||
|
||||
/**
|
||||
* Provides backwards-compatible shims for the old codegen'd enum describer methods.
|
||||
* This is kept for plugin backwards compatibility, but these functions should not be used in new code.
|
||||
* @deprecated
|
||||
*/
|
||||
trait LegacyRuntimeEnumDescriberTrait{
|
||||
abstract protected function enum(\UnitEnum &$case) : void;
|
||||
|
||||
public function bellAttachmentType(\pocketmine\block\utils\BellAttachmentType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function copperOxidation(\pocketmine\block\utils\CopperOxidation &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function coralType(\pocketmine\block\utils\CoralType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function dirtType(\pocketmine\block\utils\DirtType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function dripleafState(\pocketmine\block\utils\DripleafState &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function dyeColor(\pocketmine\block\utils\DyeColor &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function froglightType(\pocketmine\block\utils\FroglightType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function leverFacing(\pocketmine\block\utils\LeverFacing &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function medicineType(\pocketmine\item\MedicineType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function mobHeadType(\pocketmine\block\utils\MobHeadType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function mushroomBlockType(\pocketmine\block\utils\MushroomBlockType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function potionType(\pocketmine\item\PotionType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function slabType(\pocketmine\block\utils\SlabType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
|
||||
public function suspiciousStewType(\pocketmine\item\SuspiciousStewType &$value) : void{
|
||||
$this->enum($value);
|
||||
}
|
||||
}
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\data\runtime;
|
||||
|
||||
use pocketmine\block\utils\BrewingStandSlot;
|
||||
use pocketmine\block\utils\WallConnectionType;
|
||||
use pocketmine\math\Facing;
|
||||
|
||||
@ -35,14 +34,9 @@ use pocketmine\math\Facing;
|
||||
* You may use it as a type for parameters and return values, but it should not be implemented outside of this package.
|
||||
* New methods may be added without warning.
|
||||
*/
|
||||
interface RuntimeDataDescriber extends RuntimeEnumDescriber{
|
||||
interface RuntimeDataDescriber{
|
||||
public function int(int $bits, int &$value) : void;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RuntimeDataDescriber::boundedIntAuto()} instead.
|
||||
*/
|
||||
public function boundedInt(int $bits, int $min, int $max, int &$value) : void;
|
||||
|
||||
/**
|
||||
* Same as boundedInt() but automatically calculates the required number of bits from the range.
|
||||
* The range bounds must be constant.
|
||||
@ -77,14 +71,6 @@ interface RuntimeDataDescriber extends RuntimeEnumDescriber{
|
||||
*/
|
||||
public function wallConnections(array &$connections) : void;
|
||||
|
||||
/**
|
||||
* @param BrewingStandSlot[] $slots
|
||||
* @phpstan-param array<int, BrewingStandSlot> $slots
|
||||
*
|
||||
* @deprecated Use {@link enumSet()} instead.
|
||||
*/
|
||||
public function brewingStandSlots(array &$slots) : void;
|
||||
|
||||
public function railShape(int &$railShape) : void;
|
||||
|
||||
public function straightOnlyRailShape(int &$railShape) : void;
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\data\runtime;
|
||||
|
||||
use pocketmine\block\utils\BrewingStandSlot;
|
||||
use pocketmine\block\utils\RailConnectionInfo;
|
||||
use pocketmine\block\utils\WallConnectionType;
|
||||
use pocketmine\math\Axis;
|
||||
@ -35,8 +34,6 @@ use function log;
|
||||
use function spl_object_id;
|
||||
|
||||
final class RuntimeDataReader implements RuntimeDataDescriber{
|
||||
use LegacyRuntimeEnumDescriberTrait;
|
||||
|
||||
private int $offset = 0;
|
||||
|
||||
public function __construct(
|
||||
@ -59,18 +56,6 @@ final class RuntimeDataReader implements RuntimeDataDescriber{
|
||||
$value = $this->readInt($bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link self::boundedIntAuto()} instead.
|
||||
*/
|
||||
public function boundedInt(int $bits, int $min, int $max, int &$value) : void{
|
||||
$offset = $this->offset;
|
||||
$this->boundedIntAuto($min, $max, $value);
|
||||
$actualBits = $this->offset - $offset;
|
||||
if($this->offset !== $offset + $bits){
|
||||
throw new \InvalidArgumentException("Bits should be $actualBits for the given bounds, but received $bits. Use boundedIntAuto() for automatic bits calculation.");
|
||||
}
|
||||
}
|
||||
|
||||
private function readBoundedIntAuto(int $min, int $max) : int{
|
||||
$bits = ((int) log($max - $min, 2)) + 1;
|
||||
$result = $this->readInt($bits) + $min;
|
||||
@ -192,16 +177,6 @@ final class RuntimeDataReader implements RuntimeDataDescriber{
|
||||
$connections = $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BrewingStandSlot[] $slots
|
||||
* @phpstan-param array<int, BrewingStandSlot> $slots
|
||||
*
|
||||
* @deprecated Use {@link enumSet()} instead.
|
||||
*/
|
||||
public function brewingStandSlots(array &$slots) : void{
|
||||
$this->enumSet($slots, BrewingStandSlot::cases());
|
||||
}
|
||||
|
||||
public function railShape(int &$railShape) : void{
|
||||
$result = $this->readInt(4);
|
||||
if(!isset(RailConnectionInfo::CONNECTIONS[$result]) && !isset(RailConnectionInfo::CURVE_CONNECTIONS[$result])){
|
||||
|
@ -23,14 +23,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\data\runtime;
|
||||
|
||||
use pocketmine\block\utils\BrewingStandSlot;
|
||||
use pocketmine\math\Facing;
|
||||
use function count;
|
||||
use function log;
|
||||
|
||||
final class RuntimeDataSizeCalculator implements RuntimeDataDescriber{
|
||||
use LegacyRuntimeEnumDescriberTrait;
|
||||
|
||||
private int $bits = 0;
|
||||
|
||||
protected function addBits(int $bits) : void{
|
||||
@ -45,18 +42,6 @@ final class RuntimeDataSizeCalculator implements RuntimeDataDescriber{
|
||||
$this->addBits($bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link self::boundedIntAuto()} instead.
|
||||
*/
|
||||
public function boundedInt(int $bits, int $min, int $max, int &$value) : void{
|
||||
$currentBits = $this->bits;
|
||||
$this->boundedIntAuto($min, $max, $value);
|
||||
$actualBits = $this->bits - $currentBits;
|
||||
if($actualBits !== $bits){
|
||||
throw new \InvalidArgumentException("Bits should be $actualBits for the given bounds, but received $bits. Use boundedIntAuto() for automatic bits calculation.");
|
||||
}
|
||||
}
|
||||
|
||||
public function boundedIntAuto(int $min, int $max, int &$value) : void{
|
||||
$this->addBits(((int) log($max - $min, 2)) + 1);
|
||||
}
|
||||
@ -97,10 +82,6 @@ final class RuntimeDataSizeCalculator implements RuntimeDataDescriber{
|
||||
$this->addBits(7);
|
||||
}
|
||||
|
||||
public function brewingStandSlots(array &$slots) : void{
|
||||
$this->addBits(count(BrewingStandSlot::cases()));
|
||||
}
|
||||
|
||||
public function railShape(int &$railShape) : void{
|
||||
$this->addBits(4);
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\data\runtime;
|
||||
|
||||
use pocketmine\block\utils\BrewingStandSlot;
|
||||
use pocketmine\block\utils\WallConnectionType;
|
||||
use pocketmine\math\Axis;
|
||||
use pocketmine\math\Facing;
|
||||
@ -32,8 +31,6 @@ use function log;
|
||||
use function spl_object_id;
|
||||
|
||||
final class RuntimeDataWriter implements RuntimeDataDescriber{
|
||||
use LegacyRuntimeEnumDescriberTrait;
|
||||
|
||||
private int $value = 0;
|
||||
private int $offset = 0;
|
||||
|
||||
@ -57,18 +54,6 @@ final class RuntimeDataWriter implements RuntimeDataDescriber{
|
||||
$this->writeInt($bits, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link self::boundedIntAuto()} instead.
|
||||
*/
|
||||
public function boundedInt(int $bits, int $min, int $max, int &$value) : void{
|
||||
$offset = $this->offset;
|
||||
$this->writeBoundedIntAuto($min, $max, $value);
|
||||
$actualBits = $this->offset - $offset;
|
||||
if($actualBits !== $bits){
|
||||
throw new \InvalidArgumentException("Bits should be $actualBits for the given bounds, but received $bits. Use boundedIntAuto() for automatic bits calculation.");
|
||||
}
|
||||
}
|
||||
|
||||
private function writeBoundedIntAuto(int $min, int $max, int $value) : void{
|
||||
if($value < $min || $value > $max){
|
||||
throw new \InvalidArgumentException("Value $value is outside the range $min - $max");
|
||||
@ -170,16 +155,6 @@ final class RuntimeDataWriter implements RuntimeDataDescriber{
|
||||
$this->writeBoundedIntAuto(0, (3 ** 4) - 1, $packed);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BrewingStandSlot[] $slots
|
||||
* @phpstan-param array<int, BrewingStandSlot> $slots
|
||||
*
|
||||
* @deprecated Use {@link enumSet()} instead.
|
||||
*/
|
||||
public function brewingStandSlots(array &$slots) : void{
|
||||
$this->enumSet($slots, BrewingStandSlot::cases());
|
||||
}
|
||||
|
||||
public function railShape(int &$railShape) : void{
|
||||
$this->int(4, $railShape);
|
||||
}
|
||||
|
@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\data\runtime;
|
||||
|
||||
/**
|
||||
* Provides backwards-compatible shims for the old codegen'd enum describer methods.
|
||||
* This is kept for plugin backwards compatibility, but these functions should not be used in new code.
|
||||
* @deprecated
|
||||
*/
|
||||
interface RuntimeEnumDescriber{
|
||||
|
||||
public function bellAttachmentType(\pocketmine\block\utils\BellAttachmentType &$value) : void;
|
||||
|
||||
public function copperOxidation(\pocketmine\block\utils\CopperOxidation &$value) : void;
|
||||
|
||||
public function coralType(\pocketmine\block\utils\CoralType &$value) : void;
|
||||
|
||||
public function dirtType(\pocketmine\block\utils\DirtType &$value) : void;
|
||||
|
||||
public function dripleafState(\pocketmine\block\utils\DripleafState &$value) : void;
|
||||
|
||||
public function dyeColor(\pocketmine\block\utils\DyeColor &$value) : void;
|
||||
|
||||
public function froglightType(\pocketmine\block\utils\FroglightType &$value) : void;
|
||||
|
||||
public function leverFacing(\pocketmine\block\utils\LeverFacing &$value) : void;
|
||||
|
||||
public function medicineType(\pocketmine\item\MedicineType &$value) : void;
|
||||
|
||||
public function mobHeadType(\pocketmine\block\utils\MobHeadType &$value) : void;
|
||||
|
||||
public function mushroomBlockType(\pocketmine\block\utils\MushroomBlockType &$value) : void;
|
||||
|
||||
public function potionType(\pocketmine\item\PotionType &$value) : void;
|
||||
|
||||
public function slabType(\pocketmine\block\utils\SlabType &$value) : void;
|
||||
|
||||
public function suspiciousStewType(\pocketmine\item\SuspiciousStewType &$value) : void;
|
||||
|
||||
}
|
@ -1508,7 +1508,7 @@ abstract class Entity{
|
||||
return $this->hasSpawned;
|
||||
}
|
||||
|
||||
abstract public static function getNetworkTypeId() : string;
|
||||
abstract public function getNetworkTypeId() : string;
|
||||
|
||||
/**
|
||||
* Called by spawnTo() to send whatever packets needed to spawn the entity to the client.
|
||||
@ -1517,7 +1517,7 @@ abstract class Entity{
|
||||
$player->getNetworkSession()->sendDataPacket(AddActorPacket::create(
|
||||
$this->getId(), //TODO: actor unique ID
|
||||
$this->getId(),
|
||||
static::getNetworkTypeId(),
|
||||
$this->getNetworkTypeId(),
|
||||
$this->getOffsetPosition($this->location->asVector3()),
|
||||
$this->getMotion(),
|
||||
$this->location->pitch,
|
||||
|
@ -30,7 +30,7 @@ use pocketmine\entity\effect\EffectInstance;
|
||||
use pocketmine\entity\effect\VanillaEffects;
|
||||
use pocketmine\entity\projectile\ProjectileSource;
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\event\player\PlayerExhaustEvent;
|
||||
use pocketmine\event\entity\EntityExhaustEvent;
|
||||
use pocketmine\inventory\CallbackInventoryListener;
|
||||
use pocketmine\inventory\Inventory;
|
||||
use pocketmine\inventory\InventoryHolder;
|
||||
@ -99,7 +99,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
private const TAG_SKIN_GEOMETRY_NAME = "GeometryName"; //TAG_String
|
||||
private const TAG_SKIN_GEOMETRY_DATA = "GeometryData"; //TAG_ByteArray
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::PLAYER; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::PLAYER; }
|
||||
|
||||
protected PlayerInventory $inventory;
|
||||
protected PlayerOffHandInventory $offHandInventory;
|
||||
@ -173,9 +173,9 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
public function jump() : void{
|
||||
parent::jump();
|
||||
if($this->isSprinting()){
|
||||
$this->hungerManager->exhaust(0.2, PlayerExhaustEvent::CAUSE_SPRINT_JUMPING);
|
||||
$this->hungerManager->exhaust(0.2, EntityExhaustEvent::CAUSE_SPRINT_JUMPING);
|
||||
}else{
|
||||
$this->hungerManager->exhaust(0.05, PlayerExhaustEvent::CAUSE_JUMPING);
|
||||
$this->hungerManager->exhaust(0.05, EntityExhaustEvent::CAUSE_JUMPING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,8 @@ declare(strict_types=1);
|
||||
namespace pocketmine\entity;
|
||||
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\event\entity\EntityExhaustEvent;
|
||||
use pocketmine\event\entity\EntityRegainHealthEvent;
|
||||
use pocketmine\event\player\PlayerExhaustEvent;
|
||||
use pocketmine\world\World;
|
||||
use function max;
|
||||
use function min;
|
||||
@ -130,13 +130,13 @@ class HungerManager{
|
||||
*
|
||||
* @return float the amount of exhaustion level increased
|
||||
*/
|
||||
public function exhaust(float $amount, int $cause = PlayerExhaustEvent::CAUSE_CUSTOM) : float{
|
||||
public function exhaust(float $amount, int $cause = EntityExhaustEvent::CAUSE_CUSTOM) : float{
|
||||
if(!$this->enabled){
|
||||
return 0;
|
||||
}
|
||||
$evAmount = $amount;
|
||||
if(PlayerExhaustEvent::hasHandlers()){
|
||||
$ev = new PlayerExhaustEvent($this->entity, $amount, $cause);
|
||||
if(EntityExhaustEvent::hasHandlers()){
|
||||
$ev = new EntityExhaustEvent($this->entity, $amount, $cause);
|
||||
$ev->call();
|
||||
if($ev->isCancelled()){
|
||||
return 0.0;
|
||||
@ -205,7 +205,7 @@ class HungerManager{
|
||||
if($food >= 18){
|
||||
if($health < $this->entity->getMaxHealth()){
|
||||
$this->entity->heal(new EntityRegainHealthEvent($this->entity, 1, EntityRegainHealthEvent::CAUSE_SATURATION));
|
||||
$this->exhaust(6.0, PlayerExhaustEvent::CAUSE_HEALTH_REGEN);
|
||||
$this->exhaust(6.0, EntityExhaustEvent::CAUSE_HEALTH_REGEN);
|
||||
}
|
||||
}elseif($food <= 0){
|
||||
if(($difficulty === World::DIFFICULTY_EASY && $health > 10) || ($difficulty === World::DIFFICULTY_NORMAL && $health > 1) || $difficulty === World::DIFFICULTY_HARD){
|
||||
|
@ -38,7 +38,7 @@ use const M_PI;
|
||||
|
||||
class Squid extends WaterAnimal{
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::SQUID; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::SQUID; }
|
||||
|
||||
public ?Vector3 $swimDirection = null;
|
||||
public float $swimSpeed = 0.1;
|
||||
|
@ -40,7 +40,7 @@ class Villager extends Living implements Ageable{
|
||||
|
||||
private const TAG_PROFESSION = "Profession"; //TAG_Int
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::VILLAGER; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::VILLAGER; }
|
||||
|
||||
private bool $baby = false;
|
||||
private int $profession = self::PROFESSION_FARMER;
|
||||
|
@ -30,7 +30,7 @@ use function mt_rand;
|
||||
|
||||
class Zombie extends Living{
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ZOMBIE; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::ZOMBIE; }
|
||||
|
||||
protected function getInitialSizeInfo() : EntitySizeInfo{
|
||||
return new EntitySizeInfo(1.8, 0.6); //TODO: eye height ??
|
||||
|
@ -26,7 +26,7 @@ namespace pocketmine\entity\effect;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\Human;
|
||||
use pocketmine\entity\Living;
|
||||
use pocketmine\event\player\PlayerExhaustEvent;
|
||||
use pocketmine\event\entity\EntityExhaustEvent;
|
||||
|
||||
class HungerEffect extends Effect{
|
||||
|
||||
@ -36,7 +36,7 @@ class HungerEffect extends Effect{
|
||||
|
||||
public function applyEffect(Living $entity, EffectInstance $instance, float $potency = 1.0, ?Entity $source = null) : void{
|
||||
if($entity instanceof Human){
|
||||
$entity->getHungerManager()->exhaust(0.1 * $instance->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
|
||||
$entity->getHungerManager()->exhaust(0.1 * $instance->getEffectLevel(), EntityExhaustEvent::CAUSE_POTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ class EndCrystal extends Entity implements Explosive{
|
||||
private const TAG_BLOCKTARGET_Y = "BlockTargetY"; //TAG_Int
|
||||
private const TAG_BLOCKTARGET_Z = "BlockTargetZ"; //TAG_Int
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ENDER_CRYSTAL; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::ENDER_CRYSTAL; }
|
||||
|
||||
protected bool $showBase = false;
|
||||
protected ?Vector3 $beamTarget = null;
|
||||
|
@ -37,7 +37,7 @@ use function sqrt;
|
||||
|
||||
class ExperienceOrb extends Entity{
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::XP_ORB; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::XP_ORB; }
|
||||
|
||||
public const TAG_VALUE_PC = "Value"; //short
|
||||
public const TAG_VALUE_PE = "experience value"; //int (WTF?)
|
||||
|
@ -56,7 +56,7 @@ class FallingBlock extends Entity{
|
||||
private const TAG_TILE = "Tile"; //TAG_Byte
|
||||
private const TAG_DATA = "Data"; //TAG_Byte
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::FALLING_BLOCK; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::FALLING_BLOCK; }
|
||||
|
||||
protected Block $block;
|
||||
|
||||
|
@ -52,7 +52,7 @@ class ItemEntity extends Entity{
|
||||
private const TAG_THROWER = "Thrower"; //TAG_String
|
||||
public const TAG_ITEM = "Item"; //TAG_Compound
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ITEM; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::ITEM; }
|
||||
|
||||
public const MERGE_CHECK_PERIOD = 2; //0.1 seconds
|
||||
public const DEFAULT_DESPAWN_DELAY = 6000; //5 minutes
|
||||
|
@ -49,7 +49,7 @@ class Painting extends Entity{
|
||||
public const TAG_DIRECTION_BE = "Direction"; //TAG_Byte
|
||||
public const TAG_MOTIVE = "Motive"; //TAG_String
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::PAINTING; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::PAINTING; }
|
||||
|
||||
public const DATA_TO_FACING = [
|
||||
0 => Facing::SOUTH,
|
||||
|
@ -43,7 +43,7 @@ class PrimedTNT extends Entity implements Explosive{
|
||||
|
||||
private const TAG_FUSE = "Fuse"; //TAG_Short
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::TNT; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::TNT; }
|
||||
|
||||
protected int $fuse;
|
||||
protected bool $worksUnderwater = false;
|
||||
|
@ -46,7 +46,7 @@ use function sqrt;
|
||||
|
||||
class Arrow extends Projectile{
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ARROW; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::ARROW; }
|
||||
|
||||
public const PICKUP_NONE = 0;
|
||||
public const PICKUP_ANY = 1;
|
||||
|
@ -29,7 +29,7 @@ use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\world\particle\ItemBreakParticle;
|
||||
|
||||
class Egg extends Throwable{
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::EGG; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::EGG; }
|
||||
|
||||
//TODO: spawn chickens on collision
|
||||
|
||||
|
@ -30,7 +30,7 @@ use pocketmine\world\particle\EndermanTeleportParticle;
|
||||
use pocketmine\world\sound\EndermanTeleportSound;
|
||||
|
||||
class EnderPearl extends Throwable{
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ENDER_PEARL; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::ENDER_PEARL; }
|
||||
|
||||
protected function onHit(ProjectileHitEvent $event) : void{
|
||||
$owner = $this->getOwningEntity();
|
||||
|
@ -30,7 +30,7 @@ use pocketmine\world\sound\PotionSplashSound;
|
||||
use function mt_rand;
|
||||
|
||||
class ExperienceBottle extends Throwable{
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::XP_BOTTLE; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::XP_BOTTLE; }
|
||||
|
||||
protected function getInitialGravity() : float{ return 0.07; }
|
||||
|
||||
|
@ -36,7 +36,7 @@ use pocketmine\world\particle\ItemBreakParticle;
|
||||
use pocketmine\world\sound\IceBombHitSound;
|
||||
|
||||
class IceBomb extends Throwable{
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::ICE_BOMB; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::ICE_BOMB; }
|
||||
|
||||
public function getResultDamage() : int{
|
||||
return -1;
|
||||
|
@ -28,7 +28,7 @@ use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
|
||||
use pocketmine\world\particle\SnowballPoofParticle;
|
||||
|
||||
class Snowball extends Throwable{
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::SNOWBALL; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::SNOWBALL; }
|
||||
|
||||
protected function onHit(ProjectileHitEvent $event) : void{
|
||||
$world = $this->getWorld();
|
||||
|
@ -52,7 +52,7 @@ class SplashPotion extends Throwable{
|
||||
|
||||
public const TAG_POTION_ID = "PotionId"; //TAG_Short
|
||||
|
||||
public static function getNetworkTypeId() : string{ return EntityIds::SPLASH_POTION; }
|
||||
public function getNetworkTypeId() : string{ return EntityIds::SPLASH_POTION; }
|
||||
|
||||
protected bool $linger = false;
|
||||
protected PotionType $potionType;
|
||||
|
@ -21,17 +21,16 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\player;
|
||||
namespace pocketmine\event\entity;
|
||||
|
||||
use pocketmine\entity\Human;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\event\entity\EntityEvent;
|
||||
|
||||
/**
|
||||
* @phpstan-extends EntityEvent<Human>
|
||||
* @phpstan-extends EntityEvent<Entity>
|
||||
*/
|
||||
class PlayerExhaustEvent extends EntityEvent implements Cancellable{
|
||||
class EntityExhaustEvent extends EntityEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
public const CAUSE_ATTACK = 1;
|
||||
@ -47,18 +46,11 @@ class PlayerExhaustEvent extends EntityEvent implements Cancellable{
|
||||
public const CAUSE_CUSTOM = 11;
|
||||
|
||||
public function __construct(
|
||||
protected Human $human,
|
||||
Entity $entity,
|
||||
private float $amount,
|
||||
private int $cause
|
||||
){
|
||||
$this->entity = $human;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Human
|
||||
*/
|
||||
public function getPlayer(){
|
||||
return $this->human;
|
||||
$this->entity = $entity;
|
||||
}
|
||||
|
||||
public function getAmount() : float{
|
@ -26,6 +26,7 @@ namespace pocketmine\event\server;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\event\Event;
|
||||
|
||||
/**
|
||||
* Called when any CommandSender runs a command, before it is parsed.
|
||||
@ -41,7 +42,7 @@ use pocketmine\event\CancellableTrait;
|
||||
*
|
||||
* The message DOES NOT begin with a slash.
|
||||
*/
|
||||
class CommandEvent extends ServerEvent implements Cancellable{
|
||||
class CommandEvent extends Event implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
public function __construct(
|
||||
|
@ -25,13 +25,14 @@ namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
|
||||
/**
|
||||
* Called before a packet is decoded and handled by the network session.
|
||||
* Cancelling this event will drop the packet without decoding it, minimizing wasted CPU time.
|
||||
*/
|
||||
class DataPacketDecodeEvent extends ServerEvent implements Cancellable{
|
||||
class DataPacketDecodeEvent extends Event implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
public function __construct(
|
||||
|
@ -25,10 +25,11 @@ namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\ServerboundPacket;
|
||||
|
||||
class DataPacketReceiveEvent extends ServerEvent implements Cancellable{
|
||||
class DataPacketReceiveEvent extends Event implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
public function __construct(
|
||||
|
@ -25,6 +25,7 @@ namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\network\mcpe\NetworkSession;
|
||||
use pocketmine\network\mcpe\protocol\ClientboundPacket;
|
||||
use pocketmine\utils\Utils;
|
||||
@ -32,7 +33,7 @@ use pocketmine\utils\Utils;
|
||||
/**
|
||||
* Called when packets are sent to network sessions.
|
||||
*/
|
||||
class DataPacketSendEvent extends ServerEvent implements Cancellable{
|
||||
class DataPacketSendEvent extends Event implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/**
|
||||
|
@ -23,13 +23,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\utils\Process;
|
||||
|
||||
/**
|
||||
* Called when the server is in a low-memory state as defined by the properties
|
||||
* Plugins should free caches or other non-essential data.
|
||||
*/
|
||||
class LowMemoryEvent extends ServerEvent{
|
||||
class LowMemoryEvent extends Event{
|
||||
public function __construct(
|
||||
private int $memory,
|
||||
private int $memoryLimit,
|
||||
|
@ -23,9 +23,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\network\NetworkInterface;
|
||||
|
||||
class NetworkInterfaceEvent extends ServerEvent{
|
||||
class NetworkInterfaceEvent extends Event{
|
||||
public function __construct(
|
||||
protected NetworkInterface $interface
|
||||
){}
|
||||
|
@ -23,9 +23,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\network\query\QueryInfo;
|
||||
|
||||
class QueryRegenerateEvent extends ServerEvent{
|
||||
class QueryRegenerateEvent extends Event{
|
||||
public function __construct(private QueryInfo $queryInfo){}
|
||||
|
||||
public function getQueryInfo() : QueryInfo{
|
||||
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Events related to the server core, like networking, stop, console commands
|
||||
*/
|
||||
namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Event;
|
||||
|
||||
abstract class ServerEvent extends Event{
|
||||
|
||||
}
|
@ -23,13 +23,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\event\server;
|
||||
|
||||
use pocketmine\event\Event;
|
||||
use pocketmine\updater\UpdateChecker;
|
||||
|
||||
/**
|
||||
* Called when the update checker receives notification of an available PocketMine-MP update.
|
||||
* Plugins may use this event to perform actions when an update notification is received.
|
||||
*/
|
||||
class UpdateNotifyEvent extends ServerEvent{
|
||||
class UpdateNotifyEvent extends Event{
|
||||
public function __construct(private UpdateChecker $updater){}
|
||||
|
||||
public function getUpdater() : UpdateChecker{
|
||||
|
@ -110,7 +110,6 @@ class InventoryTransaction{
|
||||
public function addAction(InventoryAction $action) : void{
|
||||
if(!isset($this->actions[$hash = spl_object_id($action)])){
|
||||
$this->actions[$hash] = $action;
|
||||
$action->onAddToTransaction($this);
|
||||
if($action instanceof SlotChangeAction && !isset($this->inventories[$inventoryId = spl_object_id($action->getInventory())])){
|
||||
$this->inventories[$inventoryId] = $action->getInventory();
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\inventory\transaction\action;
|
||||
|
||||
use pocketmine\inventory\transaction\InventoryTransaction;
|
||||
use pocketmine\inventory\transaction\TransactionValidationException;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\player\Player;
|
||||
@ -58,14 +57,6 @@ abstract class InventoryAction{
|
||||
*/
|
||||
abstract public function validate(Player $source) : void;
|
||||
|
||||
/**
|
||||
* Called when the action is added to the specified InventoryTransaction.
|
||||
* @deprecated
|
||||
*/
|
||||
public function onAddToTransaction(InventoryTransaction $transaction) : void{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by inventory transactions before any actions are processed. If this returns false, the transaction will
|
||||
* be cancelled.
|
||||
|
@ -24,23 +24,8 @@ declare(strict_types=1);
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\block\utils\WoodType;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static BoatType ACACIA()
|
||||
* @method static BoatType BIRCH()
|
||||
* @method static BoatType DARK_OAK()
|
||||
* @method static BoatType JUNGLE()
|
||||
* @method static BoatType MANGROVE()
|
||||
* @method static BoatType OAK()
|
||||
* @method static BoatType SPRUCE()
|
||||
*/
|
||||
enum BoatType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case OAK;
|
||||
case SPRUCE;
|
||||
case BIRCH;
|
||||
|
@ -125,7 +125,7 @@ class Item implements \JsonSerializable{
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function clearCustomBlockData(){
|
||||
public function clearCustomBlockData() : Item{
|
||||
$this->blockEntityTag = null;
|
||||
return $this;
|
||||
}
|
||||
@ -202,11 +202,12 @@ class Item implements \JsonSerializable{
|
||||
/**
|
||||
* @param string[] $canPlaceOn
|
||||
*/
|
||||
public function setCanPlaceOn(array $canPlaceOn) : void{
|
||||
public function setCanPlaceOn(array $canPlaceOn) : Item{
|
||||
$this->canPlaceOn = [];
|
||||
foreach($canPlaceOn as $value){
|
||||
$this->canPlaceOn[$value] = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -220,11 +221,12 @@ class Item implements \JsonSerializable{
|
||||
/**
|
||||
* @param string[] $canDestroy
|
||||
*/
|
||||
public function setCanDestroy(array $canDestroy) : void{
|
||||
public function setCanDestroy(array $canDestroy) : Item{
|
||||
$this->canDestroy = [];
|
||||
foreach($canDestroy as $value){
|
||||
$this->canDestroy[$value] = $value;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -234,8 +236,9 @@ class Item implements \JsonSerializable{
|
||||
return $this->keepOnDeath;
|
||||
}
|
||||
|
||||
public function setKeepOnDeath(bool $keepOnDeath) : void{
|
||||
public function setKeepOnDeath(bool $keepOnDeath) : Item{
|
||||
$this->keepOnDeath = $keepOnDeath;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,19 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static ItemUseResult FAIL()
|
||||
* @method static ItemUseResult NONE()
|
||||
* @method static ItemUseResult SUCCESS()
|
||||
*/
|
||||
enum ItemUseResult{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case NONE;
|
||||
case FAIL;
|
||||
case SUCCESS;
|
||||
|
@ -25,20 +25,8 @@ namespace pocketmine\item;
|
||||
|
||||
use pocketmine\entity\effect\Effect;
|
||||
use pocketmine\entity\effect\VanillaEffects;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static MedicineType ANTIDOTE()
|
||||
* @method static MedicineType ELIXIR()
|
||||
* @method static MedicineType EYE_DROPS()
|
||||
* @method static MedicineType TONIC()
|
||||
*/
|
||||
enum MedicineType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case ANTIDOTE;
|
||||
case ELIXIR;
|
||||
case EYE_DROPS;
|
||||
|
@ -25,62 +25,12 @@ namespace pocketmine\item;
|
||||
|
||||
use pocketmine\entity\effect\EffectInstance;
|
||||
use pocketmine\entity\effect\VanillaEffects;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
use function spl_object_id;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static PotionType AWKWARD()
|
||||
* @method static PotionType FIRE_RESISTANCE()
|
||||
* @method static PotionType HARMING()
|
||||
* @method static PotionType HEALING()
|
||||
* @method static PotionType INVISIBILITY()
|
||||
* @method static PotionType LEAPING()
|
||||
* @method static PotionType LONG_FIRE_RESISTANCE()
|
||||
* @method static PotionType LONG_INVISIBILITY()
|
||||
* @method static PotionType LONG_LEAPING()
|
||||
* @method static PotionType LONG_MUNDANE()
|
||||
* @method static PotionType LONG_NIGHT_VISION()
|
||||
* @method static PotionType LONG_POISON()
|
||||
* @method static PotionType LONG_REGENERATION()
|
||||
* @method static PotionType LONG_SLOWNESS()
|
||||
* @method static PotionType LONG_SLOW_FALLING()
|
||||
* @method static PotionType LONG_STRENGTH()
|
||||
* @method static PotionType LONG_SWIFTNESS()
|
||||
* @method static PotionType LONG_TURTLE_MASTER()
|
||||
* @method static PotionType LONG_WATER_BREATHING()
|
||||
* @method static PotionType LONG_WEAKNESS()
|
||||
* @method static PotionType MUNDANE()
|
||||
* @method static PotionType NIGHT_VISION()
|
||||
* @method static PotionType POISON()
|
||||
* @method static PotionType REGENERATION()
|
||||
* @method static PotionType SLOWNESS()
|
||||
* @method static PotionType SLOW_FALLING()
|
||||
* @method static PotionType STRENGTH()
|
||||
* @method static PotionType STRONG_HARMING()
|
||||
* @method static PotionType STRONG_HEALING()
|
||||
* @method static PotionType STRONG_LEAPING()
|
||||
* @method static PotionType STRONG_POISON()
|
||||
* @method static PotionType STRONG_REGENERATION()
|
||||
* @method static PotionType STRONG_SLOWNESS()
|
||||
* @method static PotionType STRONG_STRENGTH()
|
||||
* @method static PotionType STRONG_SWIFTNESS()
|
||||
* @method static PotionType STRONG_TURTLE_MASTER()
|
||||
* @method static PotionType SWIFTNESS()
|
||||
* @method static PotionType THICK()
|
||||
* @method static PotionType TURTLE_MASTER()
|
||||
* @method static PotionType WATER()
|
||||
* @method static PotionType WATER_BREATHING()
|
||||
* @method static PotionType WEAKNESS()
|
||||
* @method static PotionType WITHER()
|
||||
*
|
||||
* @phpstan-type TMetadata array{0: string, 1: \Closure() : list<EffectInstance>}
|
||||
*/
|
||||
enum PotionType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case WATER;
|
||||
case MUNDANE;
|
||||
case LONG_MUNDANE;
|
||||
|
@ -25,26 +25,8 @@ namespace pocketmine\item;
|
||||
|
||||
use pocketmine\entity\effect\EffectInstance;
|
||||
use pocketmine\entity\effect\VanillaEffects;
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static SuspiciousStewType ALLIUM()
|
||||
* @method static SuspiciousStewType AZURE_BLUET()
|
||||
* @method static SuspiciousStewType BLUE_ORCHID()
|
||||
* @method static SuspiciousStewType CORNFLOWER()
|
||||
* @method static SuspiciousStewType DANDELION()
|
||||
* @method static SuspiciousStewType LILY_OF_THE_VALLEY()
|
||||
* @method static SuspiciousStewType OXEYE_DAISY()
|
||||
* @method static SuspiciousStewType POPPY()
|
||||
* @method static SuspiciousStewType TULIP()
|
||||
* @method static SuspiciousStewType WITHER_ROSE()
|
||||
*/
|
||||
enum SuspiciousStewType{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case POPPY;
|
||||
case CORNFLOWER;
|
||||
case TULIP;
|
||||
|
@ -23,24 +23,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\item;
|
||||
|
||||
use pocketmine\utils\LegacyEnumShimTrait;
|
||||
|
||||
/**
|
||||
* TODO: These tags need to be removed once we get rid of LegacyEnumShimTrait (PM6)
|
||||
* These are retained for backwards compatibility only.
|
||||
*
|
||||
* @method static ToolTier DIAMOND()
|
||||
* @method static ToolTier GOLD()
|
||||
* @method static ToolTier IRON()
|
||||
* @method static ToolTier NETHERITE()
|
||||
* @method static ToolTier STONE()
|
||||
* @method static ToolTier WOOD()
|
||||
*
|
||||
* @phpstan-type TMetadata array{0: int, 1: int, 2: int, 3: int, 4: int}
|
||||
*/
|
||||
enum ToolTier{
|
||||
use LegacyEnumShimTrait;
|
||||
|
||||
case WOOD;
|
||||
case GOLD;
|
||||
case STONE;
|
||||
|
@ -44,15 +44,11 @@ class Enchantment{
|
||||
/**
|
||||
* @phpstan-param null|(\Closure(int $level) : int) $minEnchantingPower
|
||||
*
|
||||
* @param int $primaryItemFlags @deprecated
|
||||
* @param int $secondaryItemFlags @deprecated
|
||||
* @param int $enchantingPowerRange Value used to calculate the maximum enchanting power (minEnchantingPower + enchantingPowerRange)
|
||||
*/
|
||||
public function __construct(
|
||||
private Translatable|string $name,
|
||||
private int $rarity,
|
||||
private int $primaryItemFlags,
|
||||
private int $secondaryItemFlags,
|
||||
private int $maxLevel,
|
||||
?\Closure $minEnchantingPower = null,
|
||||
private int $enchantingPowerRange = 50
|
||||
@ -79,47 +75,6 @@ class Enchantment{
|
||||
return $this->rarity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bitset indicating what item types can have this item applied from an enchanting table.
|
||||
*
|
||||
* @deprecated
|
||||
* @see AvailableEnchantmentRegistry::getPrimaryItemTags()
|
||||
*/
|
||||
public function getPrimaryItemFlags() : int{
|
||||
return $this->primaryItemFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a bitset indicating what item types cannot have this item applied from an enchanting table, but can from
|
||||
* an anvil.
|
||||
*
|
||||
* @deprecated
|
||||
* @see AvailableEnchantmentRegistry::getSecondaryItemTags()
|
||||
*/
|
||||
public function getSecondaryItemFlags() : int{
|
||||
return $this->secondaryItemFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this enchantment can apply to the item type from an enchanting table.
|
||||
*
|
||||
* @deprecated
|
||||
* @see AvailableEnchantmentRegistry
|
||||
*/
|
||||
public function hasPrimaryItemType(int $flag) : bool{
|
||||
return ($this->primaryItemFlags & $flag) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this enchantment can apply to the item type from an anvil, if it is not a primary item.
|
||||
*
|
||||
* @deprecated
|
||||
* @see AvailableEnchantmentRegistry
|
||||
*/
|
||||
public function hasSecondaryItemType(int $flag) : bool{
|
||||
return ($this->secondaryItemFlags & $flag) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum level of this enchantment that can be found on an enchantment table.
|
||||
*/
|
||||
|
@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\item\enchantment;
|
||||
|
||||
/** @deprecated */
|
||||
final class ItemFlags{
|
||||
|
||||
private function __construct(){
|
||||
//NOOP
|
||||
}
|
||||
|
||||
public const NONE = 0x0;
|
||||
public const ALL = 0xffff;
|
||||
public const ARMOR = self::HEAD | self::TORSO | self::LEGS | self::FEET;
|
||||
public const HEAD = 0x1;
|
||||
public const TORSO = 0x2;
|
||||
public const LEGS = 0x4;
|
||||
public const FEET = 0x8;
|
||||
public const SWORD = 0x10;
|
||||
public const BOW = 0x20;
|
||||
public const TOOL = self::HOE | self::SHEARS | self::FLINT_AND_STEEL;
|
||||
public const HOE = 0x40;
|
||||
public const SHEARS = 0x80;
|
||||
public const FLINT_AND_STEEL = 0x100;
|
||||
public const DIG = self::AXE | self::PICKAXE | self::SHOVEL;
|
||||
public const AXE = 0x200;
|
||||
public const PICKAXE = 0x400;
|
||||
public const SHOVEL = 0x800;
|
||||
public const FISHING_ROD = 0x1000;
|
||||
public const CARROT_STICK = 0x2000;
|
||||
public const ELYTRA = 0x4000;
|
||||
public const TRIDENT = 0x8000;
|
||||
}
|
@ -42,13 +42,11 @@ class ProtectionEnchantment extends Enchantment{
|
||||
* @phpstan-param null|(\Closure(int $level) : int) $minEnchantingPower
|
||||
* @phpstan-param list<int>|null $applicableDamageTypes
|
||||
*
|
||||
* @param int $primaryItemFlags @deprecated
|
||||
* @param int $secondaryItemFlags @deprecated
|
||||
* @param int[]|null $applicableDamageTypes EntityDamageEvent::CAUSE_* constants which this enchantment type applies to, or null if it applies to all types of damage.
|
||||
* @param int $enchantingPowerRange Value used to calculate the maximum enchanting power (minEnchantingPower + enchantingPowerRange)
|
||||
*/
|
||||
public function __construct(Translatable|string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel, float $typeModifier, ?array $applicableDamageTypes, ?\Closure $minEnchantingPower = null, int $enchantingPowerRange = 50){
|
||||
parent::__construct($name, $rarity, $primaryItemFlags, $secondaryItemFlags, $maxLevel, $minEnchantingPower, $enchantingPowerRange);
|
||||
public function __construct(Translatable|string $name, int $rarity, int $maxLevel, float $typeModifier, ?array $applicableDamageTypes, ?\Closure $minEnchantingPower = null, int $enchantingPowerRange = 50){
|
||||
parent::__construct($name, $rarity, $maxLevel, $minEnchantingPower, $enchantingPowerRange);
|
||||
|
||||
$this->typeModifier = $typeModifier;
|
||||
if($applicableDamageTypes !== null){
|
||||
|
@ -64,8 +64,6 @@ final class VanillaEnchantments{
|
||||
self::register("PROTECTION", new ProtectionEnchantment(
|
||||
KnownTranslationFactory::enchantment_protect_all(),
|
||||
Rarity::COMMON,
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
0.75,
|
||||
null,
|
||||
@ -75,8 +73,6 @@ final class VanillaEnchantments{
|
||||
self::register("FIRE_PROTECTION", new ProtectionEnchantment(
|
||||
KnownTranslationFactory::enchantment_protect_fire(),
|
||||
Rarity::UNCOMMON,
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
1.25,
|
||||
[
|
||||
@ -91,8 +87,6 @@ final class VanillaEnchantments{
|
||||
self::register("FEATHER_FALLING", new ProtectionEnchantment(
|
||||
KnownTranslationFactory::enchantment_protect_fall(),
|
||||
Rarity::UNCOMMON,
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
2.5,
|
||||
[
|
||||
@ -104,8 +98,6 @@ final class VanillaEnchantments{
|
||||
self::register("BLAST_PROTECTION", new ProtectionEnchantment(
|
||||
KnownTranslationFactory::enchantment_protect_explosion(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
1.5,
|
||||
[
|
||||
@ -118,8 +110,6 @@ final class VanillaEnchantments{
|
||||
self::register("PROJECTILE_PROTECTION", new ProtectionEnchantment(
|
||||
KnownTranslationFactory::enchantment_protect_projectile(),
|
||||
Rarity::UNCOMMON,
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
1.5,
|
||||
[
|
||||
@ -131,8 +121,6 @@ final class VanillaEnchantments{
|
||||
self::register("THORNS", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_thorns(),
|
||||
Rarity::MYTHIC,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
fn(int $level) : int => 20 * ($level - 1) + 10,
|
||||
50
|
||||
@ -140,8 +128,6 @@ final class VanillaEnchantments{
|
||||
self::register("RESPIRATION", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_oxygen(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
fn(int $level) : int => 10 * $level,
|
||||
30
|
||||
@ -150,8 +136,6 @@ final class VanillaEnchantments{
|
||||
self::register("FROST_WALKER", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_frostwalker(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
fn(int $level) : int => 10 * $level,
|
||||
15
|
||||
@ -159,8 +143,6 @@ final class VanillaEnchantments{
|
||||
self::register("AQUA_AFFINITY", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_waterWorker(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
null,
|
||||
40
|
||||
@ -169,8 +151,6 @@ final class VanillaEnchantments{
|
||||
self::register("SHARPNESS", new SharpnessEnchantment(
|
||||
KnownTranslationFactory::enchantment_damage_all(),
|
||||
Rarity::COMMON,
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
fn(int $level) : int => 11 * ($level - 1) + 1,
|
||||
20
|
||||
@ -178,8 +158,6 @@ final class VanillaEnchantments{
|
||||
self::register("KNOCKBACK", new KnockbackEnchantment(
|
||||
KnownTranslationFactory::enchantment_knockback(),
|
||||
Rarity::UNCOMMON,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
fn(int $level) : int => 20 * ($level - 1) + 5,
|
||||
50
|
||||
@ -187,8 +165,6 @@ final class VanillaEnchantments{
|
||||
self::register("FIRE_ASPECT", new FireAspectEnchantment(
|
||||
KnownTranslationFactory::enchantment_fire(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
fn(int $level) : int => 20 * ($level - 1) + 10,
|
||||
50
|
||||
@ -198,8 +174,6 @@ final class VanillaEnchantments{
|
||||
self::register("EFFICIENCY", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_digging(),
|
||||
Rarity::COMMON,
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
fn(int $level) : int => 10 * ($level - 1) + 1,
|
||||
50
|
||||
@ -207,8 +181,6 @@ final class VanillaEnchantments{
|
||||
self::register("FORTUNE", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_lootBonusDigger(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
fn(int $level) : int => 9 * ($level - 1) + 15,
|
||||
50
|
||||
@ -216,8 +188,6 @@ final class VanillaEnchantments{
|
||||
self::register("SILK_TOUCH", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_untouching(),
|
||||
Rarity::MYTHIC,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
fn(int $level) : int => 15,
|
||||
50
|
||||
@ -225,8 +195,6 @@ final class VanillaEnchantments{
|
||||
self::register("UNBREAKING", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_durability(),
|
||||
Rarity::UNCOMMON,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
fn(int $level) : int => 8 * ($level - 1) + 5,
|
||||
50
|
||||
@ -235,8 +203,6 @@ final class VanillaEnchantments{
|
||||
self::register("POWER", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_arrowDamage(),
|
||||
Rarity::COMMON,
|
||||
0,
|
||||
0,
|
||||
5,
|
||||
fn(int $level) : int => 10 * ($level - 1) + 1,
|
||||
15
|
||||
@ -244,8 +210,6 @@ final class VanillaEnchantments{
|
||||
self::register("PUNCH", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_arrowKnockback(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
fn(int $level) : int => 20 * ($level - 1) + 12,
|
||||
25
|
||||
@ -253,8 +217,6 @@ final class VanillaEnchantments{
|
||||
self::register("FLAME", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_arrowFire(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
fn(int $level) : int => 20,
|
||||
30
|
||||
@ -262,8 +224,6 @@ final class VanillaEnchantments{
|
||||
self::register("INFINITY", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_arrowInfinite(),
|
||||
Rarity::MYTHIC,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
fn(int $level) : int => 20,
|
||||
30
|
||||
@ -272,8 +232,6 @@ final class VanillaEnchantments{
|
||||
self::register("MENDING", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_mending(),
|
||||
Rarity::RARE,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
fn(int $level) : int => 25,
|
||||
50
|
||||
@ -282,8 +240,6 @@ final class VanillaEnchantments{
|
||||
self::register("VANISHING", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_curse_vanishing(),
|
||||
Rarity::MYTHIC,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
fn(int $level) : int => 25,
|
||||
25
|
||||
@ -292,8 +248,6 @@ final class VanillaEnchantments{
|
||||
self::register("SWIFT_SNEAK", new Enchantment(
|
||||
KnownTranslationFactory::enchantment_swift_sneak(),
|
||||
Rarity::MYTHIC,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
fn(int $level) : int => 10 * $level,
|
||||
5
|
||||
|
@ -108,7 +108,6 @@ class PreSpawnPacketHandler extends PacketHandler{
|
||||
Uuid::fromString(Uuid::NIL),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
new NetworkPermissions(disableClientSounds: true),
|
||||
[],
|
||||
0,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user