diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b33ae2404..9bc4bc073 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,3 +11,8 @@ updates: directory: "/" schedule: interval: daily + +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 214f232d9..0d1553bcb 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -12,16 +12,16 @@ jobs: steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Clone pmmp/PocketMine-Docker repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: pmmp/PocketMine-Docker fetch-depth: 1 @@ -46,7 +46,7 @@ jobs: run: echo ::set-output name=NAME::$(echo "${GITHUB_REPOSITORY,,}") - name: Build image for tag - uses: docker/build-push-action@v2.10.0 + uses: docker/build-push-action@v3.0.0 with: push: true context: ./pocketmine-mp @@ -59,7 +59,7 @@ jobs: - name: Build image for major tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v2.10.0 + uses: docker/build-push-action@v3.0.0 with: push: true context: ./pocketmine-mp @@ -72,7 +72,7 @@ jobs: - name: Build image for minor tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v2.10.0 + uses: docker/build-push-action@v3.0.0 with: push: true context: ./pocketmine-mp @@ -85,7 +85,7 @@ jobs: - name: Build image for latest tag if: steps.channel.outputs.CHANNEL == 'stable' - uses: docker/build-push-action@v2.10.0 + uses: docker/build-push-action@v3.0.0 with: push: true context: ./pocketmine-mp diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 71363897c..eed290607 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -13,17 +13,17 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: Setup PHP - uses: shivammathur/setup-php@2.12.0 + uses: shivammathur/setup-php@2.18.1 with: php-version: 8.0 - name: Restore Composer package cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cache/composer/files @@ -60,7 +60,7 @@ jobs: run: php build/generate-build-info-json.php ${{ github.sha }} ${{ steps.get-pm-version.outputs.PM_VERSION }} ${{ github.repository }} ${{ steps.build-number.outputs.BUILD_NUMBER }} > build_info.json - name: Upload release artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: release_artifacts path: | @@ -69,7 +69,7 @@ jobs: ${{ github.workspace }}/build_info.json - name: Create draft release - uses: ncipollo/release-action@v1.8.6 + uses: ncipollo/release-action@v1.10.0 with: artifacts: ${{ github.workspace }}/PocketMine-MP.phar,${{ github.workspace }}/start.*,${{ github.workspace }}/build_info.json commit: ${{ github.sha }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 896887b49..f501ba425 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ jobs: php: [8.0.18] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup PHP uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440 @@ -46,7 +46,7 @@ jobs: run: curl -sS https://getcomposer.org/installer | php - name: Restore Composer package cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cache/composer/files @@ -72,7 +72,7 @@ jobs: php: [8.0.18] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup PHP uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440 @@ -84,7 +84,7 @@ jobs: run: curl -sS https://getcomposer.org/installer | php - name: Restore Composer package cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cache/composer/files @@ -110,7 +110,7 @@ jobs: php: [8.0.18] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true @@ -124,7 +124,7 @@ jobs: run: curl -sS https://getcomposer.org/installer | php - name: Restore Composer package cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cache/composer/files @@ -150,7 +150,7 @@ jobs: php: [8.0.18] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup PHP uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440 @@ -162,7 +162,7 @@ jobs: run: curl -sS https://getcomposer.org/installer | php - name: Restore Composer package cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cache/composer/files @@ -192,10 +192,10 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup PHP and tools - uses: shivammathur/setup-php@2.15.0 + uses: shivammathur/setup-php@2.18.1 with: php-version: 8.0 tools: php-cs-fixer:3.2 diff --git a/.github/workflows/update-updater-api.yml b/.github/workflows/update-updater-api.yml index 0d8fe3a8a..aaac9b4d2 100644 --- a/.github/workflows/update-updater-api.yml +++ b/.github/workflows/update-updater-api.yml @@ -13,7 +13,7 @@ jobs: - name: Install jq run: sudo apt update && sudo apt install jq -y - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: repository: pmmp/update.pmmp.io ssh-key: ${{ secrets.UPDATE_PMMP_IO_DEPLOY_KEY }} diff --git a/src/entity/EntityFactory.php b/src/entity/EntityFactory.php index 73c33a220..9da6a6a94 100644 --- a/src/entity/EntityFactory.php +++ b/src/entity/EntityFactory.php @@ -173,8 +173,6 @@ final class EntityFactory{ $this->register(Human::class, function(World $world, CompoundTag $nbt) : Human{ return new Human(Helper::parseLocation($nbt, $world), Human::parseSkinNBT($nbt), $nbt); }, ['Human']); - - PaintingMotive::init(); } /** diff --git a/src/entity/object/PaintingMotive.php b/src/entity/object/PaintingMotive.php index a21bba2fc..28b52efe3 100644 --- a/src/entity/object/PaintingMotive.php +++ b/src/entity/object/PaintingMotive.php @@ -24,6 +24,8 @@ declare(strict_types=1); namespace pocketmine\entity\object; class PaintingMotive{ + private static bool $initialized = false; + /** @var PaintingMotive[] */ protected static $motives = []; @@ -76,6 +78,9 @@ class PaintingMotive{ * @return PaintingMotive[] */ public static function getAll() : array{ + if(!self::$initialized){ + self::init(); + } return self::$motives; }