mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-13 12:55:06 +00:00
Compare commits
39 Commits
Author | SHA1 | Date | |
---|---|---|---|
afb21c1df2 | |||
988be2a96b | |||
afe67f7502 | |||
b257348a3a | |||
12c66d3362 | |||
92fd2d35a4 | |||
61077c48f1 | |||
e0c61071e1 | |||
813d431208 | |||
ee112b992d | |||
c9b33e2b9f | |||
2f2be84b12 | |||
5a7736b179 | |||
e648f1c91e | |||
5116e11cea | |||
9c05e37fbe | |||
fb4796f35e | |||
0c2ba66078 | |||
c29cd8e2eb | |||
a13b0c98a1 | |||
e6ff908e18 | |||
c47ecb55c0 | |||
c19d2fe891 | |||
f195f24f4f | |||
4b5f279a3e | |||
89260d788c | |||
a7cd081002 | |||
361be8fe36 | |||
b01e4ab417 | |||
177b963d8e | |||
8d1a1628de | |||
6f80b8979d | |||
3c8eb29d4e | |||
b94bbf6f5e | |||
314a8a1297 | |||
547503e8f4 | |||
f74ff1fcd4 | |||
6c351357ab | |||
3433406cff |
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: composer
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "10:00"
|
||||||
|
open-pull-requests-limit: 10
|
20
.github/workflows/main.yml
vendored
20
.github/workflows/main.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.27, 7.4.16]
|
php: [7.3.28, 7.4.19]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2 #needed for build.sh
|
- uses: actions/checkout@v2 #needed for build.sh
|
||||||
@ -37,7 +37,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.27, 7.4.16]
|
php: [7.3.28, 7.4.19]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -55,7 +55,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install cached PHP's dependencies
|
- name: Install cached PHP's dependencies
|
||||||
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
||||||
run: chmod +x ./bin/php7/install-dependencies.sh && ./bin/php7/install-dependencies.sh
|
run: ./tests/gh-actions/install-dependencies.sh
|
||||||
|
|
||||||
- name: Prefix PHP to PATH
|
- name: Prefix PHP to PATH
|
||||||
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
||||||
@ -87,7 +87,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.27, 7.4.16]
|
php: [7.3.28, 7.4.19]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -105,7 +105,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install cached PHP's dependencies
|
- name: Install cached PHP's dependencies
|
||||||
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
||||||
run: chmod +x ./bin/php7/install-dependencies.sh && ./bin/php7/install-dependencies.sh
|
run: ./tests/gh-actions/install-dependencies.sh
|
||||||
|
|
||||||
- name: Prefix PHP to PATH
|
- name: Prefix PHP to PATH
|
||||||
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
||||||
@ -137,7 +137,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.27, 7.4.16]
|
php: [7.3.28, 7.4.19]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -157,7 +157,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install cached PHP's dependencies
|
- name: Install cached PHP's dependencies
|
||||||
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
||||||
run: chmod +x ./bin/php7/install-dependencies.sh && ./bin/php7/install-dependencies.sh
|
run: ./tests/gh-actions/install-dependencies.sh
|
||||||
|
|
||||||
- name: Prefix PHP to PATH
|
- name: Prefix PHP to PATH
|
||||||
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
||||||
@ -189,7 +189,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [ubuntu-20.04]
|
image: [ubuntu-20.04]
|
||||||
php: [7.3.27, 7.4.16]
|
php: [7.3.28, 7.4.19]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -209,7 +209,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install cached PHP's dependencies
|
- name: Install cached PHP's dependencies
|
||||||
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
if: steps.php-build-cache.outputs.cache-hit == 'true'
|
||||||
run: chmod +x ./bin/php7/install-dependencies.sh && ./bin/php7/install-dependencies.sh
|
run: ./tests/gh-actions/install-dependencies.sh
|
||||||
|
|
||||||
- name: Prefix PHP to PATH
|
- name: Prefix PHP to PATH
|
||||||
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
|
||||||
@ -278,4 +278,4 @@ jobs:
|
|||||||
tools: php-cs-fixer
|
tools: php-cs-fixer
|
||||||
|
|
||||||
- name: Run PHP-CS-Fixer
|
- name: Run PHP-CS-Fixer
|
||||||
run: php-cs-fixer fix --dry-run --diff --diff-format=udiff
|
run: php-cs-fixer fix --dry-run --diff
|
||||||
|
51
.github/workflows/update-php-versions.php
vendored
Normal file
51
.github/workflows/update-php-versions.php
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?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);
|
||||||
|
|
||||||
|
const VERSIONS = [
|
||||||
|
"7.3",
|
||||||
|
"7.4",
|
||||||
|
"8.0"
|
||||||
|
];
|
||||||
|
|
||||||
|
$workflowFile = file_get_contents(__DIR__ . '/main.yml');
|
||||||
|
$newWorkflowFile = $workflowFile;
|
||||||
|
foreach(VERSIONS as $v){
|
||||||
|
$releaseInfo = file_get_contents("https://secure.php.net/releases?json&version=$v");
|
||||||
|
if($releaseInfo === false){
|
||||||
|
throw new \RuntimeException("Failed to contact php.net API");
|
||||||
|
}
|
||||||
|
$data = json_decode($releaseInfo, true);
|
||||||
|
if(!is_array($data) || !isset($data["version"]) || !is_string($data["version"]) || preg_match('/^\d+\.\d+\.\d+(-[A-Za-z\d]+)?$/', $data["version"]) === 0){
|
||||||
|
throw new \RuntimeException("Invalid data returned by API");
|
||||||
|
}
|
||||||
|
$updated = preg_replace("/$v\.\d+/", $data["version"], $newWorkflowFile);
|
||||||
|
if($updated !== $newWorkflowFile){
|
||||||
|
echo "Updated $v revision to " . $data["version"] . "\n";
|
||||||
|
}
|
||||||
|
$newWorkflowFile = $updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($workflowFile !== $newWorkflowFile){
|
||||||
|
echo "Writing modified workflow file\n";
|
||||||
|
file_put_contents(__DIR__ . '/main.yml', $newWorkflowFile);
|
||||||
|
}
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -16,7 +16,9 @@ server.lock
|
|||||||
/phpstan.neon
|
/phpstan.neon
|
||||||
|
|
||||||
# Common IDEs
|
# Common IDEs
|
||||||
.idea/
|
.idea/*
|
||||||
|
!.idea/codeStyles/
|
||||||
|
!.idea/fileTemplates/
|
||||||
nbproject/*
|
nbproject/*
|
||||||
|
|
||||||
# Windows image file caches
|
# Windows image file caches
|
||||||
@ -47,3 +49,4 @@ Documentation/*
|
|||||||
|
|
||||||
# php-cs-fixer
|
# php-cs-fixer
|
||||||
/.php_cs.cache
|
/.php_cs.cache
|
||||||
|
/.php-cs-fixer.cache
|
||||||
|
71
.idea/codeStyles/Project.xml
generated
Normal file
71
.idea/codeStyles/Project.xml
generated
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<option name="LINE_SEPARATOR" value=" " />
|
||||||
|
<HTMLCodeStyleSettings>
|
||||||
|
<option name="HTML_TEXT_WRAP" value="0" />
|
||||||
|
<option name="HTML_DO_NOT_INDENT_CHILDREN_OF" value="thead,tbody,tfoot" />
|
||||||
|
</HTMLCodeStyleSettings>
|
||||||
|
<PHPCodeStyleSettings>
|
||||||
|
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
|
||||||
|
<option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" />
|
||||||
|
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
|
||||||
|
<option name="LOWER_CASE_NULL_CONST" value="true" />
|
||||||
|
<option name="VARIABLE_NAMING_STYLE" value="CAMEL_CASE" />
|
||||||
|
<option name="SPACES_WITHIN_SHORT_ECHO_TAGS" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_CLOSURE_LEFT_PARENTHESIS" value="false" />
|
||||||
|
<option name="FORCE_SHORT_DECLARATION_ARRAY_STYLE" value="true" />
|
||||||
|
<option name="SPACE_BEFORE_COLON_IN_RETURN_TYPE" value="true" />
|
||||||
|
</PHPCodeStyleSettings>
|
||||||
|
<editorconfig>
|
||||||
|
<option name="ENABLED" value="false" />
|
||||||
|
</editorconfig>
|
||||||
|
<codeStyleSettings language="HTML">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="USE_TAB_CHARACTER" value="true" />
|
||||||
|
</indentOptions>
|
||||||
|
</codeStyleSettings>
|
||||||
|
<codeStyleSettings language="JSON">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="INDENT_SIZE" value="4" />
|
||||||
|
<option name="USE_TAB_CHARACTER" value="true" />
|
||||||
|
</indentOptions>
|
||||||
|
</codeStyleSettings>
|
||||||
|
<codeStyleSettings language="PHP">
|
||||||
|
<option name="CLASS_BRACE_STYLE" value="1" />
|
||||||
|
<option name="METHOD_BRACE_STYLE" value="1" />
|
||||||
|
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
||||||
|
<option name="ALIGN_MULTILINE_FOR" value="false" />
|
||||||
|
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
||||||
|
<option name="SPACE_AFTER_TYPE_CAST" value="true" />
|
||||||
|
<option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_FOR_PARENTHESES" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_CATCH_PARENTHESES" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_SWITCH_PARENTHESES" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_CLASS_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_METHOD_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_IF_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_ELSE_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_WHILE_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_FOR_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_DO_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_SWITCH_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_TRY_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_CATCH_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_FINALLY_LBRACE" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_ELSE_KEYWORD" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_WHILE_KEYWORD" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_CATCH_KEYWORD" value="false" />
|
||||||
|
<option name="SPACE_BEFORE_FINALLY_KEYWORD" value="false" />
|
||||||
|
<option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
|
||||||
|
<indentOptions>
|
||||||
|
<option name="USE_TAB_CHARACTER" value="true" />
|
||||||
|
</indentOptions>
|
||||||
|
</codeStyleSettings>
|
||||||
|
<codeStyleSettings language="neon">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="USE_TAB_CHARACTER" value="true" />
|
||||||
|
</indentOptions>
|
||||||
|
</codeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||||
|
</state>
|
||||||
|
</component>
|
8
.idea/fileTemplates/code/PHP Constructor.php
generated
Normal file
8
.idea/fileTemplates/code/PHP Constructor.php
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#if(${THROWS_DOC} != "")
|
||||||
|
/**
|
||||||
|
${THROWS_DOC}
|
||||||
|
*/
|
||||||
|
#end
|
||||||
|
public function __construct(${PARAM_LIST}) {
|
||||||
|
${BODY}
|
||||||
|
}
|
6
.idea/fileTemplates/code/PHP Fluent Setter Method.php
generated
Normal file
6
.idea/fileTemplates/code/PHP Fluent Setter Method.php
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/** @return $this */
|
||||||
|
public function set${NAME}(#if (${SCALAR_TYPE_HINT})${SCALAR_TYPE_HINT} #else#end$${PARAM_NAME})#if(${RETURN_TYPE}): self#else#end
|
||||||
|
{
|
||||||
|
$this->${FIELD_NAME} = $${PARAM_NAME};
|
||||||
|
return $this;
|
||||||
|
}
|
3
.idea/fileTemplates/code/PHP Getter Method.php
generated
Normal file
3
.idea/fileTemplates/code/PHP Getter Method.php
generated
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#if(${TYPE_HINT} != ${RETURN_TYPE} && ${TYPE_HINT} != "")/** @return ${TYPE_HINT} */#end
|
||||||
|
public ${STATIC} function ${GET_OR_IS}${NAME}()#if(${RETURN_TYPE}): ${RETURN_TYPE}#else#end
|
||||||
|
{ return #if(${STATIC} == "static")self::$${FIELD_NAME};#else$this->${FIELD_NAME};#end }
|
2
.idea/fileTemplates/code/PHP Setter Method.php
generated
Normal file
2
.idea/fileTemplates/code/PHP Setter Method.php
generated
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
public ${STATIC} function set${NAME}(#if (${SCALAR_TYPE_HINT})${SCALAR_TYPE_HINT} #end$${PARAM_NAME})#if (${VOID_RETURN_TYPE}):void #end
|
||||||
|
{#if (${STATIC} == "static") self::$${FIELD_NAME} = $${PARAM_NAME}; #else $this->${FIELD_NAME} = $${PARAM_NAME}; #end}
|
0
.idea/fileTemplates/includes/PHP Class Doc Comment.php
generated
Normal file
0
.idea/fileTemplates/includes/PHP Class Doc Comment.php
generated
Normal file
21
.idea/fileTemplates/includes/PHP File Header.php
generated
Normal file
21
.idea/fileTemplates/includes/PHP File Header.php
generated
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* ____ _ _ __ __ _ __ __ ____
|
||||||
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||||
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||||
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||||
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||||
|
*
|
||||||
|
* 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);
|
5
.idea/fileTemplates/includes/PHP Function Doc Comment.php
generated
Normal file
5
.idea/fileTemplates/includes/PHP Function Doc Comment.php
generated
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#if (${THROWS_DOC} != "")
|
||||||
|
/**
|
||||||
|
${THROWS_DOC}
|
||||||
|
*/
|
||||||
|
#end
|
0
.idea/fileTemplates/includes/PHP Interface Doc Comment.php
generated
Normal file
0
.idea/fileTemplates/includes/PHP Interface Doc Comment.php
generated
Normal file
1
.idea/fileTemplates/includes/PHP Property Doc Comment.php
generated
Normal file
1
.idea/fileTemplates/includes/PHP Property Doc Comment.php
generated
Normal file
@ -0,0 +1 @@
|
|||||||
|
/** @var ${TYPE_HINT} */
|
0
.idea/fileTemplates/includes/PHP Trait Doc Comment.php
generated
Normal file
0
.idea/fileTemplates/includes/PHP Trait Doc Comment.php
generated
Normal file
10
.idea/fileTemplates/internal/PHP Class.php
generated
Normal file
10
.idea/fileTemplates/internal/PHP Class.php
generated
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
#parse("PHP File Header.php")
|
||||||
|
|
||||||
|
#if (${NAMESPACE})
|
||||||
|
namespace ${NAMESPACE};
|
||||||
|
#end
|
||||||
|
|
||||||
|
final class ${NAME} {
|
||||||
|
|
||||||
|
}
|
4
.idea/fileTemplates/internal/PHP File.php
generated
Normal file
4
.idea/fileTemplates/internal/PHP File.php
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
#parse("PHP File Header.php")
|
||||||
|
|
||||||
|
|
10
.idea/fileTemplates/internal/PHP Interface.php
generated
Normal file
10
.idea/fileTemplates/internal/PHP Interface.php
generated
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
#parse("PHP File Header.php")
|
||||||
|
|
||||||
|
#if (${NAMESPACE})
|
||||||
|
namespace ${NAMESPACE};
|
||||||
|
#end
|
||||||
|
|
||||||
|
interface ${NAME} {
|
||||||
|
|
||||||
|
}
|
10
.idea/fileTemplates/internal/PHP Trait.php
generated
Normal file
10
.idea/fileTemplates/internal/PHP Trait.php
generated
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
#parse("PHP File Header.php")
|
||||||
|
|
||||||
|
#if (${NAMESPACE})
|
||||||
|
namespace ${NAMESPACE};
|
||||||
|
#end
|
||||||
|
|
||||||
|
trait ${NAME} {
|
||||||
|
|
||||||
|
}
|
@ -9,7 +9,7 @@ $finder = PhpCsFixer\Finder::create()
|
|||||||
->notContains('#ifndef COMPILE') //preprocessor will break if these are changed
|
->notContains('#ifndef COMPILE') //preprocessor will break if these are changed
|
||||||
->notName('PocketMine.php');
|
->notName('PocketMine.php');
|
||||||
|
|
||||||
return PhpCsFixer\Config::create()
|
return (new PhpCsFixer\Config)
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setRules([
|
->setRules([
|
||||||
'align_multiline_comment' => [
|
'align_multiline_comment' => [
|
Submodule build/php updated: c64baa0f1c...0a0ac2abb3
@ -15,3 +15,12 @@ Plugin developers should **only** update their required API to this version if y
|
|||||||
- Pumpkin and melon stems may not connect to their corresponding pumpkin/melon
|
- Pumpkin and melon stems may not connect to their corresponding pumpkin/melon
|
||||||
- New blocks, items & mobs aren't implemented
|
- New blocks, items & mobs aren't implemented
|
||||||
- Nether doesn't exist
|
- Nether doesn't exist
|
||||||
|
|
||||||
|
# 3.19.1
|
||||||
|
- Fixed some particles not working since 1.16.220.
|
||||||
|
- Fixed issues with creative inventory items appearing in the wrong places since 1.16.220.
|
||||||
|
- `Item->removeEnchantment()` now removes the `ench` tag from item NBT when removing the only enchantment on an item.
|
||||||
|
- Fixed temporary memory leak of repeating tasks which cancelled themselves during their `onRun()` handler (they were pushed back onto the task queue even though cancelled, and only removed at their next attempted repeat).
|
||||||
|
|
||||||
|
# 3.19.2
|
||||||
|
- Signs can now only be edited by the player who placed them. They will become finalized if the chunk containing them is unloaded and reloaded, or if the creating player quits the server.
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
"pocketmine/spl": "^0.4.0"
|
"pocketmine/spl": "^0.4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpstan/phpstan": "0.12.83",
|
"phpstan/phpstan": "0.12.88",
|
||||||
"phpstan/phpstan-phpunit": "^0.12.6",
|
"phpstan/phpstan-phpunit": "^0.12.6",
|
||||||
"phpstan/phpstan-strict-rules": "^0.12.2",
|
"phpstan/phpstan-strict-rules": "^0.12.2",
|
||||||
"phpunit/phpunit": "^9.2"
|
"phpunit/phpunit": "^9.2"
|
||||||
|
92
composer.lock
generated
92
composer.lock
generated
@ -4,20 +4,20 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "c07802390fc058bf06b3a1741ef7c08e",
|
"content-hash": "f44a7138679bc86f4feecb9f3dbf7f1a",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "adhocore/json-comment",
|
"name": "adhocore/json-comment",
|
||||||
"version": "1.1.0",
|
"version": "1.1.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/adhocore/php-json-comment.git",
|
"url": "https://github.com/adhocore/php-json-comment.git",
|
||||||
"reference": "cf7998124d1050b83d7d985447fefd630e09c1a2"
|
"reference": "fc2f76979f0a44a5f5bc2a2b600d0762fe0e78e7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/adhocore/php-json-comment/zipball/cf7998124d1050b83d7d985447fefd630e09c1a2",
|
"url": "https://api.github.com/repos/adhocore/php-json-comment/zipball/fc2f76979f0a44a5f5bc2a2b600d0762fe0e78e7",
|
||||||
"reference": "cf7998124d1050b83d7d985447fefd630e09c1a2",
|
"reference": "fc2f76979f0a44a5f5bc2a2b600d0762fe0e78e7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -51,7 +51,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/adhocore/php-json-comment/issues",
|
"issues": "https://github.com/adhocore/php-json-comment/issues",
|
||||||
"source": "https://github.com/adhocore/php-json-comment/tree/1.1.0"
|
"source": "https://github.com/adhocore/php-json-comment/tree/1.1.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@
|
|||||||
"type": "custom"
|
"type": "custom"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-04-05T13:11:13+00:00"
|
"time": "2021-04-09T03:06:06+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pocketmine/binaryutils",
|
"name": "pocketmine/binaryutils",
|
||||||
@ -617,16 +617,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nikic/php-parser",
|
"name": "nikic/php-parser",
|
||||||
"version": "v4.10.4",
|
"version": "v4.10.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nikic/PHP-Parser.git",
|
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||||
"reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e"
|
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e",
|
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f",
|
||||||
"reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e",
|
"reference": "4432ba399e47c66624bc73c8c0f811e5c109576f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -667,9 +667,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
||||||
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4"
|
"source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5"
|
||||||
},
|
},
|
||||||
"time": "2020-12-20T10:01:03+00:00"
|
"time": "2021-05-03T19:11:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phar-io/manifest",
|
"name": "phar-io/manifest",
|
||||||
@ -1009,16 +1009,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan",
|
"name": "phpstan/phpstan",
|
||||||
"version": "0.12.83",
|
"version": "0.12.88",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan.git",
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
"reference": "4a967cec6efb46b500dd6d768657336a3ffe699f"
|
"reference": "464d1a81af49409c41074aa6640ed0c4cbd9bb68"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/4a967cec6efb46b500dd6d768657336a3ffe699f",
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/464d1a81af49409c41074aa6640ed0c4cbd9bb68",
|
||||||
"reference": "4a967cec6efb46b500dd6d768657336a3ffe699f",
|
"reference": "464d1a81af49409c41074aa6640ed0c4cbd9bb68",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1049,7 +1049,7 @@
|
|||||||
"description": "PHPStan - PHP Static Analysis Tool",
|
"description": "PHPStan - PHP Static Analysis Tool",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpstan/phpstan/issues",
|
"issues": "https://github.com/phpstan/phpstan/issues",
|
||||||
"source": "https://github.com/phpstan/phpstan/tree/0.12.83"
|
"source": "https://github.com/phpstan/phpstan/tree/0.12.88"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -1065,25 +1065,25 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-04-03T15:35:45+00:00"
|
"time": "2021-05-17T12:24:49+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-phpunit",
|
"name": "phpstan/phpstan-phpunit",
|
||||||
"version": "0.12.18",
|
"version": "0.12.19",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phpstan/phpstan-phpunit.git",
|
"url": "https://github.com/phpstan/phpstan-phpunit.git",
|
||||||
"reference": "ab44aec7cfb5cb267b8bc30a8caea86dd50d1f72"
|
"reference": "52f7072ddc5f81492f9d2de65a24813a48c90b18"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/ab44aec7cfb5cb267b8bc30a8caea86dd50d1f72",
|
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/52f7072ddc5f81492f9d2de65a24813a48c90b18",
|
||||||
"reference": "ab44aec7cfb5cb267b8bc30a8caea86dd50d1f72",
|
"reference": "52f7072ddc5f81492f9d2de65a24813a48c90b18",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1 || ^8.0",
|
"php": "^7.1 || ^8.0",
|
||||||
"phpstan/phpstan": "^0.12.60"
|
"phpstan/phpstan": "^0.12.86"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"phpunit/phpunit": "<7.0"
|
"phpunit/phpunit": "<7.0"
|
||||||
@ -1118,9 +1118,9 @@
|
|||||||
"description": "PHPUnit extensions and rules for PHPStan",
|
"description": "PHPUnit extensions and rules for PHPStan",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
|
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
|
||||||
"source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.18"
|
"source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.19"
|
||||||
},
|
},
|
||||||
"time": "2021-03-06T11:51:27+00:00"
|
"time": "2021-04-30T11:10:37+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-strict-rules",
|
"name": "phpstan/phpstan-strict-rules",
|
||||||
@ -1493,16 +1493,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
"version": "9.5.4",
|
"version": "9.5.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "c73c6737305e779771147af66c96ca6a7ed8a741"
|
"reference": "89ff45ea9d70e35522fb6654a2ebc221158de276"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/89ff45ea9d70e35522fb6654a2ebc221158de276",
|
||||||
"reference": "c73c6737305e779771147af66c96ca6a7ed8a741",
|
"reference": "89ff45ea9d70e35522fb6654a2ebc221158de276",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1532,7 +1532,7 @@
|
|||||||
"sebastian/global-state": "^5.0.1",
|
"sebastian/global-state": "^5.0.1",
|
||||||
"sebastian/object-enumerator": "^4.0.3",
|
"sebastian/object-enumerator": "^4.0.3",
|
||||||
"sebastian/resource-operations": "^3.0.3",
|
"sebastian/resource-operations": "^3.0.3",
|
||||||
"sebastian/type": "^2.3",
|
"sebastian/type": "^2.3.2",
|
||||||
"sebastian/version": "^3.0.2"
|
"sebastian/version": "^3.0.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
@ -1580,7 +1580,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4"
|
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -1592,7 +1592,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-03-23T07:16:29+00:00"
|
"time": "2021-06-05T04:49:07+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/cli-parser",
|
"name": "sebastian/cli-parser",
|
||||||
@ -2451,16 +2451,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/type",
|
"name": "sebastian/type",
|
||||||
"version": "2.3.1",
|
"version": "2.3.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/type.git",
|
"url": "https://github.com/sebastianbergmann/type.git",
|
||||||
"reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2"
|
"reference": "0d1c587401514d17e8f9258a27e23527cb1b06c1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
|
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0d1c587401514d17e8f9258a27e23527cb1b06c1",
|
||||||
"reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
|
"reference": "0d1c587401514d17e8f9258a27e23527cb1b06c1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2495,7 +2495,7 @@
|
|||||||
"homepage": "https://github.com/sebastianbergmann/type",
|
"homepage": "https://github.com/sebastianbergmann/type",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/type/issues",
|
"issues": "https://github.com/sebastianbergmann/type/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/type/tree/2.3.1"
|
"source": "https://github.com/sebastianbergmann/type/tree/2.3.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2503,7 +2503,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2020-10-26T13:18:59+00:00"
|
"time": "2021-06-04T13:02:07+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/version",
|
"name": "sebastian/version",
|
||||||
@ -2560,16 +2560,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
"version": "v1.22.1",
|
"version": "v1.23.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||||
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e"
|
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e",
|
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
|
||||||
"reference": "c6c942b1ac76c82448322025e084cadc56048b4e",
|
"reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2581,7 +2581,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "1.22-dev"
|
"dev-main": "1.23-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
@ -2619,7 +2619,7 @@
|
|||||||
"portable"
|
"portable"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1"
|
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2635,7 +2635,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-01-07T16:49:33+00:00"
|
"time": "2021-02-19T12:13:01+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "theseer/tokenizer",
|
"name": "theseer/tokenizer",
|
||||||
|
@ -33,6 +33,6 @@ if(defined('pocketmine\_VERSION_INFO_INCLUDED')){
|
|||||||
const _VERSION_INFO_INCLUDED = true;
|
const _VERSION_INFO_INCLUDED = true;
|
||||||
|
|
||||||
const NAME = "PocketMine-MP";
|
const NAME = "PocketMine-MP";
|
||||||
const BASE_VERSION = "3.19.0";
|
const BASE_VERSION = "3.19.3";
|
||||||
const IS_DEVELOPMENT_BUILD = false;
|
const IS_DEVELOPMENT_BUILD = false;
|
||||||
const BUILD_NUMBER = 0;
|
const BUILD_NUMBER = 0;
|
||||||
|
@ -95,7 +95,7 @@ abstract class Worker extends \Worker{
|
|||||||
public function quit(){
|
public function quit(){
|
||||||
$this->isKilled = true;
|
$this->isKilled = true;
|
||||||
|
|
||||||
if($this->isRunning()){
|
if(!$this->isShutdown()){
|
||||||
while($this->unstack() !== null);
|
while($this->unstack() !== null);
|
||||||
$this->notify();
|
$this->notify();
|
||||||
$this->shutdown();
|
$this->shutdown();
|
||||||
|
@ -68,7 +68,10 @@ class SignPost extends Transparent{
|
|||||||
$this->getLevelNonNull()->setBlock($blockReplace, BlockFactory::get(Block::WALL_SIGN, $this->meta), true);
|
$this->getLevelNonNull()->setBlock($blockReplace, BlockFactory::get(Block::WALL_SIGN, $this->meta), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Tile::createTile(Tile::SIGN, $this->getLevelNonNull(), TileSign::createNBT($this, $face, $item, $player));
|
$sign = Tile::createTile(Tile::SIGN, $this->getLevelNonNull(), TileSign::createNBT($this, $face, $item, $player));
|
||||||
|
if($player !== null && $sign instanceof TileSign){
|
||||||
|
$sign->setEditorEntityRuntimeId($player->getId());
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,11 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setNamedTagEntry($ench);
|
if($ench->getCount() > 0){
|
||||||
|
$this->setNamedTagEntry($ench);
|
||||||
|
}else{
|
||||||
|
$this->removeNamedTagEntry(self::TAG_ENCH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeEnchantments() : void{
|
public function removeEnchantments() : void{
|
||||||
|
@ -144,16 +144,9 @@ class Normal extends Generator{
|
|||||||
return Biome::BIRCH_FOREST;
|
return Biome::BIRCH_FOREST;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
//FIXME: This will always cause River to be used since the rainfall is always greater than 0.8 if we
|
//Previously here, we had a (broken) condition to generate mountains, but fixing it would have
|
||||||
//reached this branch. However I don't think that substituting temperature for rainfall is correct given
|
//caused generation changes on a patch release, so we can't keep it here for now.
|
||||||
//that mountain biomes are supposed to be pretty cold.
|
return Biome::RIVER;
|
||||||
if($rainfall < 0.25){
|
|
||||||
return Biome::MOUNTAINS;
|
|
||||||
}elseif($rainfall < 0.70){
|
|
||||||
return Biome::SMALL_MOUNTAINS;
|
|
||||||
}else{
|
|
||||||
return Biome::RIVER;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -56,45 +56,58 @@ abstract class Particle extends Vector3{
|
|||||||
public const TYPE_DRIP_WATER = 26;
|
public const TYPE_DRIP_WATER = 26;
|
||||||
public const TYPE_DRIP_LAVA = 27;
|
public const TYPE_DRIP_LAVA = 27;
|
||||||
public const TYPE_DRIP_HONEY = 28;
|
public const TYPE_DRIP_HONEY = 28;
|
||||||
public const TYPE_FALLING_DUST = 29, TYPE_DUST = 29;
|
public const TYPE_STALACTITE_DRIP_WATER = 29;
|
||||||
public const TYPE_MOB_SPELL = 30;
|
public const TYPE_STALACTITE_DRIP_LAVA = 30;
|
||||||
public const TYPE_MOB_SPELL_AMBIENT = 31;
|
public const TYPE_FALLING_DUST = 31, TYPE_DUST = 31;
|
||||||
public const TYPE_MOB_SPELL_INSTANTANEOUS = 32;
|
public const TYPE_MOB_SPELL = 32;
|
||||||
public const TYPE_INK = 33;
|
public const TYPE_MOB_SPELL_AMBIENT = 33;
|
||||||
public const TYPE_SLIME = 34;
|
public const TYPE_MOB_SPELL_INSTANTANEOUS = 34;
|
||||||
public const TYPE_RAIN_SPLASH = 35;
|
public const TYPE_INK = 35;
|
||||||
public const TYPE_VILLAGER_ANGRY = 36;
|
public const TYPE_SLIME = 36;
|
||||||
public const TYPE_VILLAGER_HAPPY = 37;
|
public const TYPE_RAIN_SPLASH = 37;
|
||||||
public const TYPE_ENCHANTMENT_TABLE = 38;
|
public const TYPE_VILLAGER_ANGRY = 38;
|
||||||
public const TYPE_TRACKING_EMITTER = 39;
|
public const TYPE_VILLAGER_HAPPY = 39;
|
||||||
public const TYPE_NOTE = 40;
|
public const TYPE_ENCHANTMENT_TABLE = 40;
|
||||||
public const TYPE_WITCH_SPELL = 41;
|
public const TYPE_TRACKING_EMITTER = 41;
|
||||||
public const TYPE_CARROT = 42;
|
public const TYPE_NOTE = 42;
|
||||||
public const TYPE_MOB_APPEARANCE = 43;
|
public const TYPE_WITCH_SPELL = 43;
|
||||||
public const TYPE_END_ROD = 44;
|
public const TYPE_CARROT = 44;
|
||||||
public const TYPE_DRAGONS_BREATH = 45;
|
public const TYPE_MOB_APPEARANCE = 45;
|
||||||
public const TYPE_SPIT = 46;
|
public const TYPE_END_ROD = 46;
|
||||||
public const TYPE_TOTEM = 47;
|
public const TYPE_DRAGONS_BREATH = 47;
|
||||||
public const TYPE_FOOD = 48;
|
public const TYPE_SPIT = 48;
|
||||||
public const TYPE_FIREWORKS_STARTER = 49;
|
public const TYPE_TOTEM = 49;
|
||||||
public const TYPE_FIREWORKS_SPARK = 50;
|
public const TYPE_FOOD = 50;
|
||||||
public const TYPE_FIREWORKS_OVERLAY = 51;
|
public const TYPE_FIREWORKS_STARTER = 51;
|
||||||
public const TYPE_BALLOON_GAS = 52;
|
public const TYPE_FIREWORKS_SPARK = 52;
|
||||||
public const TYPE_COLORED_FLAME = 53;
|
public const TYPE_FIREWORKS_OVERLAY = 53;
|
||||||
public const TYPE_SPARKLER = 54;
|
public const TYPE_BALLOON_GAS = 54;
|
||||||
public const TYPE_CONDUIT = 55;
|
public const TYPE_COLORED_FLAME = 55;
|
||||||
public const TYPE_BUBBLE_COLUMN_UP = 56;
|
public const TYPE_SPARKLER = 56;
|
||||||
public const TYPE_BUBBLE_COLUMN_DOWN = 57;
|
public const TYPE_CONDUIT = 57;
|
||||||
public const TYPE_SNEEZE = 58;
|
public const TYPE_BUBBLE_COLUMN_UP = 58;
|
||||||
public const TYPE_SHULKER_BULLET = 59;
|
public const TYPE_BUBBLE_COLUMN_DOWN = 59;
|
||||||
public const TYPE_BLEACH = 60;
|
public const TYPE_SNEEZE = 60;
|
||||||
public const TYPE_DRAGON_DESTROY_BLOCK = 61;
|
public const TYPE_SHULKER_BULLET = 61;
|
||||||
public const TYPE_MYCELIUM_DUST = 62;
|
public const TYPE_BLEACH = 62;
|
||||||
public const TYPE_FALLING_RED_DUST = 63;
|
public const TYPE_DRAGON_DESTROY_BLOCK = 63;
|
||||||
public const TYPE_CAMPFIRE_SMOKE = 64;
|
public const TYPE_MYCELIUM_DUST = 64;
|
||||||
public const TYPE_TALL_CAMPFIRE_SMOKE = 65;
|
public const TYPE_FALLING_RED_DUST = 65;
|
||||||
public const TYPE_DRAGON_BREATH_FIRE = 66;
|
public const TYPE_CAMPFIRE_SMOKE = 66;
|
||||||
public const TYPE_DRAGON_BREATH_TRAIL = 67;
|
public const TYPE_TALL_CAMPFIRE_SMOKE = 67;
|
||||||
|
public const TYPE_DRAGON_BREATH_FIRE = 68;
|
||||||
|
public const TYPE_DRAGON_BREATH_TRAIL = 69;
|
||||||
|
public const TYPE_BLUE_FLAME = 70;
|
||||||
|
public const TYPE_SOUL = 71;
|
||||||
|
public const TYPE_OBSIDIAN_TEAR = 72;
|
||||||
|
public const TYPE_PORTAL_REVERSE = 73;
|
||||||
|
public const TYPE_SNOWFLAKE = 74;
|
||||||
|
public const TYPE_VIBRATION_SIGNAL = 75;
|
||||||
|
public const TYPE_SCULK_SENSOR_REDSTONE = 76;
|
||||||
|
public const TYPE_SPORE_BLOSSOM_SHOWER = 77;
|
||||||
|
public const TYPE_SPORE_BLOSSOM_AMBIENT = 78;
|
||||||
|
public const TYPE_WAX = 79;
|
||||||
|
public const TYPE_ELECTRIC_SPARK = 80;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return DataPacket|DataPacket[]
|
* @return DataPacket|DataPacket[]
|
||||||
|
@ -260,6 +260,11 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
if($netId === ItemTypeDictionary::getInstance()->fromStringId("minecraft:shield")){
|
if($netId === ItemTypeDictionary::getInstance()->fromStringId("minecraft:shield")){
|
||||||
$extraData->getLLong(); //"blocking tick" (ffs mojang)
|
$extraData->getLLong(); //"blocking tick" (ffs mojang)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$extraData->feof()){
|
||||||
|
throw new \UnexpectedValueException("Unexpected trailing extradata for network item $netId");
|
||||||
|
}
|
||||||
|
|
||||||
if($nbt !== null){
|
if($nbt !== null){
|
||||||
if($nbt->hasTag(self::DAMAGE_TAG, IntTag::class)){
|
if($nbt->hasTag(self::DAMAGE_TAG, IntTag::class)){
|
||||||
$meta = $nbt->getInt(self::DAMAGE_TAG);
|
$meta = $nbt->getInt(self::DAMAGE_TAG);
|
||||||
@ -305,8 +310,15 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
|
|
||||||
$writeExtraCrapInTheMiddle($this);
|
$writeExtraCrapInTheMiddle($this);
|
||||||
|
|
||||||
$block = $item->getBlock();
|
$blockRuntimeId = 0;
|
||||||
$this->putVarInt($block->getId() === BlockIds::AIR ? 0 : RuntimeBlockMapping::toStaticRuntimeId($block->getId(), $block->getDamage()));
|
$isBlockItem = $item->getId() < 256;
|
||||||
|
if($isBlockItem){
|
||||||
|
$block = $item->getBlock();
|
||||||
|
if($block->getId() !== BlockIds::AIR){
|
||||||
|
$blockRuntimeId = RuntimeBlockMapping::toStaticRuntimeId($block->getId(), $block->getDamage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->putVarInt($blockRuntimeId);
|
||||||
|
|
||||||
$nbt = null;
|
$nbt = null;
|
||||||
if($item->hasCompoundTag()){
|
if($item->hasCompoundTag()){
|
||||||
@ -323,7 +335,7 @@ class NetworkBinaryStream extends BinaryStream{
|
|||||||
$nbt = new CompoundTag();
|
$nbt = new CompoundTag();
|
||||||
}
|
}
|
||||||
$nbt->setInt(self::DAMAGE_TAG, $coreData);
|
$nbt->setInt(self::DAMAGE_TAG, $coreData);
|
||||||
}elseif($block->getId() !== BlockIds::AIR && $coreData !== 0){
|
}elseif($isBlockItem && $coreData !== 0){
|
||||||
//TODO HACK: This foul-smelling code ensures that we can correctly deserialize an item when the
|
//TODO HACK: This foul-smelling code ensures that we can correctly deserialize an item when the
|
||||||
//client sends it back to us, because as of 1.16.220, blockitems quietly discard their metadata
|
//client sends it back to us, because as of 1.16.220, blockitems quietly discard their metadata
|
||||||
//client-side. Aside from being very annoying, this also breaks various server-side behaviours.
|
//client-side. Aside from being very annoying, this also breaks various server-side behaviours.
|
||||||
|
@ -31,24 +31,24 @@ class AddEntityPacket extends DataPacket/* implements ClientboundPacket*/{
|
|||||||
public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET;
|
public const NETWORK_ID = ProtocolInfo::ADD_ENTITY_PACKET;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $uvarint1;
|
private $entityNetId;
|
||||||
|
|
||||||
public static function create(int $uvarint1) : self{
|
public static function create(int $entityNetId) : self{
|
||||||
$result = new self;
|
$result = new self;
|
||||||
$result->uvarint1 = $uvarint1;
|
$result->entityNetId = $entityNetId;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUvarint1() : int{
|
public function getEntityNetId() : int{
|
||||||
return $this->uvarint1;
|
return $this->entityNetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function decodePayload() : void{
|
protected function decodePayload() : void{
|
||||||
$this->uvarint1 = $this->getUnsignedVarInt();
|
$this->entityNetId = $this->getUnsignedVarInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function encodePayload() : void{
|
protected function encodePayload() : void{
|
||||||
$this->putUnsignedVarInt($this->uvarint1);
|
$this->putUnsignedVarInt($this->entityNetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(NetworkSession $handler) : bool{
|
public function handle(NetworkSession $handler) : bool{
|
||||||
|
@ -276,7 +276,7 @@ class CraftingDataPacket extends DataPacket{
|
|||||||
$writer = new NetworkBinaryStream();
|
$writer = new NetworkBinaryStream();
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
foreach($this->entries as $d){
|
foreach($this->entries as $d){
|
||||||
$entryType = self::writeEntry($d, $writer, $counter++);
|
$entryType = self::writeEntry($d, $writer, ++$counter);
|
||||||
if($entryType >= 0){
|
if($entryType >= 0){
|
||||||
$this->putVarInt($entryType);
|
$this->putVarInt($entryType);
|
||||||
$this->put($writer->getBuffer());
|
$this->put($writer->getBuffer());
|
||||||
|
@ -31,24 +31,24 @@ class RemoveEntityPacket extends DataPacket/* implements ClientboundPacket*/{
|
|||||||
public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET;
|
public const NETWORK_ID = ProtocolInfo::REMOVE_ENTITY_PACKET;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $uvarint1;
|
private $entityNetId;
|
||||||
|
|
||||||
public static function create(int $uvarint1) : self{
|
public static function create(int $entityNetId) : self{
|
||||||
$result = new self;
|
$result = new self;
|
||||||
$result->uvarint1 = $uvarint1;
|
$result->entityNetId = $entityNetId;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUvarint1() : int{
|
public function getEntityNetId() : int{
|
||||||
return $this->uvarint1;
|
return $this->entityNetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function decodePayload() : void{
|
protected function decodePayload() : void{
|
||||||
$this->uvarint1 = $this->getUnsignedVarInt();
|
$this->entityNetId = $this->getUnsignedVarInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function encodePayload() : void{
|
protected function encodePayload() : void{
|
||||||
$this->putUnsignedVarInt($this->uvarint1);
|
$this->putUnsignedVarInt($this->entityNetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(NetworkSession $handler) : bool{
|
public function handle(NetworkSession $handler) : bool{
|
||||||
|
@ -30,6 +30,13 @@ use pocketmine\network\mcpe\NetworkSession;
|
|||||||
class SetDisplayObjectivePacket extends DataPacket{
|
class SetDisplayObjectivePacket extends DataPacket{
|
||||||
public const NETWORK_ID = ProtocolInfo::SET_DISPLAY_OBJECTIVE_PACKET;
|
public const NETWORK_ID = ProtocolInfo::SET_DISPLAY_OBJECTIVE_PACKET;
|
||||||
|
|
||||||
|
public const DISPLAY_SLOT_LIST = "list";
|
||||||
|
public const DISPLAY_SLOT_SIDEBAR = "sidebar";
|
||||||
|
public const DISPLAY_SLOT_BELOW_NAME = "belowname";
|
||||||
|
|
||||||
|
public const SORT_ORDER_ASCENDING = 0;
|
||||||
|
public const SORT_ORDER_DESCENDING = 1;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $displaySlot;
|
public $displaySlot;
|
||||||
/** @var string */
|
/** @var string */
|
||||||
|
@ -31,6 +31,7 @@ use pocketmine\network\mcpe\protocol\types\NetworkInventoryAction;
|
|||||||
class UseItemOnEntityTransactionData extends TransactionData{
|
class UseItemOnEntityTransactionData extends TransactionData{
|
||||||
public const ACTION_INTERACT = 0;
|
public const ACTION_INTERACT = 0;
|
||||||
public const ACTION_ATTACK = 1;
|
public const ACTION_ATTACK = 1;
|
||||||
|
public const ACTION_ITEM_INTERACT = 2;
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $entityRuntimeId;
|
private $entityRuntimeId;
|
||||||
|
@ -177,7 +177,7 @@ class TaskScheduler{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$task->run($this->currentTick);
|
$task->run($this->currentTick);
|
||||||
if($task->isRepeating()){
|
if(!$task->isCancelled() && $task->isRepeating()){
|
||||||
$task->setNextRun($this->currentTick + $task->getPeriod());
|
$task->setNextRun($this->currentTick + $task->getPeriod());
|
||||||
$this->queue->insert($task, $this->currentTick + $task->getPeriod());
|
$this->queue->insert($task, $this->currentTick + $task->getPeriod());
|
||||||
}else{
|
}else{
|
||||||
|
@ -52,6 +52,9 @@ class Sign extends Spawnable{
|
|||||||
/** @var string[] */
|
/** @var string[] */
|
||||||
protected $text = ["", "", "", ""];
|
protected $text = ["", "", "", ""];
|
||||||
|
|
||||||
|
/** @var int|null */
|
||||||
|
protected $editorEntityRuntimeId = null;
|
||||||
|
|
||||||
protected function readSaveData(CompoundTag $nbt) : void{
|
protected function readSaveData(CompoundTag $nbt) : void{
|
||||||
if($nbt->hasTag(self::TAG_TEXT_BLOB, StringTag::class)){ //MCPE 1.2 save format
|
if($nbt->hasTag(self::TAG_TEXT_BLOB, StringTag::class)){ //MCPE 1.2 save format
|
||||||
$this->text = self::fixTextBlob($nbt->getString(self::TAG_TEXT_BLOB));
|
$this->text = self::fixTextBlob($nbt->getString(self::TAG_TEXT_BLOB));
|
||||||
@ -132,6 +135,22 @@ class Sign extends Spawnable{
|
|||||||
return $this->text;
|
return $this->text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the entity runtime ID of the player who placed this sign. Only the player whose entity ID matches this
|
||||||
|
* one may edit the sign text.
|
||||||
|
* This is needed because as of 1.16.220, there is still no reliable way to detect when the MCPE client closed the
|
||||||
|
* sign edit GUI, so we have no way to know when the text is finalized. This limits editing of the text to only the
|
||||||
|
* player who placed it, and only while that player is online.
|
||||||
|
* We can say for sure that the sign is finalized if either of the following occurs:
|
||||||
|
* - The player quits (after rejoin, the player's entity runtimeID will be different).
|
||||||
|
* - The chunk is unloaded (on next load, the entity runtimeID will be null, because it's not saved).
|
||||||
|
*/
|
||||||
|
public function getEditorEntityRuntimeId() : ?int{ return $this->editorEntityRuntimeId; }
|
||||||
|
|
||||||
|
public function setEditorEntityRuntimeId(?int $editorEntityRuntimeId) : void{
|
||||||
|
$this->editorEntityRuntimeId = $editorEntityRuntimeId;
|
||||||
|
}
|
||||||
|
|
||||||
protected function addAdditionalSpawnData(CompoundTag $nbt) : void{
|
protected function addAdditionalSpawnData(CompoundTag $nbt) : void{
|
||||||
$nbt->setString(self::TAG_TEXT_BLOB, implode("\n", $this->text));
|
$nbt->setString(self::TAG_TEXT_BLOB, implode("\n", $this->text));
|
||||||
}
|
}
|
||||||
@ -158,6 +177,9 @@ class Sign extends Spawnable{
|
|||||||
$removeFormat = $player->getRemoveFormat();
|
$removeFormat = $player->getRemoveFormat();
|
||||||
|
|
||||||
$ev = new SignChangeEvent($this->getBlock(), $player, array_map(function(string $line) use ($removeFormat) : string{ return TextFormat::clean($line, $removeFormat); }, $lines));
|
$ev = new SignChangeEvent($this->getBlock(), $player, array_map(function(string $line) use ($removeFormat) : string{ return TextFormat::clean($line, $removeFormat); }, $lines));
|
||||||
|
if($this->editorEntityRuntimeId === null || $this->editorEntityRuntimeId !== $player->getId()){
|
||||||
|
$ev->setCancelled();
|
||||||
|
}
|
||||||
$ev->call();
|
$ev->call();
|
||||||
|
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
|
@ -23,4 +23,3 @@ cd php-build
|
|||||||
echo '"pthreads",,"https://github.com/pmmp/pthreads.git",,,"extension",' >> share/php-build/extension/definition
|
echo '"pthreads",,"https://github.com/pmmp/pthreads.git",,,"extension",' >> share/php-build/extension/definition
|
||||||
PHP_BUILD_INSTALL_EXTENSION='pthreads=@acc6e52b2144c61c434b62a3cb680d537e06828e yaml=2.2.1' PHP_BUILD_ZTS_ENABLE=on ./bin/php-build "$VERSION" "$INSTALL_DIR" || exit 1
|
PHP_BUILD_INSTALL_EXTENSION='pthreads=@acc6e52b2144c61c434b62a3cb680d537e06828e yaml=2.2.1' PHP_BUILD_ZTS_ENABLE=on ./bin/php-build "$VERSION" "$INSTALL_DIR" || exit 1
|
||||||
rm "$INSTALL_DIR/etc/conf.d/xdebug.ini" || true
|
rm "$INSTALL_DIR/etc/conf.d/xdebug.ini" || true
|
||||||
cp install-dependencies.sh "$INSTALL_DIR"
|
|
||||||
|
3
tests/gh-actions/install-dependencies.sh
Executable file
3
tests/gh-actions/install-dependencies.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
sudo apt update && sudo apt install -y \
|
||||||
|
libzip5
|
@ -1605,6 +1605,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: ../../../src/pocketmine/utils/Utils.php
|
path: ../../../src/pocketmine/utils/Utils.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$enchantment of class pocketmine\\\\item\\\\enchantment\\\\EnchantmentInstance constructor expects pocketmine\\\\item\\\\enchantment\\\\Enchantment, pocketmine\\\\item\\\\enchantment\\\\Enchantment\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../../phpunit/item/ItemTest.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Cannot call method cancel\\(\\) on pocketmine\\\\scheduler\\\\TaskHandler\\|null\\.$#"
|
message: "#^Cannot call method cancel\\(\\) on pocketmine\\\\scheduler\\\\TaskHandler\\|null\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@ -25,12 +25,15 @@ namespace pocketmine\item;
|
|||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use pocketmine\block\BlockFactory;
|
use pocketmine\block\BlockFactory;
|
||||||
|
use pocketmine\item\enchantment\Enchantment;
|
||||||
|
use pocketmine\item\enchantment\EnchantmentInstance;
|
||||||
|
|
||||||
class ItemTest extends TestCase{
|
class ItemTest extends TestCase{
|
||||||
|
|
||||||
public function setUp() : void{
|
public function setUp() : void{
|
||||||
BlockFactory::init();
|
BlockFactory::init();
|
||||||
ItemFactory::init();
|
ItemFactory::init();
|
||||||
|
Enchantment::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,6 +64,16 @@ class ItemTest extends TestCase{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests that when all enchantments are removed from an item, the "ench" tag is removed as well
|
||||||
|
*/
|
||||||
|
public function testEnchantmentRemoval() : void{
|
||||||
|
$item = ItemFactory::get(Item::DIAMOND_SWORD);
|
||||||
|
$item->addEnchantment(new EnchantmentInstance(Enchantment::getEnchantment(Enchantment::SHARPNESS)));
|
||||||
|
$item->removeEnchantment(Enchantment::SHARPNESS);
|
||||||
|
self::assertNull($item->getNamedTag()->getTag(Item::TAG_ENCH));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed[][]
|
* @return mixed[][]
|
||||||
* @phpstan-return list<array{string,int,int}>
|
* @phpstan-return list<array{string,int,int}>
|
||||||
|
Reference in New Issue
Block a user