mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-10 19:48:13 +00:00
Compare commits
195 Commits
dependabot
...
block-laye
Author | SHA1 | Date | |
---|---|---|---|
a0f5ad1669 | |||
0f932f7cc0 | |||
f01d87474d | |||
7472c5b73d | |||
941632bed9 | |||
e5a38f270c | |||
7c651928ea | |||
48cc87d066 | |||
72781f4042 | |||
30d13508b4 | |||
ba2a7cceaf | |||
98f0417611 | |||
8005c74681 | |||
afcd6b4e12 | |||
68126b308a | |||
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 |
33
.github/workflows/build-docker-image.yml
vendored
33
.github/workflows/build-docker-image.yml
vendored
@ -4,11 +4,6 @@ on:
|
|||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
release:
|
|
||||||
description: 'Tag name to build'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -33,28 +28,16 @@ jobs:
|
|||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Clone pmmp/PocketMine-Docker repository
|
- name: Clone pmmp/PocketMine-Docker repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: pmmp/PocketMine-Docker
|
repository: pmmp/PocketMine-Docker
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Get tag names
|
||||||
- name: Get tag name
|
|
||||||
id: tag-name
|
id: tag-name
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
VERSION=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{')
|
||||||
echo TAG_NAME="${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
|
echo TAG_NAME=$VERSION >> $GITHUB_OUTPUT
|
||||||
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
||||||
echo TAG_NAME="${{ github.event.inputs.release }}" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Unsupported event type: ${{ github.event_name }}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Parse version
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.tag-name.outputs.TAG_NAME }}"
|
|
||||||
echo MAJOR=$(echo $VERSION | cut -d. -f1) >> $GITHUB_OUTPUT
|
echo MAJOR=$(echo $VERSION | cut -d. -f1) >> $GITHUB_OUTPUT
|
||||||
echo MINOR=$(echo $VERSION | cut -d. -f1-2) >> $GITHUB_OUTPUT
|
echo MINOR=$(echo $VERSION | cut -d. -f1-2) >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
@ -88,8 +71,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
context: ./pocketmine-mp
|
context: ./pocketmine-mp
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.version.outputs.MAJOR }}
|
${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MAJOR }}
|
||||||
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.version.outputs.MAJOR }}
|
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MAJOR }}
|
||||||
build-args: |
|
build-args: |
|
||||||
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
|
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
|
||||||
PMMP_REPO=${{ github.repository }}
|
PMMP_REPO=${{ github.repository }}
|
||||||
@ -101,8 +84,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
context: ./pocketmine-mp
|
context: ./pocketmine-mp
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.version.outputs.MINOR }}
|
${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MINOR }}
|
||||||
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.version.outputs.MINOR }}
|
ghcr.io/${{ steps.docker-repo-name.outputs.NAME }}:${{ steps.tag-name.outputs.MINOR }}
|
||||||
build-args: |
|
build-args: |
|
||||||
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
|
PMMP_TAG=${{ steps.tag-name.outputs.TAG_NAME }}
|
||||||
PMMP_REPO=${{ github.repository }}
|
PMMP_REPO=${{ github.repository }}
|
||||||
|
4
.github/workflows/copilot-setup-steps.yml
vendored
4
.github/workflows/copilot-setup-steps.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@3.2.0
|
uses: pmmp/setup-php-action@3.2.0
|
||||||
@ -41,7 +41,7 @@ jobs:
|
|||||||
run: composer install --prefer-dist --no-interaction
|
run: composer install --prefer-dist --no-interaction
|
||||||
|
|
||||||
- name: Clone extension stubs
|
- name: Clone extension stubs
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: pmmp/phpstorm-stubs
|
repository: pmmp/phpstorm-stubs
|
||||||
path: extension-stubs
|
path: extension-stubs
|
||||||
|
23
.github/workflows/discord-release-notify.yml
vendored
23
.github/workflows/discord-release-notify.yml
vendored
@ -4,23 +4,18 @@ on:
|
|||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
release:
|
|
||||||
description: 'Release to make notification for'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP and tools
|
- name: Setup PHP and tools
|
||||||
uses: shivammathur/setup-php@2.35.4
|
uses: shivammathur/setup-php@2.33.0
|
||||||
with:
|
with:
|
||||||
php-version: 8.2
|
php-version: 8.3
|
||||||
|
|
||||||
- name: Restore Composer package cache
|
- name: Restore Composer package cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -35,17 +30,9 @@ jobs:
|
|||||||
- name: Install Composer dependencies
|
- name: Install Composer dependencies
|
||||||
run: composer install --no-dev --prefer-dist --no-interaction --ignore-platform-reqs
|
run: composer install --no-dev --prefer-dist --no-interaction --ignore-platform-reqs
|
||||||
|
|
||||||
- name: Get tag name
|
- name: Get actual tag name
|
||||||
id: tag-name
|
id: tag-name
|
||||||
run: |
|
run: echo TAG_NAME=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') >> $GITHUB_OUTPUT
|
||||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
|
||||||
echo TAG_NAME="${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
|
|
||||||
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
||||||
echo TAG_NAME="${{ github.event.inputs.release }}" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Unsupported event type: ${{ github.event_name }}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Run webhook post script
|
- name: Run webhook post script
|
||||||
run: php .github/workflows/discord-release-embed.php ${{ github.repository }} ${{ steps.tag-name.outputs.TAG_NAME }} ${{ github.token }} ${{ secrets.DISCORD_RELEASE_WEBHOOK }} ${{ secrets.DISCORD_NEWS_PING_ROLE_ID }}
|
run: php .github/workflows/discord-release-embed.php ${{ github.repository }} ${{ steps.tag-name.outputs.TAG_NAME }} ${{ github.token }} ${{ secrets.DISCORD_RELEASE_WEBHOOK }} ${{ secrets.DISCORD_NEWS_PING_ROLE_ID }}
|
||||||
|
8
.github/workflows/draft-release-pr-check.yml
vendored
8
.github/workflows/draft-release-pr-check.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
valid: ${{ steps.validate.outputs.DEV_BUILD == 'false' }}
|
valid: ${{ steps.validate.outputs.DEV_BUILD == 'false' }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check IS_DEVELOPMENT_BUILD flag
|
- name: Check IS_DEVELOPMENT_BUILD flag
|
||||||
id: validate
|
id: validate
|
||||||
@ -46,12 +46,12 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@2.35.4
|
uses: shivammathur/setup-php@2.33.0
|
||||||
with:
|
with:
|
||||||
php-version: 8.2
|
php-version: 8.3
|
||||||
|
|
||||||
- name: Restore Composer package cache
|
- name: Restore Composer package cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
8
.github/workflows/draft-release.yml
vendored
8
.github/workflows/draft-release.yml
vendored
@ -18,7 +18,7 @@ on:
|
|||||||
- "*"
|
- "*"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PHP_VERSION: "8.2"
|
PHP_VERSION: "8.3"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
skip:
|
skip:
|
||||||
@ -82,12 +82,12 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@2.35.4
|
uses: shivammathur/setup-php@2.33.0
|
||||||
with:
|
with:
|
||||||
php-version: ${{ env.PHP_VERSION }}
|
php-version: ${{ env.PHP_VERSION }}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ jobs:
|
|||||||
${{ github.workspace }}/core-permissions.rst
|
${{ github.workspace }}/core-permissions.rst
|
||||||
|
|
||||||
- name: Create draft release
|
- name: Create draft release
|
||||||
uses: ncipollo/release-action@v1.18.0
|
uses: ncipollo/release-action@v1.16.0
|
||||||
id: create-draft
|
id: create-draft
|
||||||
with:
|
with:
|
||||||
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json,${{ github.workspace }}/core-permissions.rst
|
artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json,${{ github.workspace }}/core-permissions.rst
|
||||||
|
8
.github/workflows/main-php-matrix.yml
vendored
8
.github/workflows/main-php-matrix.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@3.2.0
|
uses: pmmp/setup-php-action@3.2.0
|
||||||
@ -59,7 +59,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@3.2.0
|
uses: pmmp/setup-php-action@3.2.0
|
||||||
@ -91,7 +91,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: pmmp/setup-php-action@3.2.0
|
uses: pmmp/setup-php-action@3.2.0
|
||||||
|
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
php: ["8.1", "8.2", "8.3", "8.4"]
|
php: ["8.3"]
|
||||||
|
|
||||||
uses: ./.github/workflows/main-php-matrix.yml
|
uses: ./.github/workflows/main-php-matrix.yml
|
||||||
with:
|
with:
|
||||||
@ -25,10 +25,10 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP and tools
|
- name: Setup PHP and tools
|
||||||
uses: shivammathur/setup-php@2.35.4
|
uses: shivammathur/setup-php@2.33.0
|
||||||
with:
|
with:
|
||||||
php-version: 8.3
|
php-version: 8.3
|
||||||
tools: php-cs-fixer:3.75
|
tools: php-cs-fixer:3.75
|
||||||
@ -45,7 +45,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@2.0.0
|
uses: ludeeus/action-shellcheck@2.0.0
|
||||||
|
19
.github/workflows/update-updater-api.yml
vendored
19
.github/workflows/update-updater-api.yml
vendored
@ -4,11 +4,6 @@ on:
|
|||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
release:
|
|
||||||
description: 'Release to publish info for'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -19,22 +14,14 @@ jobs:
|
|||||||
- name: Install jq
|
- name: Install jq
|
||||||
run: sudo apt update && sudo apt install jq -y
|
run: sudo apt update && sudo apt install jq -y
|
||||||
|
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: ${{ github.repository_owner }}/update.pmmp.io
|
repository: ${{ github.repository_owner }}/update.pmmp.io
|
||||||
ssh-key: ${{ secrets.UPDATE_PMMP_IO_DEPLOY_KEY }}
|
ssh-key: ${{ secrets.UPDATE_PMMP_IO_DEPLOY_KEY }}
|
||||||
|
|
||||||
- name: Get tag name
|
- name: Get actual tag name
|
||||||
id: tag-name
|
id: tag-name
|
||||||
run: |
|
run: echo TAG_NAME=$(echo "${{ github.ref }}" | sed 's{^refs/tags/{{') >> $GITHUB_OUTPUT
|
||||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
|
||||||
echo TAG_NAME="${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
|
|
||||||
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
||||||
echo TAG_NAME="${{ github.event.inputs.release }}" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "Unsupported event type: ${{ github.event_name }}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Download new release information
|
- name: Download new release information
|
||||||
run: curl -f -L ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.tag-name.outputs.TAG_NAME }}/build_info.json -o new_build_info.json
|
run: curl -f -L ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.tag-name.outputs.TAG_NAME }}/build_info.json -o new_build_info.json
|
||||||
|
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"]
|
[submodule "build/php"]
|
||||||
path = build/php
|
path = build/php
|
||||||
url = https://github.com/pmmp/php-build-scripts.git
|
url = https://github.com/pmmp/php-build-scripts.git
|
||||||
|
@ -5,7 +5,7 @@ $finder = PhpCsFixer\Finder::create()
|
|||||||
->in(__DIR__ . '/build')
|
->in(__DIR__ . '/build')
|
||||||
->in(__DIR__ . '/tests')
|
->in(__DIR__ . '/tests')
|
||||||
->in(__DIR__ . '/tools')
|
->in(__DIR__ . '/tools')
|
||||||
->notPath('plugins/DevTools')
|
|
||||||
//JsonMapper will break if the FQNs in the doc comments for these are shortened :(
|
//JsonMapper will break if the FQNs in the doc comments for these are shortened :(
|
||||||
->notPath('crafting/json')
|
->notPath('crafting/json')
|
||||||
->notPath('inventory/json')
|
->notPath('inventory/json')
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<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://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>
|
<a href="https://discord.gg/bmSAZBG"><img src="https://img.shields.io/discord/373199722573201408?label=discord&color=7289DA&logo=discord" alt="Discord" /></a>
|
||||||
<br>
|
<br>
|
||||||
|
Submodule build/php updated: 1d9cda6688...ce1b095a9c
@ -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,25 +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.32.1
|
|
||||||
Released 14th August 2025.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
- Hardened checks when processing resource pack sending during player logins.
|
|
||||||
- Fixed content log warning about crafting recipe with missing ID.
|
|
||||||
- Fixed packets in a batch still being processed after one of them caused the session to be terminated.
|
|
@ -1,135 +0,0 @@
|
|||||||
# 5.33.0
|
|
||||||
Released 30th August 2025.
|
|
||||||
|
|
||||||
This is a minor feature release containing internals improvements, API improvements and new gameplay features.
|
|
||||||
|
|
||||||
**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.
|
|
||||||
|
|
||||||
## Performance
|
|
||||||
- Worlds now remember when a chunk isn't generated. This reduces world I/O during world generation.
|
|
||||||
- `BlockObjectToStateSerializer` now creates fewer objects in certain cases.
|
|
||||||
|
|
||||||
## Gameplay
|
|
||||||
- The following blocks have been added and/or are now properly supported:
|
|
||||||
- Hanging signs
|
|
||||||
- Illager banners
|
|
||||||
|
|
||||||
## Tools
|
|
||||||
- `generate-bedrock-data-from-packets.php` now represents items as strings directly when only an ID is present. This significantly improves readability in `BedrockData` and reduces file sizes.
|
|
||||||
|
|
||||||
## API
|
|
||||||
### `pocketmine\block`
|
|
||||||
- Added (and implemented) interfaces for many common block properties, to allow `instanceof` to be used:
|
|
||||||
- `Ageable`: for blocks with age, such as crops
|
|
||||||
- `AnyFacing`: for blocks which can face up, down, and horizontal directions (not the same as `HorizontalFacing`!)
|
|
||||||
- `Colored`: for blocks with 16 `DyeColor` variants
|
|
||||||
- `CoralMaterial`: for coral blocks, provides access to coral type and dead/alive
|
|
||||||
- `HorizontalFacing`: for blocks which can **only** face horizontal directions (not the same as `AnyFacing`!)
|
|
||||||
- `Lightable`: for light-source blocks which can be turned on and off, e.g. redstone lamp
|
|
||||||
- `MultiAnyFacing`: for blocks which can appear in multiple faces of the same block (including up, down, and horizontal faces), e.g. glow lichen
|
|
||||||
- `PillarRotation`: for blocks which can be oriented on an axis, e.g. logs
|
|
||||||
- `PoweredByRedstone`: for blocks which receive power from a redstone component, e.g. redstone lamp
|
|
||||||
- `SignLikeRotation`: for blocks which can be rotated 16 ways, e.g. signs, banners
|
|
||||||
- `WoodMaterial`: for blocks made from wood
|
|
||||||
- These interfaces have been implemented on many blocks. For the sake of brevity, they are not listed here, but you can expect to see them wherever the corresponding traits were used.
|
|
||||||
- The following classes have been added:
|
|
||||||
- `BaseOminousBanner`
|
|
||||||
- `CeilingCenterHangingSign` - both chains connected to the same point on the block above, can face 16 directions
|
|
||||||
- `CeilingEdgesHangingSign` - each chain connected to separate edges of the block above, can face 4 directions
|
|
||||||
- `OminousFloorBanner` - floor version of illager banner, can face 16 directions
|
|
||||||
- `OminousWallBanner` - wall version of illager banner, can face 4 directions
|
|
||||||
- `WallHangingSign` - hangs from a horizontal beam, can face 4 directions
|
|
||||||
- The following API methods have been added:
|
|
||||||
- `public ChiseledBookshelf->setSlots(list<ChiseledBookshelfSlot> $slots) : $this`
|
|
||||||
- `public static VanillaBlocks` methods:
|
|
||||||
- `ACACIA_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `ACACIA_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `ACACIA_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `BIRCH_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `BIRCH_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `BIRCH_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `CHERRY_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `CHERRY_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `CHERRY_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `CRIMSON_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `CRIMSON_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `CRIMSON_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `DARK_OAK_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `DARK_OAK_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `DARK_OAK_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `JUNGLE_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `JUNGLE_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `JUNGLE_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `MANGROVE_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `MANGROVE_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `MANGROVE_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `OAK_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `OAK_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `OAK_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `OMINOUS_FLOOR_BANNER() : OminousFloorBanner`
|
|
||||||
- `OMINOUS_WALL_BANNER() : OminousWallBanner`
|
|
||||||
- `PALE_OAK_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `PALE_OAK_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `PALE_OAK_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `SPRUCE_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `SPRUCE_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `SPRUCE_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `WARPED_CEILING_CENTER_HANGING_SIGN() : CeilingCenterHangingSign`
|
|
||||||
- `WARPED_CEILING_EDGES_HANGING_SIGN() : CeilingEdgesHangingSign`
|
|
||||||
- `WARPED_WALL_HANGING_SIGN() : WallHangingSign`
|
|
||||||
- `public AgeableTrait->getMaxAge() : int` (included by all growable plant-like blocks, e.g. crops)
|
|
||||||
|
|
||||||
### `pocketmine\data\bedrock\block\convert`
|
|
||||||
- A new system for symmetric block serializers and deserializers has been introduced.
|
|
||||||
- This allows registering both a serializer and a deserializer with the same code, meaning way less code
|
|
||||||
- It also eliminates information duplication and potential inconsistencies, improving maintainability.
|
|
||||||
- A proper way to deal with flattened IDs (e.g. color blocks) has been introduced which _doesn't_ require hardcoding a giant mess of IDs
|
|
||||||
- This symmetric system covers 99% of blocks which have a 1:1 association between PM and vanilla blocks, or 1:N where IDs are flattened
|
|
||||||
- However, there are still some special cases which require registering separate serializers and deserializers (usually in cases where the PM implementation deviates from Mojang where Mojang's implementation sucks, such as hanging signs or big dripleaf).
|
|
||||||
- No backwards compatibility breaks are expected as a result of this change. However, it's recommended to migrate old code to this new system for maintainability.
|
|
||||||
- The following new classes have been added:
|
|
||||||
- `BlockSerializerDeserializerRegistrar` - handles unified registration of block serializers and deserializers, based on a provided block model
|
|
||||||
- `FlattenedIdModel` - represents a block with some properties baked into its Minecraft ID, e.g. coral or color blocks
|
|
||||||
- `Model` - represents a regular block with all properties in its `states` NBT
|
|
||||||
- `property\BoolFromStringProperty<TBlock>` - property mapping a bool value from a string NBT state
|
|
||||||
- `property\BoolProperty<TBlock>`
|
|
||||||
- `property\CommonProperties` - singleton containing commonly-used block property definitions and groups, e.g. facing, stair properties
|
|
||||||
- `property\EnumFromRawStateMap<TEnum, TRaw>` - maps a raw NBT value to a PHP `enum` and vice versa
|
|
||||||
- `property\IntFromRawStateMap<TRaw>` - maps a raw NBT value to PM integer constants and vice versa
|
|
||||||
- `property\IntProperty<TBlock>` - an integer range property with a min, max, and optional offset
|
|
||||||
- `property\Property<TBlock>` - interface implemented by all property definitions accepted by a `Model` or `FlattenedIdModel`
|
|
||||||
- `property\StateMap<TValue, TRaw>` - interface implemented by classes accepted by mapping properties, e.g. `BoolFromStringProperty`
|
|
||||||
- `property\StringProperty<TBlock>` - interface implemented by properties whose raw outputs are strings - these can be used as ID components in `FlattenedIdModel`
|
|
||||||
- `property\ValueFromIntProperty<TBlock, TValue>` - property mapping a generic PM value from an int NBT state
|
|
||||||
- `property\ValueFromStringProperty<TBlock, TValue>` - same as above, but for a string NBT state
|
|
||||||
- `property\ValueSetFromIntProperty<TBlock, TOption>` - a property mapping an `int[]` or `enum[]` from a set of flags in NBT states
|
|
||||||
- `property\ValueMappings` - singleton containing commonly-needed `StateMap`s
|
|
||||||
- The following classes have been deprecated:
|
|
||||||
- `BlockStateDeserializerHelper`
|
|
||||||
- `BlockStateSerializerHelper`
|
|
||||||
- The following methods have been deprecated:
|
|
||||||
- All methods for decoding mapped property types in `BlockStateReader`, e.g. `readFacingDirection()`
|
|
||||||
- All methods for encoding mapped property types in `BlockStateWriter`, e.g. `writeFacingDirection()`
|
|
||||||
- All specific blocktype mapping functions in `BlockStateToObjectDeserializer`, e.g. `mapStairs()`
|
|
||||||
- All specific blocktype mapping functions in `BlockObjectToStateSerializer`, e.g. `mapStairs()`
|
|
||||||
|
|
||||||
### `pocketmine\item`
|
|
||||||
- The following hooks have been added:
|
|
||||||
- `public Item->getPlacementTransaction(Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : ?BlockTransaction` - allows more complex logic for itemblocks to place blocks, without duplicating their placement conditions (used for hanging signs)
|
|
||||||
|
|
||||||
### `pocketmine\world`
|
|
||||||
- `World->setChunk()` now verifies that blockstate IDs in the provided chunk are all registered in `RuntimeBlockStateRegistry`. This should provide earlier detection for custom block registration errors by plugins.
|
|
||||||
|
|
||||||
## Internals
|
|
||||||
- `BlockStateUpgrader` is now almost entirely independent from `BlockStateData`. It's anticipated that the upgrader library will be separable from the core in the future.
|
|
||||||
- `Block->readStateFromWorld()` is now triggered on chunk load for any position containing a tile. This should allow more effective updating of blocks with properties in their tiles.
|
|
||||||
|
|
||||||
# 5.33.1
|
|
||||||
Released 31st August 2025.
|
|
||||||
|
|
||||||
## Fixes
|
|
||||||
- Fixed banners placed in prior versions getting their tiles deleted (due to missing `Type` tags).
|
|
@ -5,7 +5,7 @@
|
|||||||
"homepage": "https://pmmp.io",
|
"homepage": "https://pmmp.io",
|
||||||
"license": "LGPL-3.0",
|
"license": "LGPL-3.0",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.3",
|
||||||
"php-64bit": "*",
|
"php-64bit": "*",
|
||||||
"ext-chunkutils2": "^0.3.1",
|
"ext-chunkutils2": "^0.3.1",
|
||||||
"ext-crypto": "^0.3.1",
|
"ext-crypto": "^0.3.1",
|
||||||
@ -34,9 +34,9 @@
|
|||||||
"adhocore/json-comment": "~1.2.0",
|
"adhocore/json-comment": "~1.2.0",
|
||||||
"netresearch/jsonmapper": "~v5.0.0",
|
"netresearch/jsonmapper": "~v5.0.0",
|
||||||
"pocketmine/bedrock-block-upgrade-schema": "~5.1.0+bedrock-1.21.60",
|
"pocketmine/bedrock-block-upgrade-schema": "~5.1.0+bedrock-1.21.60",
|
||||||
"pocketmine/bedrock-data": "~6.0.0+bedrock-1.21.100",
|
"pocketmine/bedrock-data": "~5.1.0+bedrock-1.21.90",
|
||||||
"pocketmine/bedrock-item-upgrade-schema": "~1.15.0+bedrock-1.21.100",
|
"pocketmine/bedrock-item-upgrade-schema": "~1.14.0+bedrock-1.21.50",
|
||||||
"pocketmine/bedrock-protocol": "~40.0.0+bedrock-1.21.100",
|
"pocketmine/bedrock-protocol": "~39.0.0+bedrock-1.21.90",
|
||||||
"pocketmine/binaryutils": "^0.2.1",
|
"pocketmine/binaryutils": "^0.2.1",
|
||||||
"pocketmine/callback-validator": "^1.0.2",
|
"pocketmine/callback-validator": "^1.0.2",
|
||||||
"pocketmine/color": "^0.3.0",
|
"pocketmine/color": "^0.3.0",
|
||||||
@ -48,14 +48,14 @@
|
|||||||
"pocketmine/raklib": "~1.2.0",
|
"pocketmine/raklib": "~1.2.0",
|
||||||
"pocketmine/raklib-ipc": "~1.0.0",
|
"pocketmine/raklib-ipc": "~1.0.0",
|
||||||
"pocketmine/snooze": "^0.5.0",
|
"pocketmine/snooze": "^0.5.0",
|
||||||
"ramsey/uuid": "~4.9.0",
|
"ramsey/uuid": "~4.8.0",
|
||||||
"symfony/filesystem": "~6.4.0"
|
"symfony/filesystem": "~7.3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpstan/phpstan": "2.1.17",
|
"phpstan/phpstan": "2.1.17",
|
||||||
"phpstan/phpstan-phpunit": "^2.0.0",
|
"phpstan/phpstan-phpunit": "^2.0.0",
|
||||||
"phpstan/phpstan-strict-rules": "^2.0.0",
|
"phpstan/phpstan-strict-rules": "^2.0.0",
|
||||||
"phpunit/phpunit": "^10.5.24"
|
"phpunit/phpunit": "^12.2.1"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"symfony/polyfill-ctype": "*",
|
"symfony/polyfill-ctype": "*",
|
||||||
@ -77,12 +77,11 @@
|
|||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "8.1.0"
|
"php": "8.3.0"
|
||||||
},
|
},
|
||||||
"sort-packages": true
|
"sort-packages": true
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"make-devtools": "@php -dphar.readonly=0 tests/plugins/DevTools/src/ConsoleScript.php --make ./ --relative tests/plugins/DevTools --out plugins/DevTools.phar",
|
|
||||||
"make-server": [
|
"make-server": [
|
||||||
"@composer install --no-dev --classmap-authoritative --ignore-platform-reqs",
|
"@composer install --no-dev --classmap-authoritative --ignore-platform-reqs",
|
||||||
"@php -dphar.readonly=0 build/server-phar.php"
|
"@php -dphar.readonly=0 build/server-phar.php"
|
||||||
|
732
composer.lock
generated
732
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -4,17 +4,13 @@ includes:
|
|||||||
- tests/phpstan/configs/impossible-generics.neon
|
- tests/phpstan/configs/impossible-generics.neon
|
||||||
- tests/phpstan/configs/php-bugs.neon
|
- tests/phpstan/configs/php-bugs.neon
|
||||||
- tests/phpstan/configs/phpstan-bugs.neon
|
- tests/phpstan/configs/phpstan-bugs.neon
|
||||||
- tests/phpstan/configs/property-hook-sadness.neon
|
|
||||||
- tests/phpstan/configs/reflection-class-sadness.neon
|
|
||||||
- tests/phpstan/configs/spl-fixed-array-sucks.neon
|
- tests/phpstan/configs/spl-fixed-array-sucks.neon
|
||||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||||
- vendor/phpstan/phpstan-phpunit/rules.neon
|
- vendor/phpstan/phpstan-phpunit/rules.neon
|
||||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
- pocketmine\phpstan\rules\DeprecatedLegacyEnumAccessRule
|
|
||||||
- pocketmine\phpstan\rules\DisallowDynamicNewRule
|
- pocketmine\phpstan\rules\DisallowDynamicNewRule
|
||||||
- pocketmine\phpstan\rules\DisallowEnumComparisonRule
|
|
||||||
- pocketmine\phpstan\rules\DisallowForeachByReferenceRule
|
- pocketmine\phpstan\rules\DisallowForeachByReferenceRule
|
||||||
- pocketmine\phpstan\rules\ExplodeLimitRule
|
- pocketmine\phpstan\rules\ExplodeLimitRule
|
||||||
- pocketmine\phpstan\rules\UnsafeForeachRule
|
- pocketmine\phpstan\rules\UnsafeForeachRule
|
||||||
|
@ -123,13 +123,6 @@ class MemoryManager{
|
|||||||
return $this->globalMemoryLimit;
|
return $this->globalMemoryLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
public function canUseChunkCache() : bool{
|
|
||||||
return !$this->lowMemory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the allowed chunk radius based on the current memory usage.
|
* 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';
|
require_once __DIR__ . '/VersionInfo.php';
|
||||||
|
|
||||||
const MIN_PHP_VERSION = "8.1.0";
|
const MIN_PHP_VERSION = "8.3.0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $message
|
* @param string $message
|
||||||
|
@ -80,6 +80,7 @@ use pocketmine\player\PlayerDataLoadException;
|
|||||||
use pocketmine\player\PlayerDataProvider;
|
use pocketmine\player\PlayerDataProvider;
|
||||||
use pocketmine\player\PlayerDataSaveException;
|
use pocketmine\player\PlayerDataSaveException;
|
||||||
use pocketmine\player\PlayerInfo;
|
use pocketmine\player\PlayerInfo;
|
||||||
|
use pocketmine\plugin\FolderPluginLoader;
|
||||||
use pocketmine\plugin\PharPluginLoader;
|
use pocketmine\plugin\PharPluginLoader;
|
||||||
use pocketmine\plugin\PluginEnableOrder;
|
use pocketmine\plugin\PluginEnableOrder;
|
||||||
use pocketmine\plugin\PluginGraylist;
|
use pocketmine\plugin\PluginGraylist;
|
||||||
@ -346,6 +347,10 @@ class Server{
|
|||||||
return $this->maxPlayers;
|
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
|
* 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.
|
* 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 = 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 PharPluginLoader($this->autoloader));
|
||||||
$this->pluginManager->registerInterface(new ScriptPluginLoader());
|
$this->pluginManager->registerInterface(new ScriptPluginLoader());
|
||||||
|
$this->pluginManager->registerInterface(new FolderPluginLoader($this->autoloader));
|
||||||
|
|
||||||
$providerManager = new WorldProviderManager();
|
$providerManager = new WorldProviderManager();
|
||||||
if(
|
if(
|
||||||
|
@ -31,7 +31,7 @@ use function str_repeat;
|
|||||||
|
|
||||||
final class VersionInfo{
|
final class VersionInfo{
|
||||||
public const NAME = "PocketMine-MP";
|
public const NAME = "PocketMine-MP";
|
||||||
public const BASE_VERSION = "5.33.2";
|
public const BASE_VERSION = "5.30.2";
|
||||||
public const IS_DEVELOPMENT_BUILD = true;
|
public const IS_DEVELOPMENT_BUILD = true;
|
||||||
public const BUILD_CHANNEL = "stable";
|
public const BUILD_CHANNEL = "stable";
|
||||||
|
|
||||||
|
@ -23,10 +23,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
|
||||||
use pocketmine\block\utils\RailPoweredByRedstoneTrait;
|
use pocketmine\block\utils\RailPoweredByRedstoneTrait;
|
||||||
|
|
||||||
class ActivatorRail extends StraightOnlyRail implements PoweredByRedstone{
|
class ActivatorRail extends StraightOnlyRail{
|
||||||
use RailPoweredByRedstoneTrait;
|
use RailPoweredByRedstoneTrait;
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\AmethystTrait;
|
use pocketmine\block\utils\AmethystTrait;
|
||||||
use pocketmine\block\utils\AnyFacing;
|
|
||||||
use pocketmine\block\utils\AnyFacingTrait;
|
use pocketmine\block\utils\AnyFacingTrait;
|
||||||
use pocketmine\block\utils\FortuneDropHelper;
|
use pocketmine\block\utils\FortuneDropHelper;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
@ -39,7 +38,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\utils\AssumptionFailedError;
|
use pocketmine\utils\AssumptionFailedError;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
final class AmethystCluster extends Transparent implements AnyFacing{
|
final class AmethystCluster extends Transparent{
|
||||||
use AmethystTrait;
|
use AmethystTrait;
|
||||||
use AnyFacingTrait;
|
use AnyFacingTrait;
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\block\inventory\AnvilInventory;
|
use pocketmine\block\inventory\AnvilInventory;
|
||||||
use pocketmine\block\utils\Fallable;
|
use pocketmine\block\utils\Fallable;
|
||||||
use pocketmine\block\utils\FallableTrait;
|
use pocketmine\block\utils\FallableTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -42,7 +41,7 @@ use pocketmine\world\sound\AnvilFallSound;
|
|||||||
use pocketmine\world\sound\Sound;
|
use pocketmine\world\sound\Sound;
|
||||||
use function round;
|
use function round;
|
||||||
|
|
||||||
class Anvil extends Transparent implements Fallable, HorizontalFacing{
|
class Anvil extends Transparent implements Fallable{
|
||||||
use FallableTrait;
|
use FallableTrait;
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\tile\Barrel as TileBarrel;
|
use pocketmine\block\tile\Barrel as TileBarrel;
|
||||||
use pocketmine\block\utils\AnyFacing;
|
|
||||||
use pocketmine\block\utils\AnyFacingTrait;
|
use pocketmine\block\utils\AnyFacingTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
@ -34,7 +33,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
use function abs;
|
use function abs;
|
||||||
|
|
||||||
class Barrel extends Opaque implements AnyFacing{
|
class Barrel extends Opaque{
|
||||||
use AnyFacingTrait;
|
use AnyFacingTrait;
|
||||||
|
|
||||||
protected bool $open = false;
|
protected bool $open = false;
|
||||||
|
@ -25,7 +25,6 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\block\tile\Banner as TileBanner;
|
use pocketmine\block\tile\Banner as TileBanner;
|
||||||
use pocketmine\block\utils\BannerPatternLayer;
|
use pocketmine\block\utils\BannerPatternLayer;
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\item\Banner as ItemBanner;
|
use pocketmine\item\Banner as ItemBanner;
|
||||||
@ -37,7 +36,7 @@ use pocketmine\world\BlockTransaction;
|
|||||||
use function assert;
|
use function assert;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
abstract class BaseBanner extends Transparent implements Colored{
|
abstract class BaseBanner extends Transparent{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,10 +49,6 @@ abstract class BaseBanner extends Transparent implements Colored{
|
|||||||
parent::readStateFromWorld();
|
parent::readStateFromWorld();
|
||||||
$tile = $this->position->getWorld()->getTile($this->position);
|
$tile = $this->position->getWorld()->getTile($this->position);
|
||||||
if($tile instanceof TileBanner){
|
if($tile instanceof TileBanner){
|
||||||
if($tile->getType() === TileBanner::TYPE_OMINOUS){
|
|
||||||
//illager banner is implemented as a separate block, as it doesn't support base color or custom patterns
|
|
||||||
return $this->getOminousVersion();
|
|
||||||
}
|
|
||||||
$this->color = $tile->getBaseColor();
|
$this->color = $tile->getBaseColor();
|
||||||
$this->setPatterns($tile->getPatterns());
|
$this->setPatterns($tile->getPatterns());
|
||||||
}
|
}
|
||||||
@ -61,13 +56,6 @@ abstract class BaseBanner extends Transparent implements Colored{
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: make this abstract in PM6 (BC break)
|
|
||||||
*/
|
|
||||||
protected function getOminousVersion() : Block{
|
|
||||||
return VanillaBlocks::AIR();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function writeStateToWorld() : void{
|
public function writeStateToWorld() : void{
|
||||||
parent::writeStateToWorld();
|
parent::writeStateToWorld();
|
||||||
$tile = $this->position->getWorld()->getTile($this->position);
|
$tile = $this->position->getWorld()->getTile($this->position);
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\event\block\StructureGrowEvent;
|
use pocketmine\event\block\StructureGrowEvent;
|
||||||
@ -34,7 +33,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
abstract class BaseBigDripleaf extends Transparent implements HorizontalFacing{
|
abstract class BaseBigDripleaf extends Transparent{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
abstract protected function isHead() : bool;
|
abstract protected function isHead() : bool;
|
||||||
|
@ -24,13 +24,12 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\CoralMaterial;
|
|
||||||
use pocketmine\block\utils\CoralTypeTrait;
|
use pocketmine\block\utils\CoralTypeTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
abstract class BaseCoral extends Transparent implements CoralMaterial{
|
abstract class BaseCoral extends Transparent{
|
||||||
use CoralTypeTrait;
|
use CoralTypeTrait;
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
public function onNearbyBlockChange() : void{
|
||||||
|
@ -1,90 +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;
|
|
||||||
|
|
||||||
use pocketmine\block\tile\Banner as TileBanner;
|
|
||||||
use pocketmine\block\utils\DyeColor;
|
|
||||||
use pocketmine\block\utils\SupportType;
|
|
||||||
use pocketmine\item\Item;
|
|
||||||
use pocketmine\item\VanillaItems;
|
|
||||||
use pocketmine\math\Vector3;
|
|
||||||
use pocketmine\player\Player;
|
|
||||||
use pocketmine\world\BlockTransaction;
|
|
||||||
use function assert;
|
|
||||||
|
|
||||||
abstract class BaseOminousBanner extends Transparent{
|
|
||||||
|
|
||||||
public function writeStateToWorld() : void{
|
|
||||||
parent::writeStateToWorld();
|
|
||||||
$tile = $this->position->getWorld()->getTile($this->position);
|
|
||||||
assert($tile instanceof TileBanner);
|
|
||||||
$tile->setBaseColor(DyeColor::WHITE);
|
|
||||||
$tile->setPatterns([]);
|
|
||||||
$tile->setType(TileBanner::TYPE_OMINOUS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isSolid() : bool{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getMaxStackSize() : int{
|
|
||||||
return 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFuelTime() : int{
|
|
||||||
return 300;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function recalculateCollisionBoxes() : array{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getSupportType(int $facing) : SupportType{
|
|
||||||
return SupportType::NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function canBeSupportedBy(Block $block) : bool{
|
|
||||||
return $block->isSolid();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
|
||||||
if(!$this->canBeSupportedBy($blockReplace->getSide($this->getSupportingFace()))){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract protected function getSupportingFace() : int;
|
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
|
||||||
if(!$this->canBeSupportedBy($this->getSide($this->getSupportingFace()))){
|
|
||||||
$this->position->getWorld()->useBreakOn($this->position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function asItem() : Item{
|
|
||||||
return VanillaItems::OMINOUS_BANNER();
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,7 +27,6 @@ use pocketmine\block\tile\Sign as TileSign;
|
|||||||
use pocketmine\block\utils\DyeColor;
|
use pocketmine\block\utils\DyeColor;
|
||||||
use pocketmine\block\utils\SignText;
|
use pocketmine\block\utils\SignText;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\block\utils\WoodMaterial;
|
|
||||||
use pocketmine\block\utils\WoodType;
|
use pocketmine\block\utils\WoodType;
|
||||||
use pocketmine\block\utils\WoodTypeTrait;
|
use pocketmine\block\utils\WoodTypeTrait;
|
||||||
use pocketmine\color\Color;
|
use pocketmine\color\Color;
|
||||||
@ -45,7 +44,7 @@ use function array_map;
|
|||||||
use function assert;
|
use function assert;
|
||||||
use function strlen;
|
use function strlen;
|
||||||
|
|
||||||
abstract class BaseSign extends Transparent implements WoodMaterial{
|
abstract class BaseSign extends Transparent{
|
||||||
use WoodTypeTrait;
|
use WoodTypeTrait;
|
||||||
|
|
||||||
protected SignText $text;
|
protected SignText $text;
|
||||||
|
@ -24,10 +24,8 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\tile\Bed as TileBed;
|
use pocketmine\block\tile\Bed as TileBed;
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
use pocketmine\block\utils\DyeColor;
|
use pocketmine\block\utils\DyeColor;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -43,7 +41,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
use pocketmine\world\World;
|
use pocketmine\world\World;
|
||||||
|
|
||||||
class Bed extends Transparent implements Colored, HorizontalFacing{
|
class Bed extends Transparent{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\block\tile\Bell as TileBell;
|
use pocketmine\block\tile\Bell as TileBell;
|
||||||
use pocketmine\block\utils\BellAttachmentType;
|
use pocketmine\block\utils\BellAttachmentType;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -39,7 +38,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
use pocketmine\world\sound\BellRingSound;
|
use pocketmine\world\sound\BellRingSound;
|
||||||
|
|
||||||
final class Bell extends Transparent implements HorizontalFacing{
|
final class Bell extends Transparent{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
private BellAttachmentType $attachmentType = BellAttachmentType::FLOOR;
|
private BellAttachmentType $attachmentType = BellAttachmentType::FLOOR;
|
||||||
|
@ -787,43 +787,8 @@ final class BlockTypeIds{
|
|||||||
public const RESIN_CLUMP = 10757;
|
public const RESIN_CLUMP = 10757;
|
||||||
public const CHISELED_RESIN_BRICKS = 10758;
|
public const CHISELED_RESIN_BRICKS = 10758;
|
||||||
public const RESPAWN_ANCHOR = 10759;
|
public const RESPAWN_ANCHOR = 10759;
|
||||||
public const OMINOUS_BANNER = 10760;
|
|
||||||
public const OMINOUS_WALL_BANNER = 10761;
|
|
||||||
public const ACACIA_CEILING_CENTER_HANGING_SIGN = 10762;
|
|
||||||
public const ACACIA_CEILING_EDGES_HANGING_SIGN = 10763;
|
|
||||||
public const ACACIA_WALL_HANGING_SIGN = 10764;
|
|
||||||
public const BIRCH_CEILING_CENTER_HANGING_SIGN = 10765;
|
|
||||||
public const BIRCH_CEILING_EDGES_HANGING_SIGN = 10766;
|
|
||||||
public const BIRCH_WALL_HANGING_SIGN = 10767;
|
|
||||||
public const CHERRY_CEILING_CENTER_HANGING_SIGN = 10768;
|
|
||||||
public const CHERRY_CEILING_EDGES_HANGING_SIGN = 10769;
|
|
||||||
public const CHERRY_WALL_HANGING_SIGN = 10770;
|
|
||||||
public const CRIMSON_CEILING_CENTER_HANGING_SIGN = 10771;
|
|
||||||
public const CRIMSON_CEILING_EDGES_HANGING_SIGN = 10772;
|
|
||||||
public const CRIMSON_WALL_HANGING_SIGN = 10773;
|
|
||||||
public const DARK_OAK_CEILING_CENTER_HANGING_SIGN = 10774;
|
|
||||||
public const DARK_OAK_CEILING_EDGES_HANGING_SIGN = 10775;
|
|
||||||
public const DARK_OAK_WALL_HANGING_SIGN = 10776;
|
|
||||||
public const JUNGLE_CEILING_CENTER_HANGING_SIGN = 10777;
|
|
||||||
public const JUNGLE_CEILING_EDGES_HANGING_SIGN = 10778;
|
|
||||||
public const JUNGLE_WALL_HANGING_SIGN = 10779;
|
|
||||||
public const MANGROVE_CEILING_CENTER_HANGING_SIGN = 10780;
|
|
||||||
public const MANGROVE_CEILING_EDGES_HANGING_SIGN = 10781;
|
|
||||||
public const MANGROVE_WALL_HANGING_SIGN = 10782;
|
|
||||||
public const OAK_CEILING_CENTER_HANGING_SIGN = 10783;
|
|
||||||
public const OAK_CEILING_EDGES_HANGING_SIGN = 10784;
|
|
||||||
public const OAK_WALL_HANGING_SIGN = 10785;
|
|
||||||
public const PALE_OAK_CEILING_CENTER_HANGING_SIGN = 10786;
|
|
||||||
public const PALE_OAK_CEILING_EDGES_HANGING_SIGN = 10787;
|
|
||||||
public const PALE_OAK_WALL_HANGING_SIGN = 10788;
|
|
||||||
public const SPRUCE_CEILING_CENTER_HANGING_SIGN = 10789;
|
|
||||||
public const SPRUCE_CEILING_EDGES_HANGING_SIGN = 10790;
|
|
||||||
public const SPRUCE_WALL_HANGING_SIGN = 10791;
|
|
||||||
public const WARPED_CEILING_CENTER_HANGING_SIGN = 10792;
|
|
||||||
public const WARPED_CEILING_EDGES_HANGING_SIGN = 10793;
|
|
||||||
public const WARPED_WALL_HANGING_SIGN = 10794;
|
|
||||||
|
|
||||||
public const FIRST_UNUSED_BLOCK_ID = 10795;
|
public const FIRST_UNUSED_BLOCK_ID = 10760;
|
||||||
|
|
||||||
private static int $nextDynamicId = self::FIRST_UNUSED_BLOCK_ID;
|
private static int $nextDynamicId = self::FIRST_UNUSED_BLOCK_ID;
|
||||||
|
|
||||||
|
@ -31,5 +31,4 @@ final class BlockTypeTags{
|
|||||||
public const SAND = self::PREFIX . "sand";
|
public const SAND = self::PREFIX . "sand";
|
||||||
public const POTTABLE_PLANTS = self::PREFIX . "pottable";
|
public const POTTABLE_PLANTS = self::PREFIX . "pottable";
|
||||||
public const FIRE = self::PREFIX . "fire";
|
public const FIRE = self::PREFIX . "fire";
|
||||||
public const HANGING_SIGN = self::PREFIX . "hanging_sign";
|
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\PillarRotation;
|
|
||||||
use pocketmine\block\utils\PillarRotationTrait;
|
use pocketmine\block\utils\PillarRotationTrait;
|
||||||
|
|
||||||
class BoneBlock extends Opaque implements PillarRotation{
|
class BoneBlock extends Opaque{
|
||||||
use PillarRotationTrait;
|
use PillarRotationTrait;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\AnyFacing;
|
|
||||||
use pocketmine\block\utils\AnyFacingTrait;
|
use pocketmine\block\utils\AnyFacingTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
@ -34,7 +33,7 @@ use pocketmine\world\BlockTransaction;
|
|||||||
use pocketmine\world\sound\RedstonePowerOffSound;
|
use pocketmine\world\sound\RedstonePowerOffSound;
|
||||||
use pocketmine\world\sound\RedstonePowerOnSound;
|
use pocketmine\world\sound\RedstonePowerOnSound;
|
||||||
|
|
||||||
abstract class Button extends Flowable implements AnyFacing{
|
abstract class Button extends Flowable{
|
||||||
use AnyFacingTrait;
|
use AnyFacingTrait;
|
||||||
|
|
||||||
protected bool $pressed = false;
|
protected bool $pressed = false;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
@ -34,7 +33,7 @@ use pocketmine\event\entity\EntityDamageEvent;
|
|||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
|
|
||||||
class Cactus extends Transparent implements Ageable{
|
class Cactus extends Transparent{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\CandleTrait;
|
use pocketmine\block\utils\CandleTrait;
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\entity\Living;
|
use pocketmine\entity\Living;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
@ -32,7 +31,7 @@ use pocketmine\math\Facing;
|
|||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class CakeWithCandle extends BaseCake implements Lightable{
|
class CakeWithCandle extends BaseCake{
|
||||||
use CandleTrait {
|
use CandleTrait {
|
||||||
onInteract as onInteractCandle;
|
onInteract as onInteractCandle;
|
||||||
}
|
}
|
||||||
|
@ -23,11 +23,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
use pocketmine\block\utils\DyeColor;
|
use pocketmine\block\utils\DyeColor;
|
||||||
|
|
||||||
class CakeWithDyedCandle extends CakeWithCandle implements Colored{
|
class CakeWithDyedCandle extends CakeWithCandle{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
|
|
||||||
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){
|
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){
|
||||||
|
@ -25,9 +25,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\block\inventory\CampfireInventory;
|
use pocketmine\block\inventory\CampfireInventory;
|
||||||
use pocketmine\block\tile\Campfire as TileCampfire;
|
use pocketmine\block\tile\Campfire as TileCampfire;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\block\utils\LightableTrait;
|
use pocketmine\block\utils\LightableTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\crafting\FurnaceRecipe;
|
use pocketmine\crafting\FurnaceRecipe;
|
||||||
@ -61,7 +59,7 @@ use function count;
|
|||||||
use function min;
|
use function min;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class Campfire extends Transparent implements Lightable, HorizontalFacing{
|
class Campfire extends Transparent{
|
||||||
use HorizontalFacingTrait{
|
use HorizontalFacingTrait{
|
||||||
HorizontalFacingTrait::describeBlockOnlyState as encodeFacingState;
|
HorizontalFacingTrait::describeBlockOnlyState as encodeFacingState;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\CandleTrait;
|
use pocketmine\block\utils\CandleTrait;
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
@ -36,7 +35,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\utils\AssumptionFailedError;
|
use pocketmine\utils\AssumptionFailedError;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
class Candle extends Transparent implements Lightable{
|
class Candle extends Transparent{
|
||||||
use CandleTrait {
|
use CandleTrait {
|
||||||
describeBlockOnlyState as encodeLitState;
|
describeBlockOnlyState as encodeLitState;
|
||||||
getLightLevel as getBaseLightLevel;
|
getLightLevel as getBaseLightLevel;
|
||||||
|
@ -23,13 +23,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
|
|
||||||
class Carpet extends Flowable implements Colored{
|
class Carpet extends Flowable{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -24,8 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
|
|
||||||
class CarvedPumpkin extends Opaque implements HorizontalFacing{
|
class CarvedPumpkin extends Opaque{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
@ -40,7 +39,7 @@ use pocketmine\world\BlockTransaction;
|
|||||||
use pocketmine\world\sound\GlowBerriesPickSound;
|
use pocketmine\world\sound\GlowBerriesPickSound;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class CaveVines extends Flowable implements Ageable{
|
class CaveVines extends Flowable{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -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\block;
|
|
||||||
|
|
||||||
use pocketmine\block\utils\SignLikeRotation;
|
|
||||||
use pocketmine\block\utils\SignLikeRotationTrait;
|
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
|
||||||
use pocketmine\item\Item;
|
|
||||||
use pocketmine\math\Facing;
|
|
||||||
use pocketmine\math\Vector3;
|
|
||||||
use pocketmine\player\Player;
|
|
||||||
use pocketmine\world\BlockTransaction;
|
|
||||||
|
|
||||||
final class CeilingCenterHangingSign extends BaseSign implements SignLikeRotation{
|
|
||||||
use SignLikeRotationTrait;
|
|
||||||
use StaticSupportTrait;
|
|
||||||
|
|
||||||
protected function getSupportingFace() : int{
|
|
||||||
return Facing::UP;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: duplicated code :(
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
|
||||||
if($face !== Facing::DOWN){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($player !== null){
|
|
||||||
$this->rotation = self::getRotationFromYaw($player->getLocation()->getYaw());
|
|
||||||
}
|
|
||||||
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function canBeSupportedAt(Block $block) : bool{
|
|
||||||
$supportBlock = $block->getSide(Facing::UP);
|
|
||||||
return
|
|
||||||
$supportBlock->getSupportType(Facing::DOWN)->hasCenterSupport() ||
|
|
||||||
$supportBlock->hasTypeTag(BlockTypeTags::HANGING_SIGN);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +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;
|
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
|
||||||
use pocketmine\block\utils\SupportType;
|
|
||||||
use pocketmine\item\Item;
|
|
||||||
use pocketmine\math\Facing;
|
|
||||||
use pocketmine\math\Vector3;
|
|
||||||
use pocketmine\player\Player;
|
|
||||||
use pocketmine\world\BlockTransaction;
|
|
||||||
|
|
||||||
final class CeilingEdgesHangingSign extends BaseSign implements HorizontalFacing{
|
|
||||||
use HorizontalFacingTrait;
|
|
||||||
|
|
||||||
protected function getSupportingFace() : int{
|
|
||||||
return Facing::UP;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
|
||||||
if($face !== Facing::DOWN){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if($player !== null){
|
|
||||||
$this->facing = Facing::opposite($player->getHorizontalFacing());
|
|
||||||
}
|
|
||||||
if(!$this->canBeSupportedAt($blockReplace)){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
|
||||||
if(!$this->canBeSupportedAt($this)){
|
|
||||||
$this->position->getWorld()->useBreakOn($this->position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function canBeSupportedAt(Block $block) : bool{
|
|
||||||
$supportBlock = $block->getSide(Facing::UP);
|
|
||||||
return
|
|
||||||
$supportBlock->getSupportType(Facing::DOWN) === SupportType::FULL ||
|
|
||||||
(($supportBlock instanceof WallHangingSign || $supportBlock instanceof CeilingEdgesHangingSign) && Facing::axis($supportBlock->getFacing()) === Facing::axis($this->facing));
|
|
||||||
}
|
|
||||||
}
|
|
@ -23,14 +23,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\PillarRotation;
|
|
||||||
use pocketmine\block\utils\PillarRotationTrait;
|
use pocketmine\block\utils\PillarRotationTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\math\Axis;
|
use pocketmine\math\Axis;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
|
|
||||||
final class Chain extends Transparent implements PillarRotation{
|
final class Chain extends Transparent{
|
||||||
use PillarRotationTrait;
|
use PillarRotationTrait;
|
||||||
|
|
||||||
public function getSupportType(int $facing) : SupportType{
|
public function getSupportType(int $facing) : SupportType{
|
||||||
|
@ -24,12 +24,11 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
final class ChemistryTable extends Opaque implements HorizontalFacing{
|
final class ChemistryTable extends Opaque{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
|
|
||||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
|
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
|
||||||
|
@ -25,7 +25,6 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\block\tile\Chest as TileChest;
|
use pocketmine\block\tile\Chest as TileChest;
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\event\block\ChestPairEvent;
|
use pocketmine\event\block\ChestPairEvent;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
@ -34,7 +33,7 @@ use pocketmine\math\Facing;
|
|||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class Chest extends Transparent implements HorizontalFacing{
|
class Chest extends Transparent{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
|
|
||||||
protected function recalculateCollisionBoxes() : array{
|
protected function recalculateCollisionBoxes() : array{
|
||||||
|
@ -26,7 +26,6 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\block\tile\ChiseledBookshelf as TileChiseledBookshelf;
|
use pocketmine\block\tile\ChiseledBookshelf as TileChiseledBookshelf;
|
||||||
use pocketmine\block\utils\ChiseledBookshelfSlot;
|
use pocketmine\block\utils\ChiseledBookshelfSlot;
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
use pocketmine\item\Book;
|
use pocketmine\item\Book;
|
||||||
@ -39,7 +38,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use function spl_object_id;
|
use function spl_object_id;
|
||||||
|
|
||||||
class ChiseledBookshelf extends Opaque implements HorizontalFacing{
|
class ChiseledBookshelf extends Opaque{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
|
|
||||||
@ -114,18 +113,6 @@ class ChiseledBookshelf extends Opaque implements HorizontalFacing{
|
|||||||
return $this->slots;
|
return $this->slots;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param ChiseledBookshelfSlot[] $slots
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
public function setSlots(array $slots) : self{
|
|
||||||
$this->slots = [];
|
|
||||||
foreach($slots as $slot){
|
|
||||||
$this->setSlot($slot, true);
|
|
||||||
}
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the last slot interacted by a player or null if no slot has been interacted with yet.
|
* Returns the last slot interacted by a player or null if no slot has been interacted with yet.
|
||||||
*/
|
*/
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
use pocketmine\entity\projectile\Projectile;
|
use pocketmine\entity\projectile\Projectile;
|
||||||
@ -41,7 +40,7 @@ use function array_rand;
|
|||||||
use function min;
|
use function min;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
final class ChorusFlower extends Flowable implements Ageable{
|
final class ChorusFlower extends Flowable{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -23,10 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\WoodType;
|
use pocketmine\block\utils\WoodType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -41,7 +39,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class CocoaBlock extends Flowable implements Ageable, HorizontalFacing{
|
class CocoaBlock extends Flowable{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
|
|
||||||
|
@ -23,9 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
|
|
||||||
class Concrete extends Opaque implements Colored{
|
class Concrete extends Opaque{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
}
|
}
|
||||||
|
@ -24,13 +24,12 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
use pocketmine\block\utils\Fallable;
|
use pocketmine\block\utils\Fallable;
|
||||||
use pocketmine\block\utils\FallableTrait;
|
use pocketmine\block\utils\FallableTrait;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
|
|
||||||
class ConcretePowder extends Opaque implements Fallable, Colored{
|
class ConcretePowder extends Opaque implements Fallable{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
use FallableTrait {
|
use FallableTrait {
|
||||||
onNearbyBlockChange as protected startFalling;
|
onNearbyBlockChange as protected startFalling;
|
||||||
|
@ -26,13 +26,11 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\block\utils\CopperMaterial;
|
use pocketmine\block\utils\CopperMaterial;
|
||||||
use pocketmine\block\utils\CopperOxidation;
|
use pocketmine\block\utils\CopperOxidation;
|
||||||
use pocketmine\block\utils\CopperTrait;
|
use pocketmine\block\utils\CopperTrait;
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\block\utils\LightableTrait;
|
use pocketmine\block\utils\LightableTrait;
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
|
||||||
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
|
|
||||||
class CopperBulb extends Opaque implements CopperMaterial, Lightable, PoweredByRedstone{
|
class CopperBulb extends Opaque implements CopperMaterial{
|
||||||
use CopperTrait;
|
use CopperTrait;
|
||||||
use PoweredByRedstoneTrait;
|
use PoweredByRedstoneTrait;
|
||||||
use LightableTrait{
|
use LightableTrait{
|
||||||
|
@ -24,12 +24,11 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\CoralMaterial;
|
|
||||||
use pocketmine\block\utils\CoralTypeTrait;
|
use pocketmine\block\utils\CoralTypeTrait;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
final class CoralBlock extends Opaque implements CoralMaterial{
|
final class CoralBlock extends Opaque{
|
||||||
use CoralTypeTrait;
|
use CoralTypeTrait;
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
public function onNearbyBlockChange() : void{
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\CropGrowthHelper;
|
use pocketmine\block\utils\CropGrowthHelper;
|
||||||
@ -35,7 +34,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
abstract class Crops extends Flowable implements Ageable{
|
abstract class Crops extends Flowable{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\AnalogRedstoneSignalEmitter;
|
|
||||||
use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait;
|
use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -37,7 +36,7 @@ use function max;
|
|||||||
use function round;
|
use function round;
|
||||||
use const M_PI;
|
use const M_PI;
|
||||||
|
|
||||||
class DaylightSensor extends Transparent implements AnalogRedstoneSignalEmitter{
|
class DaylightSensor extends Transparent{
|
||||||
use AnalogRedstoneSignalEmitterTrait;
|
use AnalogRedstoneSignalEmitterTrait;
|
||||||
|
|
||||||
protected bool $inverted = false;
|
protected bool $inverted = false;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -35,7 +34,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
use pocketmine\world\sound\DoorSound;
|
use pocketmine\world\sound\DoorSound;
|
||||||
|
|
||||||
class Door extends Transparent implements HorizontalFacing{
|
class Door extends Transparent{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
protected bool $top = false;
|
protected bool $top = false;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\CropGrowthHelper;
|
use pocketmine\block\utils\CropGrowthHelper;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -38,7 +37,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
final class DoublePitcherCrop extends DoublePlant implements Ageable{
|
final class DoublePitcherCrop extends DoublePlant{
|
||||||
use AgeableTrait {
|
use AgeableTrait {
|
||||||
describeBlockOnlyState as describeAge;
|
describeBlockOnlyState as describeAge;
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
|
|
||||||
class DyedCandle extends Candle implements Colored{
|
class DyedCandle extends Candle{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
|
|
||||||
protected function getCandleIfCompatibleType(Block $block) : ?Candle{
|
protected function getCandleIfCompatibleType(Block $block) : ?Candle{
|
||||||
|
@ -23,9 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
|
|
||||||
final class DyedShulkerBox extends ShulkerBox implements Colored{
|
final class DyedShulkerBox extends ShulkerBox{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
}
|
}
|
||||||
|
@ -24,12 +24,11 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
|
|
||||||
class EndPortalFrame extends Opaque implements HorizontalFacing{
|
class EndPortalFrame extends Opaque{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
|
|
||||||
protected bool $eye = false;
|
protected bool $eye = false;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\AnyFacing;
|
|
||||||
use pocketmine\block\utils\AnyFacingTrait;
|
use pocketmine\block\utils\AnyFacingTrait;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\Axis;
|
use pocketmine\math\Axis;
|
||||||
@ -33,7 +32,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
class EndRod extends Flowable implements AnyFacing{
|
class EndRod extends Flowable{
|
||||||
use AnyFacingTrait;
|
use AnyFacingTrait;
|
||||||
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
||||||
|
@ -26,7 +26,6 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\block\inventory\EnderChestInventory;
|
use pocketmine\block\inventory\EnderChestInventory;
|
||||||
use pocketmine\block\tile\EnderChest as TileEnderChest;
|
use pocketmine\block\tile\EnderChest as TileEnderChest;
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
@ -34,7 +33,7 @@ use pocketmine\math\Facing;
|
|||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class EnderChest extends Transparent implements HorizontalFacing{
|
class EnderChest extends Transparent{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
|
|
||||||
public function getLightLevel() : int{
|
public function getLightLevel() : int{
|
||||||
|
@ -23,10 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\block\utils\WoodMaterial;
|
|
||||||
use pocketmine\block\utils\WoodTypeTrait;
|
use pocketmine\block\utils\WoodTypeTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
@ -37,7 +35,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
use pocketmine\world\sound\DoorSound;
|
use pocketmine\world\sound\DoorSound;
|
||||||
|
|
||||||
class FenceGate extends Transparent implements HorizontalFacing, WoodMaterial{
|
class FenceGate extends Transparent{
|
||||||
use WoodTypeTrait;
|
use WoodTypeTrait;
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
@ -36,7 +35,7 @@ use function max;
|
|||||||
use function min;
|
use function min;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class Fire extends BaseFire implements Ageable{
|
class Fire extends BaseFire{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
|
|
||||||
public const MAX_AGE = 15;
|
public const MAX_AGE = 15;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\SignLikeRotation;
|
|
||||||
use pocketmine\block\utils\SignLikeRotationTrait;
|
use pocketmine\block\utils\SignLikeRotationTrait;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
@ -31,13 +30,9 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
final class FloorBanner extends BaseBanner implements SignLikeRotation{
|
final class FloorBanner extends BaseBanner{
|
||||||
use SignLikeRotationTrait;
|
use SignLikeRotationTrait;
|
||||||
|
|
||||||
protected function getOminousVersion() : Block{
|
|
||||||
return VanillaBlocks::OMINOUS_BANNER()->setRotation($this->rotation);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getSupportingFace() : int{
|
protected function getSupportingFace() : int{
|
||||||
return Facing::DOWN;
|
return Facing::DOWN;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\SignLikeRotation;
|
|
||||||
use pocketmine\block\utils\SignLikeRotationTrait;
|
use pocketmine\block\utils\SignLikeRotationTrait;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
@ -31,7 +30,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
final class FloorSign extends BaseSign implements SignLikeRotation{
|
final class FloorSign extends BaseSign{
|
||||||
use SignLikeRotationTrait;
|
use SignLikeRotationTrait;
|
||||||
|
|
||||||
protected function getSupportingFace() : int{
|
protected function getSupportingFace() : int{
|
||||||
|
@ -23,12 +23,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class FrostedIce extends Ice implements Ageable{
|
class FrostedIce extends Ice{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
|
|
||||||
public const MAX_AGE = 3;
|
public const MAX_AGE = 3;
|
||||||
|
@ -25,8 +25,6 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\block\tile\Furnace as TileFurnace;
|
use pocketmine\block\tile\Furnace as TileFurnace;
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\block\utils\LightableTrait;
|
use pocketmine\block\utils\LightableTrait;
|
||||||
use pocketmine\crafting\FurnaceType;
|
use pocketmine\crafting\FurnaceType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -35,7 +33,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class Furnace extends Opaque implements Lightable, HorizontalFacing{
|
class Furnace extends Opaque{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
use LightableTrait;
|
use LightableTrait;
|
||||||
|
|
||||||
|
@ -23,12 +23,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
|
|
||||||
class GlazedTerracotta extends Opaque implements Colored, HorizontalFacing{
|
class GlazedTerracotta extends Opaque{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\MultiAnyFacing;
|
|
||||||
use pocketmine\block\utils\MultiAnySupportTrait;
|
use pocketmine\block\utils\MultiAnySupportTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\item\Fertilizer;
|
use pocketmine\item\Fertilizer;
|
||||||
@ -36,7 +35,7 @@ use pocketmine\world\World;
|
|||||||
use function count;
|
use function count;
|
||||||
use function shuffle;
|
use function shuffle;
|
||||||
|
|
||||||
class GlowLichen extends Transparent implements MultiAnyFacing{
|
class GlowLichen extends Transparent{
|
||||||
use MultiAnySupportTrait;
|
use MultiAnySupportTrait;
|
||||||
|
|
||||||
public function getLightLevel() : int{
|
public function getLightLevel() : int{
|
||||||
|
@ -23,11 +23,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\PillarRotation;
|
|
||||||
use pocketmine\block\utils\PillarRotationTrait;
|
use pocketmine\block\utils\PillarRotationTrait;
|
||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
|
|
||||||
class HayBale extends Opaque implements PillarRotation{
|
class HayBale extends Opaque{
|
||||||
use PillarRotationTrait;
|
use PillarRotationTrait;
|
||||||
|
|
||||||
public function getFlameEncouragement() : int{
|
public function getFlameEncouragement() : int{
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\tile\Hopper as TileHopper;
|
use pocketmine\block\tile\Hopper as TileHopper;
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
|
||||||
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -35,7 +34,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
class Hopper extends Transparent implements PoweredByRedstone{
|
class Hopper extends Transparent{
|
||||||
use PoweredByRedstoneTrait;
|
use PoweredByRedstoneTrait;
|
||||||
|
|
||||||
private int $facing = Facing::DOWN;
|
private int $facing = Facing::DOWN;
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\tile\ItemFrame as TileItemFrame;
|
use pocketmine\block\tile\ItemFrame as TileItemFrame;
|
||||||
use pocketmine\block\utils\AnyFacing;
|
|
||||||
use pocketmine\block\utils\AnyFacingTrait;
|
use pocketmine\block\utils\AnyFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -40,7 +39,7 @@ use pocketmine\world\sound\ItemFrameRotateItemSound;
|
|||||||
use function is_infinite;
|
use function is_infinite;
|
||||||
use function is_nan;
|
use function is_nan;
|
||||||
|
|
||||||
class ItemFrame extends Flowable implements AnyFacing{
|
class ItemFrame extends Flowable{
|
||||||
use AnyFacingTrait;
|
use AnyFacingTrait;
|
||||||
|
|
||||||
public const ROTATIONS = 8;
|
public const ROTATIONS = 8;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
@ -36,7 +35,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
class Ladder extends Transparent implements HorizontalFacing{
|
class Ladder extends Transparent{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
public function hasEntityCollision() : bool{
|
public function hasEntityCollision() : bool{
|
||||||
|
@ -25,7 +25,6 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\block\tile\Lectern as TileLectern;
|
use pocketmine\block\tile\Lectern as TileLectern;
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
@ -37,7 +36,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\world\sound\LecternPlaceBookSound;
|
use pocketmine\world\sound\LecternPlaceBookSound;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
class Lectern extends Transparent implements HorizontalFacing{
|
class Lectern extends Transparent{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
|
|
||||||
protected int $viewedPage = 0;
|
protected int $viewedPage = 0;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\AnyFacing;
|
|
||||||
use pocketmine\block\utils\AnyFacingTrait;
|
use pocketmine\block\utils\AnyFacingTrait;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\Axis;
|
use pocketmine\math\Axis;
|
||||||
@ -33,7 +32,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
final class LightningRod extends Transparent implements AnyFacing{
|
final class LightningRod extends Transparent{
|
||||||
use AnyFacingTrait;
|
use AnyFacingTrait;
|
||||||
|
|
||||||
protected function recalculateCollisionBoxes() : array{
|
protected function recalculateCollisionBoxes() : array{
|
||||||
|
@ -25,12 +25,11 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\block\inventory\LoomInventory;
|
use pocketmine\block\inventory\LoomInventory;
|
||||||
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
final class Loom extends Opaque implements HorizontalFacing{
|
final class Loom extends Opaque{
|
||||||
use FacesOppositePlacingPlayerTrait;
|
use FacesOppositePlacingPlayerTrait;
|
||||||
|
|
||||||
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
|
public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\FortuneDropHelper;
|
use pocketmine\block\utils\FortuneDropHelper;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
@ -42,7 +41,7 @@ use function mt_rand;
|
|||||||
/**
|
/**
|
||||||
* This class is used for Weeping & Twisting vines, because they have same behaviour
|
* This class is used for Weeping & Twisting vines, because they have same behaviour
|
||||||
*/
|
*/
|
||||||
class NetherVines extends Flowable implements Ageable{
|
class NetherVines extends Flowable{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\FortuneDropHelper;
|
use pocketmine\block\utils\FortuneDropHelper;
|
||||||
@ -32,7 +31,7 @@ use pocketmine\item\Item;
|
|||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class NetherWartPlant extends Flowable implements Ageable{
|
class NetherWartPlant extends Flowable{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -1,53 +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;
|
|
||||||
|
|
||||||
use pocketmine\block\utils\SignLikeRotation;
|
|
||||||
use pocketmine\block\utils\SignLikeRotationTrait;
|
|
||||||
use pocketmine\item\Item;
|
|
||||||
use pocketmine\math\Facing;
|
|
||||||
use pocketmine\math\Vector3;
|
|
||||||
use pocketmine\player\Player;
|
|
||||||
use pocketmine\world\BlockTransaction;
|
|
||||||
|
|
||||||
final class OminousFloorBanner extends BaseOminousBanner implements SignLikeRotation{
|
|
||||||
use SignLikeRotationTrait;
|
|
||||||
|
|
||||||
//TODO: duplicated code :(
|
|
||||||
|
|
||||||
protected function getSupportingFace() : int{
|
|
||||||
return Facing::DOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
|
||||||
if($face !== Facing::UP){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($player !== null){
|
|
||||||
$this->rotation = self::getRotationFromYaw($player->getLocation()->getYaw());
|
|
||||||
}
|
|
||||||
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +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;
|
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
|
||||||
use pocketmine\item\Item;
|
|
||||||
use pocketmine\math\Axis;
|
|
||||||
use pocketmine\math\Facing;
|
|
||||||
use pocketmine\math\Vector3;
|
|
||||||
use pocketmine\player\Player;
|
|
||||||
use pocketmine\world\BlockTransaction;
|
|
||||||
|
|
||||||
final class OminousWallBanner extends BaseOminousBanner implements HorizontalFacing{
|
|
||||||
use HorizontalFacingTrait;
|
|
||||||
|
|
||||||
protected function getSupportingFace() : int{
|
|
||||||
return Facing::opposite($this->facing);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
|
|
||||||
if(Facing::axis($face) === Axis::Y){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$this->facing = $face;
|
|
||||||
return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
|
||||||
}
|
|
||||||
}
|
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -35,7 +34,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
class PinkPetals extends Flowable implements HorizontalFacing{
|
class PinkPetals extends Flowable{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
use StaticSupportTrait {
|
use StaticSupportTrait {
|
||||||
canBePlacedAt as supportedWhenPlacedAt;
|
canBePlacedAt as supportedWhenPlacedAt;
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Ageable;
|
|
||||||
use pocketmine\block\utils\AgeableTrait;
|
use pocketmine\block\utils\AgeableTrait;
|
||||||
use pocketmine\block\utils\BlockEventHelper;
|
use pocketmine\block\utils\BlockEventHelper;
|
||||||
use pocketmine\block\utils\CropGrowthHelper;
|
use pocketmine\block\utils\CropGrowthHelper;
|
||||||
@ -39,7 +38,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
final class PitcherCrop extends Flowable implements Ageable{
|
final class PitcherCrop extends Flowable{
|
||||||
use AgeableTrait;
|
use AgeableTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -23,10 +23,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\WoodMaterial;
|
|
||||||
use pocketmine\block\utils\WoodTypeTrait;
|
use pocketmine\block\utils\WoodTypeTrait;
|
||||||
|
|
||||||
class Planks extends Opaque implements WoodMaterial{
|
class Planks extends Opaque{
|
||||||
use WoodTypeTrait;
|
use WoodTypeTrait;
|
||||||
|
|
||||||
public function getFuelTime() : int{
|
public function getFuelTime() : int{
|
||||||
|
@ -23,9 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
|
||||||
use pocketmine\block\utils\RailPoweredByRedstoneTrait;
|
use pocketmine\block\utils\RailPoweredByRedstoneTrait;
|
||||||
|
|
||||||
class PoweredRail extends StraightOnlyRail implements PoweredByRedstone{
|
class PoweredRail extends StraightOnlyRail{
|
||||||
use RailPoweredByRedstoneTrait;
|
use RailPoweredByRedstoneTrait;
|
||||||
}
|
}
|
||||||
|
@ -24,11 +24,8 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\tile\Comparator;
|
use pocketmine\block\tile\Comparator;
|
||||||
use pocketmine\block\utils\AnalogRedstoneSignalEmitter;
|
|
||||||
use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait;
|
use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait;
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
|
||||||
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
@ -41,7 +38,7 @@ use pocketmine\player\Player;
|
|||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
use function assert;
|
use function assert;
|
||||||
|
|
||||||
class RedstoneComparator extends Flowable implements AnalogRedstoneSignalEmitter, PoweredByRedstone, HorizontalFacing{
|
class RedstoneComparator extends Flowable{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
use AnalogRedstoneSignalEmitterTrait;
|
use AnalogRedstoneSignalEmitterTrait;
|
||||||
use PoweredByRedstoneTrait;
|
use PoweredByRedstoneTrait;
|
||||||
|
@ -23,12 +23,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
|
||||||
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
|
|
||||||
class RedstoneLamp extends Opaque implements PoweredByRedstone, Lightable{
|
class RedstoneLamp extends Opaque{
|
||||||
use PoweredByRedstoneTrait;
|
use PoweredByRedstoneTrait;
|
||||||
|
|
||||||
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
||||||
@ -38,14 +36,4 @@ class RedstoneLamp extends Opaque implements PoweredByRedstone, Lightable{
|
|||||||
public function getLightLevel() : int{
|
public function getLightLevel() : int{
|
||||||
return $this->powered ? 15 : 0;
|
return $this->powered ? 15 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isLit() : bool{
|
|
||||||
return $this->powered;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @return $this */
|
|
||||||
public function setLit(bool $lit = true) : self{
|
|
||||||
$this->powered = $lit;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\FortuneDropHelper;
|
use pocketmine\block\utils\FortuneDropHelper;
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\block\utils\LightableTrait;
|
use pocketmine\block\utils\LightableTrait;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\item\VanillaItems;
|
use pocketmine\item\VanillaItems;
|
||||||
@ -32,7 +31,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class RedstoneOre extends Opaque implements Lightable{
|
class RedstoneOre extends Opaque{
|
||||||
use LightableTrait;
|
use LightableTrait;
|
||||||
|
|
||||||
public function getLightLevel() : int{
|
public function getLightLevel() : int{
|
||||||
|
@ -23,9 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
|
||||||
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
@ -37,7 +35,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
class RedstoneRepeater extends Flowable implements PoweredByRedstone, HorizontalFacing{
|
class RedstoneRepeater extends Flowable{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
use PoweredByRedstoneTrait;
|
use PoweredByRedstoneTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
@ -23,11 +23,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Lightable;
|
|
||||||
use pocketmine\block\utils\LightableTrait;
|
use pocketmine\block\utils\LightableTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
|
|
||||||
class RedstoneTorch extends Torch implements Lightable{
|
class RedstoneTorch extends Torch{
|
||||||
use LightableTrait;
|
use LightableTrait;
|
||||||
|
|
||||||
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){
|
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){
|
||||||
|
@ -23,14 +23,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\AnalogRedstoneSignalEmitter;
|
|
||||||
use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait;
|
use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait;
|
||||||
use pocketmine\block\utils\StaticSupportTrait;
|
use pocketmine\block\utils\StaticSupportTrait;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\item\VanillaItems;
|
use pocketmine\item\VanillaItems;
|
||||||
use pocketmine\math\Facing;
|
use pocketmine\math\Facing;
|
||||||
|
|
||||||
class RedstoneWire extends Flowable implements AnalogRedstoneSignalEmitter{
|
class RedstoneWire extends Flowable{
|
||||||
use AnalogRedstoneSignalEmitterTrait;
|
use AnalogRedstoneSignalEmitterTrait;
|
||||||
use StaticSupportTrait;
|
use StaticSupportTrait;
|
||||||
|
|
||||||
|
@ -23,11 +23,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\MultiAnyFacing;
|
|
||||||
use pocketmine\block\utils\MultiAnySupportTrait;
|
use pocketmine\block\utils\MultiAnySupportTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
|
|
||||||
final class ResinClump extends Transparent implements MultiAnyFacing{
|
final class ResinClump extends Transparent{
|
||||||
use MultiAnySupportTrait;
|
use MultiAnySupportTrait;
|
||||||
|
|
||||||
public function isSolid() : bool{
|
public function isSolid() : bool{
|
||||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\tile\ShulkerBox as TileShulkerBox;
|
use pocketmine\block\tile\ShulkerBox as TileShulkerBox;
|
||||||
use pocketmine\block\utils\AnyFacing;
|
|
||||||
use pocketmine\block\utils\AnyFacingTrait;
|
use pocketmine\block\utils\AnyFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -33,7 +32,7 @@ use pocketmine\math\Vector3;
|
|||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
use pocketmine\world\BlockTransaction;
|
use pocketmine\world\BlockTransaction;
|
||||||
|
|
||||||
class ShulkerBox extends Opaque implements AnyFacing{
|
class ShulkerBox extends Opaque{
|
||||||
use AnyFacingTrait;
|
use AnyFacingTrait;
|
||||||
|
|
||||||
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
||||||
|
@ -23,13 +23,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\PillarRotation;
|
|
||||||
use pocketmine\block\utils\PillarRotationTrait;
|
use pocketmine\block\utils\PillarRotationTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal This class provides a general base for pillar-like blocks. It **should not** be used for contract binding
|
* @internal This class provides a general base for pillar-like blocks. It **should not** be used for contract binding
|
||||||
* in APIs, because not all pillar-like blocks extend this class.
|
* in APIs, because not all pillar-like blocks extend this class.
|
||||||
*/
|
*/
|
||||||
class SimplePillar extends Opaque implements PillarRotation{
|
class SimplePillar extends Opaque{
|
||||||
use PillarRotationTrait;
|
use PillarRotationTrait;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\HorizontalFacing;
|
|
||||||
use pocketmine\block\utils\HorizontalFacingTrait;
|
use pocketmine\block\utils\HorizontalFacingTrait;
|
||||||
use pocketmine\block\utils\SupportType;
|
use pocketmine\block\utils\SupportType;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
@ -37,7 +36,7 @@ use pocketmine\world\BlockTransaction;
|
|||||||
use pocketmine\world\Position;
|
use pocketmine\world\Position;
|
||||||
use function mt_rand;
|
use function mt_rand;
|
||||||
|
|
||||||
class SmallDripleaf extends Transparent implements HorizontalFacing{
|
class SmallDripleaf extends Transparent{
|
||||||
use HorizontalFacingTrait;
|
use HorizontalFacingTrait;
|
||||||
|
|
||||||
protected bool $top = false;
|
protected bool $top = false;
|
||||||
|
@ -23,9 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\block\utils\Colored;
|
|
||||||
use pocketmine\block\utils\ColoredTrait;
|
use pocketmine\block\utils\ColoredTrait;
|
||||||
|
|
||||||
final class StainedGlass extends Glass implements Colored{
|
final class StainedGlass extends Glass{
|
||||||
use ColoredTrait;
|
use ColoredTrait;
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user