├── googleb0d2f7fd2a8d3d05.html ├── plugin-develop ├── README.md ├── language.md ├── api-versioning.md └── development-faq.md ├── image ├── 0ecfc460-fe8d-41e9-b62f-9c21cff0298e.png ├── d9f2aaa6-3d32-4f49-921c-c0698ff28ea2.png └── e987af6f-2a36-474c-a926-69272498c823.png ├── SUMMARY.md ├── .github ├── ISSUE_TEMPLATE │ ├── typo.md │ ├── -------.md │ ├── ---.md │ └── ----------.md └── workflows │ ├── pages.yml │ └── pre-release-pages.yml ├── plugin ├── README.md └── awesome-plugins.md ├── dictionary └── poggit │ ├── poggit.md │ └── virion.md ├── README.md ├── link.md ├── tutorial └── README.md └── api4 ├── README.md └── changelogs.md /googleb0d2f7fd2a8d3d05.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googleb0d2f7fd2a8d3d05.html -------------------------------------------------------------------------------- /plugin-develop/README.md: -------------------------------------------------------------------------------- 1 | # プラグイン開発の基本 2 | PocketMine-MPはPHP言語により記述されており、プラグインもPHPを使用して作成されます。 3 | 4 | -------------------------------------------------------------------------------- /image/0ecfc460-fe8d-41e9-b62f-9c21cff0298e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defrag-pmmp-info/Defragmentation-of-PocketMine-Information/HEAD/image/0ecfc460-fe8d-41e9-b62f-9c21cff0298e.png -------------------------------------------------------------------------------- /image/d9f2aaa6-3d32-4f49-921c-c0698ff28ea2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defrag-pmmp-info/Defragmentation-of-PocketMine-Information/HEAD/image/d9f2aaa6-3d32-4f49-921c-c0698ff28ea2.png -------------------------------------------------------------------------------- /image/e987af6f-2a36-474c-a926-69272498c823.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/defrag-pmmp-info/Defragmentation-of-PocketMine-Information/HEAD/image/e987af6f-2a36-474c-a926-69272498c823.png -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | - [ようこそ](README.md) 2 | - [チュートリアル](/tutorial/) 3 | - [サーバー構築](/building/) 4 | - [プラグイン](/plugin/) 5 | - [プラグイン開発](/plugin-develop/) 6 | - [API4](/api4/) 7 | - [単項記事](/dictionary/) 8 | - [リンク集](link.md) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/typo.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Typo 3 | about: 入力間違いがあると考えられる箇所の報告・訂正に利用 4 | title: "[Typo]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | # 誤りの報告 11 | 誤りであると考えられる箇所を記載 12 | ... 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/-------.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 誤脱衍字の報告 3 | about: 入力間違いがあると考えられる箇所の報告・訂正に利用 4 | title: "[Typo]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | # 誤りの報告 11 | 誤りであると考えられる箇所を記載 12 | ... 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/---.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 誤情報 3 | about: 誤った内容があるページの報告・訂正に利用 4 | title: "[WRONG]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **誤情報の説明** 11 | 誤った情報がある箇所・内容を記述 12 | 13 | **正しい情報の記述** 14 | 正しい情報の記述や情報源を記述 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/----------.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 新規コンテンツの提案 3 | about: サイトに載せたほうが良いと考えるコンテンツを記述 4 | title: "[Feature]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **載せたほうが良いと考える分野は何ですか?** 11 | コンテンツの分野をできるだけ正確に記述 12 | 13 | **どのように載せるべきであると考えますか?** 14 | 考えを記述 15 | 16 | **その他** 17 | -------------------------------------------------------------------------------- /plugin/README.md: -------------------------------------------------------------------------------- 1 | # プラグイン 2 | プラグインはサーバーそのものにはない機能を追加できるものです。これを用いてゲームサーバーや経済サーバーなどのシステムが構築されています。 3 | 4 | 公開されているプラグインは [リンク集](/link.md)にあるpoggit[[解説](/dictionary/poggit/poggit.md)] やフォーラムなどからダウンロードすることができます。 5 | 6 | ## プラグインの一般的なインストール方法 7 | `(プラグイン名).phar`という形式で配布されているプラグインは一般的にはサーバーがあるディレクトリの内の`plugins`ディレクトリに入れることで動作します。プラグインによっては追加で設定をすることができるものや、そもそも設定しなければ動かないものもあります。 8 | -------------------------------------------------------------------------------- /dictionary/poggit/poggit.md: -------------------------------------------------------------------------------- 1 | # Poggit 2 | PocketMineの公式プラグインレポジトリです。 3 | ここにあるプラグインは以下の二つに分けられます。 4 | 5 | - **Releases** Poggitスタッフに承認されたプラグインがダウンロードでき、評価をつけることもできます。 6 | 7 | - **Dev** 開発中のプラグインがダウンロードできます。動作の確認がされているとは限りません。 8 | 9 | ## 使い方 10 | 11 | ReleasesやDevタブからプラグインを探すことができます。 12 | Relesesでは初期状態ではすべてのプラグインが表示されていますが`All Caregories`となっているプルダウンメニューから自分の探したいジャンル、`All API Versions`となっているメニューから対応するバージョンを絞って探すことができます。 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Defragmentation of PocketMine information 2 | 散っているPocketMine-MPの情報収集やpmmp公式からの情報の翻訳を行い、情報をまとめて掲載します。 3 | 4 | ## 現在掲載してる情報 5 | - **[サーバー構築](/building/)** API3およびAPI4でのサーバー構築について 6 | - **[API4](/api4/)** API4での変更点や関連情報を掲載 7 | - **[プラグイン](/plugin-develop/)** プラグイン開発情報, 現在はAPIバージョニングのみ 8 | - **[単項記事](/dictionary/)** 現在はpoggitとvirion情報の翻訳 9 | 10 | ## Contribute 11 | PRやIssueなどで足りていない情報の補完をしてもらえると助かります。Issueテンプレートを利用してください。 12 | 13 | からmkdocs形式で見られます。 -------------------------------------------------------------------------------- /link.md: -------------------------------------------------------------------------------- 1 | # リンク集 2 | ## バイナリやソースコードの配布先 3 | - [pmmp/PocketMine-MP(GitHub)](https://github.com/pmmp/PocketMine-MP) - Releaseから最新版をダウンロード可能 4 | - [PHP8 Binary](https://dev.azure.com/pocketmine/PHP-Builds/_build?definitionId=3&_a=summary) - publishedから、︙をクリックでダウンロードできます。 5 | 6 | ## ドキュメント 7 | - [公式ドキュメント](https://pmmp.readthedocs.io/en/rtfd) - インストール方法やアップデート方法、プラグインについてやよくある質問を見ることができます。 8 | 9 | ## フォーラム 10 | - [Forums](https://forums.pmmp.io) - 公式フォーラム(英語) 11 | - [MCBEフォーラム](https://forum.mcbe.jp) - 非公式日本語フォーラム 12 | - [マインクラフト非公式フォーラム](https://forum.minecraft.study/) 13 | 14 | ## サーバーリスト 15 | - [MCServers.JP](https://mcservers.jp/) 16 | 17 | 18 | ## プラグイン配布先 19 | - [poggit](https://poggit.pmmp.io/) - レビューされたプラグインやその他開発中のプラグインをダウンロードできます。 20 | -------------------------------------------------------------------------------- /plugin/awesome-plugins.md: -------------------------------------------------------------------------------- 1 | # おすすめプラグインリスト 2 | ここではサーバーの特性や目的に合わせたおすすめのプラグインを掲載します。 3 | 4 | ## 経済プラグイン 5 | お金を追加して経済概念を導入するプラグインです。プラグインによって対応するもの・しないものがあります。 6 | 7 | # [EconomyAPI](https://poggit.pmmp.io/p/EconomyAPI/) 8 | 9 | EconomyAPI系統のプラグインの核をなすプラグインです。これを入れないとほかのEconomyAPI関連プラグインは動作しません。 10 | 11 | ## EconomyS・EconomyAPI系統 12 | - [EconomyLand](https://poggit.pmmp.io/p/EconomyLand/) お金を使って土地を購入できるようにするプラグインです。 13 | - [EconomyShop](https://poggit.pmmp.io/p/EconomyShop/) サーバー側でショップを作れるようになるプラグインです。 14 | - [EconomyPShop](https://poggit.pmmp.io/p/EconomyPShop/) OP以外の人でもショップを開けるようにするプラグインです。[ItemCloud](https://poggit.pmmp.io/p/ItemCloud)というプラグインを導入しないと動作しません。 15 | - [ChestShop](https://poggit.pmmp.io/p/ChestShop/) チェストのGUIに基づいたショップが作成できるプラグインです。 16 | 17 | ## サーバー管理系プラグイン 18 | サーバー自体の管理をできるプラグインです。バックアップ・再起動・プラグインの更新等々。 19 | 20 | ### [Sheep](poggit.pmmp.io/p/Sheep/) 21 | poggit上に存在するプラグインをインストール・アンインストール・更新することができるプラグインです。 22 | セキュリティ上の理由からコンソールからでしか実行できないようになっています。 -------------------------------------------------------------------------------- /.github/workflows/pages.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: update-gh-pages 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: 10 | - master 11 | paths: 12 | - "*.md" 13 | - "**/*.md" 14 | 15 | # Allows you to run this workflow manually from the Actions tab 16 | workflow_dispatch: 17 | 18 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 19 | jobs: 20 | # This workflow contains a single job called "build" 21 | update-pages: 22 | name: Generate github pages for easy viewing 23 | # The type of runner that the job will run on 24 | runs-on: ubuntu-latest 25 | 26 | # Steps represent a sequence of tasks that will be executed as part of the job 27 | steps: 28 | - name: Check out the repo 29 | uses: actions/checkout@v2 30 | with: 31 | fetch-depth: 0 32 | - name: Run action 33 | uses: ldeluigi/markdown-docs@master 34 | with: 35 | src: . 36 | dst: ./gh-pages 37 | language: ja 38 | - name: Deploy GH Pages 39 | uses: peaceiris/actions-gh-pages@v3 40 | with: 41 | github_token: ${{ secrets.GITHUB_TOKEN }} 42 | publish_dir: ./gh-pages 43 | cname: dpmi.f5.si 44 | -------------------------------------------------------------------------------- /.github/workflows/pre-release-pages.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: update-pre-release-gh-pages 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: 10 | - pre-release 11 | paths: 12 | - "*.md" 13 | - "**/*.md" 14 | 15 | # Allows you to run this workflow manually from the Actions tab 16 | workflow_dispatch: 17 | 18 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 19 | jobs: 20 | # This workflow contains a single job called "build" 21 | update-pages: 22 | name: Generate github pre-release pages for easy viewing 23 | # The type of runner that the job will run on 24 | runs-on: ubuntu-latest 25 | 26 | # Steps represent a sequence of tasks that will be executed as part of the job 27 | steps: 28 | - name: Check out the repo 29 | uses: actions/checkout@v2 30 | with: 31 | fetch-depth: 0 32 | - name: Run action 33 | uses: ldeluigi/markdown-docs@master 34 | with: 35 | src: . 36 | dst: ./gh-pages 37 | language: ja 38 | - name: Deploy GH Pages 39 | uses: peaceiris/actions-gh-pages@v3 40 | with: 41 | github_token: ${{ secrets.GITHUB_TOKEN }} 42 | publish_dir: ./gh-pages 43 | destination_dir: pre-release 44 | cname: dpmi.f5.si 45 | -------------------------------------------------------------------------------- /tutorial/README.md: -------------------------------------------------------------------------------- 1 | # Minecraftサーバーについて 2 | xboxマルチプレイやRealmsと異なり、BDSやpmmpといったMinecraftサーバーソフトでは人数上限をより多くした状態でサーバーを開くことができます。 3 | 4 | ただし、サーバーに人を入れるためにはサーバーソフトを起動してPCを起動させたままにする必要があります。常に起動ができない環境であれば、外部のサーバーであるVPSを利用することもできます。 5 | 6 | ## サーバーの種類 7 | MinecraftのBedrockサーバーを立てる場合には以下のソフトウェアが利用できます。 8 | 9 | - **Bedrock Dedicated Server(BDS)** 公式・安定・フル互換 10 | - Minecraft公式によるサーバーソフトです。Minecraftに実装されたすべての機能が利用できます。 11 | - pmmpのプラグインは利用できません。 12 | - Windows/Ubuntu上で動作します。armでは動作しません。 13 | - **PocketMine-MP(pmmp)** 非公式・高機能・一部機能未実装 14 | - 非公式のサーバーソフトです。サーバーに追加機能を加えるプラグインやマルチワールドが利用できます。 15 | - Minecraft本来のすべての機能が使えるわけではありません。pm4では1.12.xまでのBedrockのワールドが利用できます。 16 | - Windows/Mac/Linux/Android上で動作します。 17 | 18 | ## PocketMine-MPでのサーバーの立て方 19 | [サーバーの立て方](/building/README.md)から見ることができます。 20 | 21 | 23 | 24 | 25 | ## サーバーに外部から入れるようにする 26 | 外部からサーバーを入れるためには**ポートフォワーディング**(しばしば**ポート開放**)という作業が必要になります。 27 | ポートフォワーディングというのは外部であるインターネットから来たパケットをサーバーがある内部のネットワークに転送する機能です。 28 | 29 | 自宅サーバーの場合UPnPを利用したり、手動でルーターの設定をいじることでポートフォワーディングすることができます。ただし、ネットワークの問題でできないこともあります。 30 | 31 | VPSの場合は大抵ポートフォワーディングを設定できる画面があるため、そこで変更することでポートフォワーディングすることができます。 32 | 33 | !!! warning 34 | ポートフォワーディングはネットワークに穴を開けるような行為であり、設定によっては危険を伴います。設定がどのように働くかを理解したうえで設定することを推奨します。 35 | 36 | ## Windows10版でサーバー機と同じPCでサーバーに入る 37 | ループバックを有効にすることで入ることができます。 38 | Powershellを開いて 39 | 40 | ```powershell 41 | CheckNetIsolation LoopbackExempt -a -n="Microsoft.MinecraftUWP_8wekyb3d8bbwe" 42 | ``` 43 | を実行します。 44 | 45 | 参考記事: on 2021/11/13 -------------------------------------------------------------------------------- /api4/README.md: -------------------------------------------------------------------------------- 1 | # API4 2 | 3 | ## インストールについて 4 | 現在(2021.10.9) API4.0.0はベータ段階であり、安定版ではありません。テスト目的でのみ使用してください。 5 | インストール方法は以下のページを参考にしてください。 6 | 7 | - (Ubuntu) 8 | - [API4でのサーバー構築](/building/build-in-api4) 9 | 10 | ## 変更点のまとめ(鯖主向け) 11 | このセクションではAPI4での変更点をいくつかまとめて記述します。全訳は[API4 Changelogs全訳](/api4/changelogs)より見られます。 12 | ### 一般 13 | - セキュリティ・荒らし対策に関する変更点 14 | - プラグインのホワイトリスト化・ブラックリスト化ができるようになります。 15 | - RCONやスポーンプロテクションはプラグインに代わりました。 16 | - プレイヤーのアンチ移動チートがなくなります。 17 | - サーバーの動作に関する変更 18 | - チャンク関連のPHP拡張が変更されました。binの変更が必要です。 19 | - リスポーン時のバグが修正されました。 20 | - 21 | ### コマンド 22 | - `/reload`コマンドが無くなりました 23 | - `/effect`, `/enchant`コマンドは数字のIDは受け付けなくなり、英語のIDのみでしか使えません。 24 | - `/gc`,`/status`,`/op`,`/deop`コマンドの表示が日本語化されるようになりました。 25 | 26 | ### 設定 (`pocketmine.yml`) 27 | - `pocketmine.yml`におけるワールドプリセットのキーが`generator`から`preset`に変更されました。 28 | - 新たなオプションが使えるようになります 29 | - `chunk-ticking.blocks-per-subchunk-per-tick` サボテンの成長など、ブロックアップデートの確率 30 | - `network.enable-encryption` pmmp<->Minecraft間のパケットを暗号化するか否か 31 | - `chunk-ticking.light-updates`が削除されました。光処理なしにチャンクチックを進めることができなくなります。 32 | 33 | ### world関連 34 | - 最初のワールド生成時にはスポーン生成がログに表示されるようになります。 35 | - バージョン1.12.xまでのMinecraft Bedrockのワールドがサポートされました。本家からワールドを持ってこれます。 36 | - 非推奨となった`leveldb`以外のワールド形式は`leveldb`に変換されます。 37 | - 建築高さ上限は256になりました。 38 | 39 | ### パフォーマンス 40 | - 保存方式が変わったことによりワールド保存が高速化されました。 41 | - 爆発や光処理が軽くなりました。 42 | - パケット圧縮が高速化されました。ネットワーク全体の性能が向上します。 43 | 44 | ### ロガーの刷新 45 | - 多くのメッセージでプレフィックスが追加されました。 46 | - タイムスタンプがミリ秒まで含むようになります。 47 | 48 | ### ネットワーク 49 | - デフォルトでパケットが暗号化されるようになります。 50 | - エラーチェックが実装されました。例外時にサーバーがクラッシュするようになります。 51 | - `Internal server error`は削除されました。 52 | 53 | ## 開発者向け情報 54 | ### DevTools API4対応版の配布場所 55 | poggit上でダウンロード可 の Build History:master により最新版がダウンロード可能 -------------------------------------------------------------------------------- /plugin-develop/language.md: -------------------------------------------------------------------------------- 1 | # 多言語対応 2 | Poggitでプラグインをリリースする場合やサーバーを多言語対応する場合には`pocketmine\lang\Language`を用いることで比較的楽に対応することができます。また、これによりメッセージ送信部がスマートにできるかもしれません。 3 | 4 | より内容を抜粋。 5 | 6 | ## Languageの利用 7 | 例としてプラグインのディレクトリ構造が以下のようになっているとします。 8 | 9 | ``` 10 | ExamplePlugin 11 | ├ resources 12 | │ └ lang 13 | │   ├ jpn.ini 14 | │   └ eng.ini 15 | ├ src 16 | │ └ ... 17 | └ plugin.yml 18 | ``` 19 | この場合、メインクラスにおいて 20 | ```php 21 | $path = "{$this->getFile()}/resources/lang"; 22 | $language = new Language("jpn",$path); 23 | ``` 24 | とすれば、`$language`にはjpn.iniがロードされた状態になります。 25 | 26 | 例えば、`jpn.ini`の中身が以下のようであったとします。 27 | ```ini 28 | language.name=日本語 29 | test.msg1=Languageの使い方 30 | test.msg2={%0}が{%1}に{%2}を渡しました。 31 | ``` 32 | このとき、上の`$language`では 33 | ```php 34 | $language->translateString("test.msg1") /* -> "Languageの使い方" */; 35 | $language->translateString("test.msg2", ["Steve", "Alex", "スコップ"]) /* -> "SteveがAlexにスコップを渡しました。"*/ 36 | ``` 37 | のようになります。 38 | これを利用して多言語対応を行うことができます。 39 | 40 | なお、`Language`インスタンスの生成はファイルIOを伴うため、実用時には以下のような構成にすると良いでしょう。 41 | 42 | ```php 43 | */ 54 | private array $language = []; 55 | 56 | public function onLoad(): void 57 | { 58 | $path = Path::join($this->getFile(), "resources", "lang"); 59 | foreach(Language::getLanguageList($path) as $lang => $name){ 60 | $this->getLogger()->info("Language: $name is loaded"); 61 | $this->language[$lang] = new Language($lang, $path); 62 | } 63 | } 64 | 65 | public function getLanguage(string $lang=Language::FALLBACK_LANGUAGE): Language{ 66 | return $this->language[$lang]; 67 | } 68 | } 69 | ``` -------------------------------------------------------------------------------- /plugin-develop/api-versioning.md: -------------------------------------------------------------------------------- 1 | # APIバージョニング: API versioning 2 | PocketMine-MPのプラグインはどのAPIバージョンと互換性があるかを宣言する必要があります。これはプラグインをロードするかしないかを決定し、サーバーバージョンと適合しなかったときにデグレードするために用いられます。 3 | 4 | ## APIバージョンシステムの説明 5 | PocketMine-MP 3.0.0現在ではAPIバージョンとサーバーバージョンは一致しています。このバージョンは[semantic major.minor.patch version number](https://semver.org/lang/ja/)で表します。 6 | 7 | ### 定義 8 | Semverは大まかには以下のように定義されます。 9 | - メジャーバージョンアップ: 破壊的な変更 - APIに準じるプラグインが動かなくなるレベルで公開APIが変更される。 10 | - マイナーバージョンアップ: 機能の追加やAPIを破壊しない程度での大きな変更。これはAPIの非推奨化や新しいAPI機能が追加されることも含みうるが以前のマイナーバージョン向けに作られたプラグインは依然として動作する。 11 | - パッチバージョンアップ: 大抵バグ修正。APIの破壊やそのバージョンのものに重大な変更があってはならない。 12 | 13 | PocketMine-MPでは`==.>=.>=`(`bash`表記では`eq.ge.ge`)という条件をAPIバージョンの比較時に用いています。つまりこれは以下のことを表します。 14 | - メジャーバージョンは互換性を持つためには**必ず一致** 15 | - サーバーのマイナーバージョンは、プラグインのマイナーバージョン**以上が必須** 16 | - サーバーのパッチバージョンもまた、プラグインのパッチバージョン**以上が必須** 17 | 18 | PocketMine-MP開発者はいかなる非メージャーバージョンにおいてもプラグインとAPIの互換性がなくならないようにする努力をします。つまり、`3.1.1`を対象に書かれたプラグインは`3.x.y`でも動くはずです。ただし`4.0.0`や将来のメジャーバージョンで動く保証はありません。 19 | 20 | ### 例 21 | | サーバーバージョン | プラグインバージョン | 互換性 | 理由 | 22 | |:---------------|:---------------|:----------:|:-------| 23 | | 4.0.0 | 3.0.0 | 無し | メジャーバージョンが異なる | 24 | | 3.1.0 | 3.0.0 | あり | サーバーがプラグインよりも高いマイナーバージョンを持ち、互換性が保証されるため | 25 | | 3.0.0 | 3.1.0 | 無し | プラグインがそのサーバーバージョンで持っていない機能を要求している | 26 | | 3.0.1 | 3.0.0 | あり | サーバーがプラグインよりも高いパッチバージョンを持ち、互換性が保証されるため | 27 | | 3.0.0 | 3.0.1 | 無し | プラグインがそのサーバーバージョンで持っていないバグ修正を要求している | 28 | 29 | ### サポートするAPIバージョンを選ぶ方法 30 | 必要最小限バージョンを選ぶべきです。例えば必要とする機能が`3.1.0`で追加されているのであれば、現在のサポートされるバージョンが`3.2.0`であっても`3.1.0`を一番小さいバージョンとして要求できます。これによりどのバージョンのPocketMine-MPを使っているかによらずより良いUXを与えることができます。 31 | 32 | もちろん、うまく動作することを保証するためにプラグインを最小限のバージョンでテストする必要があります。しかしながら、もう役目を終えている低いバージョンを要求するというのは意味がないこともあります。 33 | 34 | ### よくある誤解と落とし穴 35 | - APIバージョンは**マジックナンバーではありません**。盲目的にバージョンを変えてもそのバージョン向けになっていなければ**プラグインは勝手に動きません**。 36 | - **APIバージョンはプラグインマニフェスト内で一つずつ書かなければならないものではありません**。**それぞれのメジャーバージョン内で最小のバージョン**のみが要求されます。 37 | - 良い例: `[3.1.0]`(単一の最小のバージョン), `[3.2.0, 4.0.0]`(異なる2つのメジャーバージョンでの最小のバージョン) 38 | - `[3.1.0, 3.1.1, 3.1.2]` - これは望ましく**なく**、余計なバージョンは無視される 39 | - プラグインが**実際に指定したバージョンで動くこと**を確かめてください。a) クラッシュするバージョンや b)期待されるように動作しないバージョンはバージョンリストから除外される必要があります。 40 | 41 | ## 翻訳元 42 | https://github.com/pmmp/DeveloperDocs/blob/b72417c924d0c917eeed6a172415edf7b5b3d52e/api-version-spec.md -------------------------------------------------------------------------------- /dictionary/poggit/virion.md: -------------------------------------------------------------------------------- 1 | # Virion 2 | Poggit Virion(以下Virion)はPocketMineプラグイン専用のPHPライブラリです。 3 | このドキュメントでは、Virionの開発と使用についてのワークフローについての情報を提供します。 4 | 5 | ## Virionの目的 6 | 7 | ソフトウェア開発においてライブラリは素晴らしいものですが、複数のプラグインが同じライブラリを使用する場合、同じPHPランタイムで実行されるために間違ったバージョンのライブラリが使用される可能性があります。Virionフレームワークでは、クラスをシェーディング(名前空間の操作)することでこの問題を解決することを目指しています。 8 | 9 | ## 前置き 10 | 11 | Virionはプラグインや他のVirionによって使用されます。 12 | このドキュメントでは、`Virionユーザ`は、Virionを使用するプラグインまたはVirionを指します。 13 | 14 | ## ワークフロー 15 | 16 | ### Virionの開発 17 | Virionはメインクラスを含む必要はありませんが、virion が宣言するすべてのシンボル (クラス・インターフェース・trait・名前空間関数・名前空間定数) は、**Antigen**と呼ばれるVirionの名前空間、またはAntigenのサブ名前空間の下になければなりません。 18 | Antigenはビリオンに固有のものでなければなりません。 19 | 他のVirionやプラグインは、Antigenの名前空間またはその下位の名前空間の下でシンボルを宣言することはできません。 20 | 21 | 名前空間内に置くことができない他の名前付きグローバルリソースを登録する場合、その名前は、Virionのランタイム名前空間に依存するか、Virionユーザが提供する文字列に依存する必要があります。 22 | 例えば、VirionがAsyncTaskスレッドストアを使用する場合、`AsyncTask::saveToThreadStore()`に渡されるキーは**クラスの構文上の名前空間の参照 ([構文的参照](#構文的参照)) から生成されるか、Virionユーザから渡された値から生成されなければなりません**。 23 | stream_wrapper_register()`も同様のケースで、プロトコル名Virionによってハードコードされてはなりません。 24 | 25 | Virionフレームワークには、`PSR-0`のソースファイルとVirionのマニフェストファイル `virion.yml` が含まれています。 26 | `virion.yml`には以下の属性が含まれます。 27 | 28 | | 名前 | 説明 | 例 | 必須/任意 | 29 | | :---: | :---: | :---: | :---: | 30 | | `name` | 現在は使用されていませんが、Poggitのプロジェクト名と一致する必要があります。 | `libasynql` | 必須 | 31 | | `version` | セマンティック・バージョニングを用いたVirionのバージョン | `0.1.0-beta` | 必須 | 32 | | `antigen` | Antigen(名前空間) | `poggit\libasynql` | 必須 | 33 | | `api` | このVirionが使用できる**唯一**のPocketMine APIのバージョンです。plugin.yml の`api`と同じシステムを使用します。 | `[1.4.0, 2.0.0, 3.0.0-ALPHA1]` | `api`か`php`のどちらか | 34 | | `php` | このVirionが使用できる**唯一**の PHP バージョンです。plugin.ymlの`api` と同様のシステムを使用します。 | `[5.6, 7.0]` | `api`か`php`のどちらか | 35 | | `authors` | 製作者名。文字列かリストが指定できます。 | `[SOFe, PEMapModder]` | 任意 | 36 | | `description` | 説明文 | `Simple asynchronous SQL access` | 任意 | 37 | 38 | 異なるプラグインで使用されている同じVirionが相互に作用してはいけません。 39 | 40 | ### Virionユーザの開発 41 | virion ユーザーは、virion によって宣言されたシンボルが正常にロードされることを前提に開発することができます。ただし、これらのシンボルへのすべての参照は、[構文的](#構文的参照)でなければなりません。 42 | 43 | ### Virionやプラグインのテスト 44 | Virion用テスターの役割を果たすプラグインを作ることが推奨されます。 45 | 46 | Poggitは[DEVirion](https://poggit.pmmp.io/p/DEVirion)を提供しています。詳しい使い方はPoggitのリリースページにあるプラグインの説明を参照してください。 47 | このプラグインを使うと、Phar形式またはフォルダ形式のVirionまたはプラグインでサーバーを動かすことができます。 48 | 49 | **デバッグ以外の理由でDEVirionを使用しないでください**。 50 | DEVirionはvirionのクラスを影で支えているわけではないので、DEVirionを使った複数のプラグインがあっても互換性の問題が発生し、virionフレームワークの意味がなくなってしまいます。 51 | 52 | ### PoggitでVirionをビルドする 53 | Virionプロジェクトは、プラグインプロジェクトと同様にリポジトリの`.poggit.yml`で宣言することができますが、プロジェクト属性が 2 つ追加されます。 54 | 55 | ```yaml 56 | type: library 57 | model: virion 58 | ``` 59 | 60 | 例: 61 | 62 | ```yaml 63 | projects: 64 | libasynql: 65 | path: path/to/libasynql 66 | type: library 67 | model: virion 68 | ``` 69 | 70 | ### ローカルでVirionをビルドする 71 | Virionをローカルで直接コンパイルする公式ツールは作成されていませんが、ビルドスクリプトは簡単に作成することができます。 72 | 73 | 基本的にVirionはプラグインと同じフォーマットですが、4つの違いがあります。 74 | - `plugin.yml`が`virion.yml`になります。 75 | - `resources` はサポートされていません (将来的に追加される可能性があります)。 76 | - `virion.php`というファイルと、`virion_stub.php`というファイルがpharに含まれている必要があります。これらのファイルは、[](https://github.com/poggit/poggit/tree/beta/assets/php/)からダウンロードすることができます。 77 | - `virion_stub.php`はビルド用のCLIを提供します。 78 | - `virion.php`には、実際にVirionを注入するコードが含まれています。 79 | - pharのスタブは`virion.php`を直接読み込む必要があります。以下は有効なスタブの例です。 80 | 81 | ```php 82 | A `T_NAMESPACE` (`namespace`), `T_USE` (`use`) or `T_NS_SEPARATOR` (`\`) token, or `T_USE` + `T_FUNCTION` (`use function`) or `T_USE` + `T_CONST` (`use const`), followed by a consecutive series of `T_STRING` (a non-keyword set of characters, i.e. part of the namespace) and `T_NS_SEPARATOR` (`\`). 133 | 134 | Virionの`クラス`・`関数`・`定数`の名前空間を参照する際には、以下のような形式で**のみ**行うことができます。 135 | 136 | ```php 137 | namespace name\space; 138 | use name\space\Clazz; 139 | use function name\space\func; 140 | use const name\space\CONSTANT; 141 | \name\space\Clazz::method(); 142 | ``` 143 | `poggit\libasynql`というAntigenのVirionの例: 144 | 145 | ```php 146 | // syntactic reference 147 | use poggit\libasynql\SqlResult as Result; 148 | $result = new Result; 149 | 150 | // syntactic reference 151 | $result = new \poggit\libasynql\SqlResult; 152 | 153 | // syntactic reference 154 | use poggit\libasynql\SqlResult as Result; 155 | $class = new \ReflectionClass(Result::class); 156 | 157 | // syntactic reference 158 | $class = new \ReflectionClass(\poggit\libasynql\SqlResult::class); 159 | 160 | // syntactic references, from the scope of a class method in poggit\libasynql\SqlResult 161 | $class = new \ReflectionClass(self::class); 162 | $class = new \ReflectionClass(static::class); 163 | $class = new \ReflectionClass(get_class()); 164 | $class = new \ReflectionClass(__CLASS__); 165 | $class = new \ReflectionClass(__NAMESPACE__ . "\\SqlResult"); // a boundary case barely acceptable 166 | 167 | // non-syntactic reference 168 | $class = new \ReflectionClass("poggit\\libasynql\\SqlResult"); 169 | $class = new \ReflectionClass('poggit\libasynql\SqlResult'); 170 | ``` 171 | 172 | 名前空間からの相対参照はシェーディングされないため、**Virionの名前空間への相対参照は使用しないでください**。例えば、Virion のAntigenが`namespace poggit\libasynql`である場合、Virionユーザでは`namespace poggit`で始まるコードを書いてはいけません。 -------------------------------------------------------------------------------- /plugin-develop/development-faq.md: -------------------------------------------------------------------------------- 1 | # PocketMineプラグイン開発FAQ 2 | このページはプラグイン開発フォーラムでよく聞かれる質問について伝えることを目的にしています。コンテンツの大半はフォーラム上の質の良い投稿からまとめられたもので、参考があればリンクしてあります。 3 | 4 | この元ページにはbitlink でアクセスしてください 5 | 6 | ## 翻訳について(dpmiより) 7 | このページのコンテンツは[PocketMine Plugin Development FAQ](https://bit.ly/PmDev)から翻訳された内容です。元のコンテンツがunlicenseでだったことから、このページの内容もunlicenseとします。 8 | 9 | # PHP 10 | ## Syntax error 構文エラー 11 | これらはPHP自体での問題です。 12 | These are pure PHP problems. [このStackOverflowのページ](http://stackoverflow.com/q/18050071/3990767)を見てください。細かいところまでが書かれています。 13 | 14 | ## ある数字が数字のリストの一つに等しいかを確認する 15 | 日本語で「そのIDは1,2,3,4のいずれかなら」というのは意味が通る内容ですが、PHPで`if($id == [1, 2, 3, 4])`や`if($id == 1 or 2 or 3 or 4)`などのように書くのは間違いです。 16 | 詳細は[このStackOverflowの質問](https://stackoverflow.com/q/21343646/3990767)と、さらに多くの方法を知りたければ[これ](https://stackoverflow.com/q/5593512/3990767)を見てください。 17 | 18 | ## ClassNotFoundException: Class `プラグイン内のクラス` not found 19 | クラスのファイルがPSR-0に基づいておかれているかを確認してください。([ここでチェック](https://sof3.github.io/psr.htm)). 20 | 21 | # Command API 22 | ## How to override a command? 23 | As of API 3.0.0-ALPHA4 and before, you have to first rename the original command into something else using `Command::setLabel`, then remove it from the command map using `Command::unregister`. Then your own command class can be registered to the command map directly. _ref_ from [@iksaku](http://forums.pocketmine.net/thre7ads/overriding-default-7commands.8216/#post-87410) and [@shoghicp](https://gist.github.com/a540360b7323f7cc656f) 24 | 25 | For example, to override the /help command: 26 | 27 | ```php 28 | $map = $server->getCommandMap(); 29 | $old = $map->getCommand("help"); 30 | $old->setLabel("help_disabled"); 31 | $old->unregister($map); 32 | 33 | $new = new MyHelpCommand($this); 34 | $map->register($this->getName(), $new); 35 | $map->register($this->getName(), $new, "?"); 36 | ``` 37 | 38 | ## Custom command usage / autocompletion 39 | In API 2.0.0 to API 3.0.0-ALPHA4, you have to do this for automatic command completion: 40 | The actual command completion part can be done using the "enum_values" option. 41 | 42 | ```php 43 | // Class that extends pocketmine\command\Command 44 | 45 | public function generateCustomCommandData(Player $player) { 46 | $commandData = parent::generateCustomCommandData($player); 47 | $commandData["overloads"]["default"]["input"]["parameters"] = [ 48 | 0 => [ 49 | "type" => "stringenum", 50 | "name" => "parameter", 51 | "optional" => false, 52 | "enum_values" => ["parameter1", "parameter2"] 53 | ], 54 | 1 => [ 55 | "type" => "rawtext", 56 | "name" => "value", 57 | "optional" => true 58 | ], 59 | 2 => [ 60 | "type" => "string", 61 | "name" => "name", 62 | "optional" => true 63 | ] 64 | ]; 65 | 66 | return $commandData; 67 | } 68 | ``` 69 | For more information, refer to https://gist.github.com/NiclasOlofsson/db712fd9e3c9cb0777cd9381cb48915a [_ref_](https://forums.pmmp.io/threads/available-subcommand-parameters-above-command.1841/) 70 | 71 | 86 | 87 | # Scheduler APIとスレッディング 88 | ## タスクをキャンセルするには?(独自・更新) 89 | Use the [`TaskHandler::cancel()`](https://github.com/pmmp/PocketMine-MP/blob/73592349cd29d91b03c2703107db859115a92e2d/src/scheduler/TaskHandler.php#L99)メソッドを利用してください。 90 | 91 | `TaskHandler`はクラス外では`TaskScheduler::scheduleDelayedTask()`や`TaskScheduler::scheduleRepeatingTask()`の返り値として得られます。外部で利用したければ、プロパティに入れておくと良いでしょう。 92 | 93 | またTask内部では`Task::getHandler()`が利用できます。 94 | 95 | 例: 96 | 97 | ```php 98 | class MyTask extends Task{ 99 | public function onRun(int $ticks){ 100 | if(needToCancelTask()){ 101 | $this->getHandler()->cancel(); 102 | } 103 | } 104 | } 105 | ``` 106 | 107 | タスクのスケジュール時にタスクハンドラーを保存しておく: 108 | ```php 109 | $this->taskHandler = $server->getScheduler()->scheduleRepeatingTask($myTask); 110 | // そのあとで…… 111 | $this->taskHandler->cancel 112 | ``` 113 | 114 | ## 数秒以内に行われたイベントをキャンセルするには? 115 | そのような場合にはスケジューラーを使う必要はありません。システム時間の比較によって行うべきです。 116 | 117 | この投稿はまだ整理されていません: 118 | 119 | > ~~Timer~~ スケジューラーとタスクは、一定の時間内の状態を持つわけではなく、一定時間後に動作をするものです。(プレイヤーが10秒間移動できない vs プレイヤーが10秒後に動けるようになる) 120 | 121 | > What is the difference? For the former, "be unfrozen" is the action, while for the latter, "be immobile" is the state. 122 | 123 | > How is a state different from an action? For an action, you do something actively. For example, "kill the player" is an action, but "the player is dead" is a state, a description, a condition. 124 | 125 | > In programming, the things you put in a function are always actions. You change a value, you call a function, you stop the code from executing. How does a condition affect execution? A condition is queried upon when something is executing, and it does not actively executes. Your condition is "cannot move". What executions will query this condition? Of course, you only need to know whether the player can move when the player tries to move. This is, as you said, cancel an event. You handle a PlayerMoveEvent and cancel it if the condition applies. 126 | 127 | > To be most convenient, you can change a value to make a player frozen/unfrozen, but this does not exist in PocketMine (there is Player->blocked, but it has side effects and it isn't very reliable). Therefore, you have to make PocketMine ask you whether the player can move every time the player tries to move. How do you yourself know whether the player can move? You ask yourself whether it is within the 10 seconds you asked for. 128 | 129 | > But the time that code executes changes - how do you know if it is that relative 10 seconds? Therefore, we make the relative time absolute. For example, if I tell you that I typed this sentence in the past minute, you don't know when I typed this sentence. So how do you find it out? You look at the time this post is posted, and minus one miniute, to know what I meant by "in the past minute". Without the post timestamp from the forums? I have to tell you the exact (absolute) date and time, that is, 2016-11-16 17:38:05 UTC+8. 130 | 131 | > Same goes to your code. You write down that "It is now 2016-11-16 17:38:05 UTC+8, and for the next 10 seconds the player can't move". Since time only goes forwards, I can make it even more straightforward: "The player can't move before 2016-11-16 17:38:15 UTC+8". 132 | 133 | > An absolute time can be retrieved using the time() or microtime() function. So, you only store the timestamp for the "unfreeze" time, then in the PlayerMoveEvent handler, you check if the current time is less than the "unfreeze" time. You don't need to check if it is less than the "freeze" time, because time only goes forwards. 134 | 135 | > You don't need to use scheduler tasks at all. 136 | 137 | [_ref_](https://forums.pmmp.io/threads/learning-timer-or-task.57/) 138 | 139 | ## What is different between `scheduleDelayedTask`, `scheduleRepeatingTask`, `scheduleDelayedRepeatingTask` and `scheduleAsyncTask`? 140 | Do not mix them up. There is something called `Task`, where `PluginTask` is a type of `Task`; and there is something called `AsyncTask`, which is entirely irrelevant with `Task`. 141 | 142 | A `Task` can be scheduled to run after some time, which is `scheduleDelayedTask`; or to run repeatedly at given intervals, starting immediately, which is `scheduleRepeatingTask`; or to start running repeatedly after some time, which is `scheduleDelayedRepeatingTask`. The code in `Task` is executed on the main thread. 143 | 144 | ## What is threading? Does it make the server faster? 145 | Threading is like executing code in another machine. Executing code in threads generally won't slow down the server unless you try to mine bitcoins. Each thread executes differently. We call the thread that the server does most of the work the "main thread". If the "main thread" is blocked (stops executing because it has to do something busy), it cannot respond to players, so it looks like the server hangs, or if it is only blocked for short periods, the server is laggy (decrease in TPS). **In simple words, threading is executing in background.** 146 | 147 | An `AsyncTask` is executed in other threads, but an `AsyncTask` is not an independent thread. PocketMine internally has some threads called `AsyncWorker`. Each `AsyncWorker` is an independent thread, which you can think as another CPU. When you `scheduleAsyncTask`, PocketMine adds your new `AsyncTask` to a queue of AsyncTasks called the `AsyncPool`. An `AsyncWorker` will take the oldest `AsyncTask` from the `AsyncPool` and execute it, and then takes and execute the next one from the `AsyncPool`. (Imagine there are a few water pipes removing water from a water pool — the water at the bottom gets removed first) They are still executed on the same machine, possibly on another core (system-dependent, I guess). Using an AsyncTask will not give you infinite CPU, but may facilitate better utilization of all the CPU available. 148 | 149 | You should only use `AsyncTask` to run one-time operations (e.g. usually takes less than 15 seconds to execute). If you are using it to run repeating stuff, such as starting another server (e.g. an HTTP server like Volt or an IRC client like the IRCClient plugin), start a thread instead. Otherwise, you will keep one of the workers busy (the water pipe is stuck), and the server will get one less AsyncWorker available. [_ref_](http://forums.pocketmine.net/threads/how-asynctask-reduces-lag.14056/#post-138729) 150 | 151 | ### AsyncTask: An analogy of a restaurant 152 | In this analogy, a customer = a player, the waiter = main thread, food = some data from the Internet that takes a long time to download, the cook = the code that downloads data 153 | 154 | 1. A customer enters a restaurant and orders some food. 155 | * A player logins and asks the server to download some data from the Internet. 156 | 2. The waiter takes the order. 157 | * The server receives the command to download data. 158 | 3. The waiter writes a note to the cook to prepare the food. 159 | * The server starts an AsyncTask to download the data. While downloading data, the thread can't do anything else. 160 | 4. The waiter continues to serve other customers. 161 | * The server still serves the players, keeping them online, maintaining game mechanics, keep the server ticking, etc. 162 | 5. If the waiter does not ask the cook to prepare the food, but does the cooking himself, (assuming there is only one waiter) the customers will be left unattended, and they will be angry and leave the restaurant. 163 | * If the server downloads data on the main thread instead of in an AsyncTask, the players cannot see any response from the server to what they do, and may eventually timeout. 164 | 6. The waiter occasionally looks if the cook has finished preparing the food. (Looking at the table does not really stop him from serving customers, because it's just a glimpse and takes very little time) 165 | * The server checks if an AsyncTask is completed every tick. 166 | 7. The restaurant has a partition between the kitchen and the dining area, so the waiter and the cook cannot really talk directly. 167 | * Threads in PHP cannot communicate easily. They are often based on message stacks that may only be queried in long intervals. 168 | 8. The cook wants to say "the beef is ready, now preparing the noodles". He writes it on a note, and the waiter reads the note to the customer. 169 | * The AsyncTask announces that "50% downloaded" (using `AsyncTask::publishProgress`). The main thread checks for the progress every tick, and accordingly sends them to the player. 170 | * The main thread code is implemented in `AsyncTask::onProgressUpdate`, but they are actually run on the main thread. 171 | 9. If the food is ready, it is served to the player. 172 | * If the AsyncTask has a result, i.e. the data are downloaded, the data will be processed and the server accordingly reacts to the player. 173 | * The main thread code is implemented in `AsyncTask::onCompletion`, but they are actually run on the main thread. 174 | 175 | _ref_: an ancient post from @PEMapModder that can no longer be found. @SOF3 recited it. 176 | 177 | ## What can be done in AsyncTasks? 178 | **You can't call API methods on a separate thread. This is the undeniable fact; this is by definition of "API methods of PocketMine" and "threads".** The main body (`onRun`) of an AsyncTask is run entirely on a worker thread, and it is **incorrect, if not impossible** to call API methods from `AsyncTask::onRun()`. In addition to system limitations, most API operations you want to run in background actually have a bottleneck in network I/O with players, which cannot be prevented by threading anyway. 179 | 180 | You may _request a delayed call_ of API methods _on the main thread_ from an AsyncTask using `publishProgress()` + `onProgressUpdate()`, or using `onCompletion()`, but **you still cannot call API methods on other threads**, but just on the main thread. You can **pass scalar/serializable data** between threads, and you can _request something to be done upon an object on the main thread_ through a complicated series of scheduling, but you **cannot** do them **directly on other threads**. You may _break down objects and reconstruct them_ in another thread, but **they will not be the same object**, i.e. if you somehow pass the Player object to an AsyncTask (which is actually impossible because it has a Server reference), **it will be a clone**, and _API methods won't work as they usually do_. 181 | 182 | In other threads you may, however, call _static API methods_, such as `Utils::getURL()`, or even construct classes in the PocketMine API; but this is very dangerous, because if you aren't 100% sure what you are doing, you will end up trying to modify some data ineffectively without errors. _PHP builtin functions are not API methods_, but they are **safe to use as long as they don't reference any storage in the main thread**. For example, [`fopen`](https://php.net/fopen) returns a resource, which is actually an integer pointing to a handle stored in the PHP process; this resource ID will mean something probably entirely different if passed to another thread. You can still use resources in other threads, but make sure you don't try to reference resources in the main thread. 183 | 184 | Therefore, **trying to call an API method on other threads will fail silently**. It is not possible, because you aren't calling API methods from _the_ server at all; you are calling them probably on a clone of the server, or a clone of other objects, etc., which **does not affect anything on the main thread**. [_ref_](https://forums.pmmp.io/threads/creating-async-task-and-call-methods-from-api.1000/#post-12255) 185 | 186 | There are two typical uses: 187 | 188 | ### CPU-consuming code 189 | * No, this is not how you call setBlock() in a large loop in world edit. Remember that you cannot execute PocketMine core API stuff in AsyncTask or any other threads. (to be explained below) 190 | * One example is when you want to, say, delete a very big directory (e.g. the .git/ directory of a Git repo with many commits and branches like PocketMine, or the world folder of a map with many generated chunks). That is not related to PocketMine core, but it is time-consuming to run ("lagging the server") (I would consider anything taking more than half a tick, i.e. 25 ms "lagging the server"). You wouldn't expect it to take too much time (like a whole hour) to run, and you may execute it quite frequently. 191 | * For example, you may be copying/deleting a SkyWars map 5 times every 10 minutes). This is when you want to use AsyncTask. AsyncTask wouldn't magically use less CPU. But it executes in another thread, which is like in another process (or is it really in a subprocess/another process? I'm not sure about how pthreads works internally). 192 | So instead of spending the server's core tick time to do stuff that you don't need to get done on the pulse, do it in another thread. 193 | * E.g. you can teleport the player to that world after the copying AsyncTask has completed; you don't need to do that immediately, and maybe your copying task spends 100 milliseconds to run, the player doesn't notice it but your server will lag behind for 2 ticks if you had not used an AsyncTask). 194 | 195 | ### Waiting-blocking 196 | * No, I didn't say waiting for a player to do something. You can simply use the event API or the scheduler API to do that instead of suspending an async worker. 197 | * This refers to thread-blocking function calls, such as curl_exec() (hence `Utils::getURL()` and `Utils::postURL()`). HTTP requests (cURL execution) would lag your server, because it spends most of the time waiting for a response from another server. 198 | * Another example is MySQL queries. You aren't doing anything constructive in the majority time of a query function call. You are simply waiting for MySQL server to read your query, execute it and return a result. 199 | * Why spend all the main thread performance on waiting for a response? 200 | * It would of course be most convenient if you can set your queries/requests to be non-blocking and use a scheduler task to synchronously check if the server has respond. But in cases where you can't, we are simply putting the query aside and get a worker (another thread) stuck instead of getting the main thread stuck. Do you want the waiters look sick or the cooks to look sick, when your clients can see your waiters but not your cooks? 201 | * It doesn't save CPU. It just redistributes the CPU use. 202 | 203 | [_ref_](http://forums.pocketmine.net/threads/how-asynctask-reduces-lag.14056/#post-138729) 204 | 205 | ## Stored local complex data did not remove them after completion 206 | Do not pass anything to the AsyncTask (parent) constructor unless you are going to use them in onCompletion() or onProgressUpdate(). If you do so, you must call fetchLocal() in onCompletion() to remove the data. 207 | 208 | AsyncTask is not a PluginTask. You do not need to pass arguments to it. 209 | 210 | [_ref_](https://forums.pmmp.io/threads/async-task-spam.3163/) 211 | 212 | # Data saving 213 | ## YAML vs SQL 214 | JSON is a subset of YAML. Any valid JSON data can be parsed as YAML. So unless you want to store the data in a compact way (which is pointless for small files, since [the size of each file is always multiples of 4 KB](https://unix.stackexchange.com/q/62049/161897)), YAML seems to always be a better option compared to JSON, unless your data will be parsed by a program that only knows JSON but not YAML. (After all, JSON has a long history but YAML is kind of new, but most languages already have YAML libraries) 215 | 216 | If you have may data for many small units, e.g. a few numbers per player, you won't want to store all the data in the same YAML file, because it's slow. You have to load all the data into memory whenever you do I/O, which may cause memory failure. 217 | 218 | Therefore, to save data for each player, each account should have its own file. However, it creates a large number of files, which many users may dislike. Also, it is inconvenient to evaluate statistics based on all data, e.g. mean, sum, maximum, etc. To do so with YAML, you have to either: 219 | 220 | * Load the data of all units every time. But if you have 100000 players registered, you are in trouble. You have to open a file stream for each unit, read the contents, store them in a list, and close stream. This will lead to very poor performance, especially on personal computers, whose harddisks don't expect you to read so many files at a time. Therefore, this is not a good idea. 221 | * Store the values. If you want a sum, store the sum somewhere and update it every time a datum is added/removed/updated. If you want an average or standard deviation, store the count too and also update it every time data are changed. If you want top 10, a bit trouble. If you want the median, basically you must recalculate all the data every time, unless you otherwise have an index of all numbers somewhere, which isn't per-player storage anymore. [_ref_](http://forums.pocketmine.net/threads/yaml-vs-sql.15091/#post-147453) 222 | 223 | Oh the other hand, SQL has these advantages: 224 | 225 | * All the data are stored in the same file, but the data are accessed using [`fseek`](https://php.net/fseek), which prevents loading unnecessary data. SQL is optimized for various queries, and data are indexed upon request, so it is more efficient. 226 | * Most SQL implementations (e.g. MySQL) have good concurrency support, so multiple servers can access data together without conflict, if you know how to use it. Nevertheless, user-side setup might be slightly inconvenient. 227 | 228 | Of course, the best solution is to let the users pick what database to use and bear their own consequences! See [SimpleAuth](https://github.com/PocketMine/SimpleAuth) for how to support switching between multiple database types. 229 | 230 | # General gameplay 231 | ## Coordinate system 232 | The Minecraft coordinate system complies with a right-handed Cartesian coordinate system, i.e. `x cross y = z`, as in this figure: 233 | 234 | [![See Wikipedia's article on Right-hand Rule](https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Right_hand_rule_cross_product.svg/440px-Right_hand_rule_cross_product.svg.png)](https://en.wikipedia.org/wiki/Right-hand_rule) 235 | 236 | In the Minecraft system, Y (the index finger) points upwards (negative Y points downwards). X points eastwards (negative X goes westwards), and Z points southwards (negative Z goes northwards). 237 | 238 | The sun and moon come out from the east since Pocket Edition 1.1 [_ref_](https://minecraft.gamepedia.com/Day-night_cycle#History). Clouds float westward, too [_ref_](https://minecraft.gamepedia.com/Cloud#Behavior). 239 | 240 | Rotation is measured by yaw (a.k.a. azimuth) and pitch. The yaw is the clockwise rotation from the south, i.e.: 241 | 242 | | Yaw (Degrees), mod 360 | Yaw (Radians), mod 2π | Direction | One step from (x = 0, z = 0) in this direction | 243 | | :---: | :---: | :---: | :---: | 244 | | 0 | 0 | South | (0, 1) | 245 | | 90 | 0.5π | West | (-1, 0) | 246 | | 180 | π | North | (0, -1) | 247 | | 270 | 1.5π | East | (1, 0) | 248 | 249 | Pitch is the downward rotation. Starting at 0 at the horizontal, it increases to 90° (0.5π) when facing the ground, and decreases to -90° (-0.5π) when facing the sky. 250 | 251 | A few cautions: 252 | * The yaw and pitch are represented in degrees in most places in PocketMine, including `Entity::$yaw` and `Entity::$pitch`. 253 | * The yaw is not guaranteed to be within the range `[0, 360)`. Be sure to mod 360 before comparing it. 254 | * PHP's behaviour with `$negative_number % $positive_number` or `fmod($negative_number, $positive_number)`: a negative number is returned. But the yaw can be negative. Be sure to conditionally add 360 to the yaw after `% 360` if it is negative. 255 | * PHP's `%` operator casts floats to ints. This may affect your results slightly. Use `fmod` instead; but it might still produce negative results. 256 | 257 | Here is an alternative to `%`/`fmod` that always produces zero/positive float results: 258 | 259 | ```php 260 | function positive_fmod(float $a, float $b) : float{ 261 | return $a - floor($a / $b) * $b; 262 | } 263 | ``` 264 | 265 | ### Conversion of yaw+pitch to a unit vector [_src_](https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/entity/Entity.php#L1063-L1070) 266 | ```php 267 | $y = -sin(deg2rad($this->pitch)); 268 | $xz = cos(deg2rad($this->pitch)); 269 | $x = -$xz * sin(deg2rad($this->yaw)); 270 | $z = $xz * cos(deg2rad($this->yaw)); 271 | return (new Vector3($x $y, $z))->normalize(); // TODO: verify if normalize() call is needed 272 | ``` 273 | 274 | ### Evaluate yaw and pitch looking from $pos1 to $pos2 [_ref_](https://forums.pmmp.io/threads/direction.2285/#post-23772) 275 | ```php 276 | $diff = $pos2->subtract($pos1)->normalize(); 277 | $pitch = asin(-$diff->y); 278 | $yaw = acos($diff->z / cos($pitch)); 279 | ``` 280 | 281 | *** 282 | ### Legacy 283 | | symbol | meaning | 284 | | :----: | :-----: | 285 | | _ref_ | Content is copied from the linked forum thread | 286 | | _src_ | Content is based on evidence from source code | 287 | 288 | !!! info 289 | 290 | [![Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg?style=plastic)](https://raw.githubusercontent.com/SOF3/forums-common-sense/master/LICENSE) This wiki is community work. 291 | 292 | In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. 293 | 294 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 295 | 296 | For more information, please refer to -------------------------------------------------------------------------------- /api4/changelogs.md: -------------------------------------------------------------------------------- 1 | # API4 Changelogs全訳(41%完了) 2 | ## 訳に関して 3 | 版より翻訳 4 | 5 | 翻訳漏れの無いように気を配りますが、書かれていない項目がある場合PRを送ってもらえると助かります。 6 | 7 | ## 4.0.0-BETA1 8 | 2021.9.7リリース 9 | このメジャーバージョンAPI4は重要なAPIの変更,新しいワールド形式のサポート,パフォーマンスの向上やネットワークの刷新を含めたコア全体の重要な変更に焦点を当てています。 10 | 11 | これはベータリリースであり、最終版でないことを注意してください。 現在からリリースまでに重大な変更はない予定ですがAPIはまだ変更される可能性があります。 12 | 13 | さらに、このチェンジログはベストエフォートに基づいて提供されていて、すべての変更点が言及されていない可能性があることに注意してください。何か洩れがあった場合追加するためにプルリクエストをお願いします。(すなわち pmmp公式へ) 14 | 15 | ### 警告 16 | これは安定版リリースでは**ありません**。PMMPはこのビルドを使用したことによる損害のいかなる責任を負いません。 17 | **テスト**目的にのみ使用してください。 18 | 19 | ### コア 20 | #### 一般 General 21 | - "プラグイングレーリスト"機能が導入されます。ローディング時からプラグインをホワイトリスト化もしくはブラックリスト化することができます。 22 | - Remote Console (RCON) は削除されました。[RconServer](https://github.com/pmmp/RconServer)プラグインが代わりに提供されます。 23 | - スポーンプロテクションは削除されました。[BasicSpawnProtection](https://github.com/pmmp/BasicSpawnProtection)プラグインが代わりに提供されます。 24 | - Ctrl+Cシグナルハンドリングは削除されました。[PcnltSignalHandler]プラグインが代わりに提供されます。 25 | - プレイヤー移動アンチチートは削除されました。 26 | - GS4 QueryはRakLibが無効化されても停止されなくなりました。 27 | - `pocketmine_chunkutils` PHP拡張は使われなくなりました。 28 | - 新しいPHP拡張がこのバージョンから必要になりました。 29 | - [chunkutils2](https://github.com/pmmp/ext-chunkutils2) 30 | - [morton](https://github.com/pmmp/ext-morton) 31 | - プレイヤーリスポーン時の多くのバグが修正されました。 32 | - 生成されていない地形でリスポーンする際に岩盤下にスポーンするバグ 33 | - 非常に遅いマシン上で初回サーバー参加時に岩盤下にスポーンするバグ 34 | - カスタムスポーン地点がセットされている状態でリスポーンしたときにブロック内(または上空)にスポーンするバグ 35 | - プレイヤースポーン地点がワールドスポーンが変わった時に以前の場所になってしまうバグ 36 | - 高い維持コストのわりに恩恵が少ないためプリプロセッサーはビルドから削除されました。現在、プリプロセッサー利用は非推奨です。 37 | 38 | #### コマンド Commands 39 | - `/reload` コマンドは削除されました。 40 | - `/effect` コマンドは数字IDをサポートしなくなりました。現在では名前が要求されます。 41 | - `/enchant` コマンドは数学IDをサポートしなくなりました。現在では名前が要求されます。 42 | - `/clear` コマンドが追加されました。バニラのMinecraftのものと機能的に同等のものです。 43 | - 以下のコマンドの出力は選択した言語にローカライズされました。 44 | - `/gc` 45 | - `/status` 46 | - `/op` 47 | - `/deop` 48 | 49 | #### 設定 Configuration 50 | - ワールドのプリセットは`pocketmine.yml`の`preset`キーとして利用できるようになりました: 以前は`generator`キー 51 | - 新たに以下のオプションが`pocketmine.yml`に追加されます 52 | - `chunk-ticking.blocks-per-subchunk-per-tick`(デフォルト `3`):この値を増加させるとランダムブロックアップデートの確率が上がります。(例. 草の成長) 53 | - `network.enable-encryption`(デフォルト`true`): Minecraftネットワークパケットを暗号化するか否かを決定できます。 54 | - 以下のオプションが`pocketmine.yml`から削除されました。 55 | - `chunk-ticking.light-updates`: 光処理は基本的なバニラの機能を動作させるのに必要なため、チャンクチックを無効化することなくこの機能を停止することは意味がありません。もし、明るさ計算をしたくなければチャンクチックと共に無効化するようにしてください。 56 | - `player.anti-cheat.allow-movement-cheats` 57 | 58 | #### ワールドハンドリング 59 | ##### インターフェイス 60 | - 最初のワールド生成時にスポーン地形チャンク生成の進度が表示されるようになりました。 61 | 62 | ##### 機能 63 | - 1.12.xまでのMinecraft Bedrockのワールドがサポートされました。(1.13より上はまた別の形式変更によりまだ**サポートされていません**。対応には非常に労力を要します。) 64 | - 非推奨のワールド形式の自動変換が実装されました。 65 | - `leveldb`以外のすべての形式は非推奨となりました。以下のワールド形式は**ロード時に自動的に新しい形式に変換されます**: 66 | - `mcregion` 67 | - `anvil` 68 | - `pmanvil` 69 | - 建築上限256はすべてのワールドでサポートされます。(自動変換により) 70 | - 追加ブロックがサポートされます。(自動変換により) 71 | - 光処理はディスク上に保存・ロードされなくなりました。 72 | - かわりに必要に応じてすぐに算出されます。これは以前からあった多くのバグを修正します。 73 | 74 | ##### パフォーマンス 75 | - `leveldb`は現在、基本のサポートされたワールド形式です。優れた設計により生来よりリージョンベース形式よりも高速です。 76 | - 部分的なチャンク保存(変更されたチャンクの子要素のみを保存する)が実装されました。これによりチャンク保存時に書き込む必要のあるデータ量を徹底的に減らすことができます。また、同様に**ワールド保存にかかる時間も徹底的に減らします**。 これは`leveldb`ワールド形式のモジュール設計に可能になりました。リージョンベース形式ではこの強化はできません。 77 | - 光処理はすべてのチャンクで利用可能であるとは限らなくなります。必要に応じてすぐに算出されます。 78 | - `/op`, `/deop`, `/whitelist add` and `/whitelist remove` は理由なくプレイヤーデータを読み込まないようになりました。 79 | - `Timings`はより正確なパフォーマンスメトリクスを収集するため`hrtime()`により提供される高精度なタイマーを使うようになります。 80 | - Z階数曲線(モートンコード)がブロックとチャンク座標のハッシュのために使用されます。これはハッシュテーブルキーハッシュ衝突問題を解決することにより広い範囲でパフォーマンスを非常に改善します。影響がある範囲には爆発や明るさ計算などを含みます。 81 | - [`libdeflate`](https://github.com/ebiggers/libdeflate)が(オプションで)外方向へのMinecraftパケット圧縮に使用できます。これは多くのケースで`zlib`の2倍以上高速で、パケットブロードキャストとネットワーク全体の性能を向上させます。 82 | - クロージャーは現在内部イベントハンドラーの呼び出しのために使用されています。これにより3.xシステムよりも10-20%の性能向上ができます。3.xシステムはイベントコールのたびに動的にコーラブルを解決する必要がありました。 83 | 84 | #### Logger刷新 85 | - 多くのコンポーネントは自動的にプレフィックスをメッセージに追加する専用のロガーを持つようになりました。 86 | - メインロガーはミリ秒のタイムスタンプを含むようになりました。 87 | 88 | 89 | #### ネットワーク 90 | このバージョンではネットワークシステムの重大な変更を組み込んでいます: コヒーレンシ、信頼性、モジュール性の向上をしました。 91 | 92 | ##### Minecraft Bedrock パケット暗号化 93 | - これはハッカーがプレイヤーのログインを盗聴し利用することによる反射攻撃を防ぎます。 94 | - 新たな設定`network.enable-encryption`が`pocketmine.yml`に追加されました。デフォルトでは`true`です。 95 | 96 | ##### パケット受信エラーハンドリングが整備されました 97 | - 今は`BadPacketException`のみがパケットのデコード、ハンドリング時にキャッチされます。これにはすべてのデコードが適切なエラーチェックを行うことが**必須**とされます。 98 | - デコードで`BadPacketException`を投げるとプレイヤーは`Packet processing error`メッセージでキックされます。 99 | - 切断メッセージにはサーバーオーナーがプレイヤーから報告された問題を特定しやすくするためのランダムな16進数IDが含まれます。 100 | - そのほかの例外を投げるとサーバーはクラッシュします。`Internal server error`は削除されました。 101 | - 現在ではサーバーに対するクライアント方向へのパケットの送信は不当なものになりました。これを行うとクライアントは`Unexpected non-serverbound packet`メッセージでキックされます。 102 | 103 | ##### 新たなパケットハンドラーシステム 104 | - パケットハンドラーはネットワークセッションから分離され、専用のパケットハンダラー構造に分かれました。 105 | - ネットワークセッションは正確に1つのハンドラーをその時点で持つことができます。ハンドラーは可変ありいつでも置き換えられます。これによりパケットハンドリングのロジックを複数のステージへと分離することができます。 106 | - 不正なタイミングで不正なパケットを送信することを防ぐ(今では何事もなくドロップされます) 107 | - 一時的な状態固有のロジックの存在を許可する(例えばリソースパックのより厳格なダウンロードチェック) 108 | - パケットハンドラーはほとんどいたるところで`Player`からなくなり、代わりにそのパケットハンドラー専用のユニットに存在しまるようになりました。 109 | - 以前まで`Player`のパケットハンドラー内部に絡み合っていたほぼすべてのゲームロジックは新たなAPIメソッドへと展開されました。詳しくはPlayer APIの変更をご覧ください。 110 | 111 | ### API 112 | #### 一般 113 | - 以前まで`callable`を許容していた大半の個所は、現在では`/Closure`のみを許可します。これはクロージャーがより一貫性のある振る舞いをして性能がより高いためです。 114 | - `void`と`?nullable` パラメータおよび返り値の型指定は多くの箇所に適用されました。 115 | - `pocketmine\metadeta`にあるすべてのものとそれに関連する実装は削除されました。 116 | 117 | 118 | #### `plugin.yml`の変更 119 | ##### パーミッションのネスト 120 | パーミッションのネストは`plugin.yml`内ではサポートされなくなりました。 `plugin.yml`内で(デフォルトにより)パーミッションのグループ化には、非常に混乱しやすく一貫性のないふるまいがありました。 121 | ネストによるパーミッションの宣言の代わりに、宣言はそれぞればらばらになさなければならなりません。 122 | 123 | _Before_: 124 | ```yml 125 | permissions: 126 | pmmp: 127 | default: op 128 | children: 129 | pmmp.something: 130 | default: op 131 | pmmp.somethingElse: 132 | default: op 133 | ``` 134 | 135 | _After_: 136 | ```yml 137 | permissions: 138 | pmmp.something: 139 | default: op 140 | pmmp.somethingElse: 141 | default: op 142 | ``` 143 | 144 | ##### `src-namespace-prefix` 145 | 新しい指示文`src-namespace-prefix`が導入されます。これにより以下のようなプラグイン構造にある無駄なサブディレクトリを取り除くことができます。 146 | 例えば、以前では`pmmp\TesterPlugin\Main`がメインクラスであるようなプラグインはこのような構造でした。 147 | ``` 148 | |-- plugin.yml 149 | |-- src/ 150 | |-- pmmp/ 151 | |-- TesterPlugin/ 152 | |-- Main.php 153 | |-- SomeOtherClass.php 154 | |-- SomeNamespace/ 155 | |-- SomeNamespacedClass.php 156 | ``` 157 | しかし、`src-namespace-prefix:pmmp\TesterPlugin`を`plugin.yml`に付けくわえることで無駄なディレクトリを取り除き、このような構造にすることができます。 158 | ``` 159 | |-- plugin.yml 160 | |-- src/ 161 | |-- Main.php 162 | |-- SomeOtherClass.php 163 | |-- SomeNamespace/ 164 | |-- SomeNamespacedClass.php 165 | ``` 166 | 167 | **ノート**: 昔の構造でもちゃんと動きます。これは必ず変えなければならない変更ではありません。 168 | 169 | ##### Block 170 | - 新たに`VanillaBlocks`クラスが追加されました。このクラスは現在知られているどのブロックタイプでも生成できる静的メソッドを保有しています。 これは定数が使われている場合に`BlockFactory::get()`の代わりとしてしようされることが好ましいです。 171 | - ブロックは`Position`を継承するかわりにポジションを保有します。`Block->getBlockPosition()`が追加されました。 172 | - 256以上のIDをもつブロックがサポートされました。 173 | - ブロックのステートとバリアントメタデータは分離されました。 174 | - バリアントはIDの拡張と考えられ、不変です。(解説:これは回転や開閉といった状態を含まないことを表す) 175 | - `Block->setDamage()`は削除されました。 176 | - すべてのブロックにはブロックプロパティ相応のゲッターとセッターが備わりました。例えば`facing` どの向きか,`lit/unlit` 着火/消火, `colour` 色などです。これらはメタデータの代わりに利用されるべきです。 177 | - タイルエンティティは,タイルエンティティを必要とするブロックが`World->setBlock()`されたときに自動的に作成/削除されるようになります。 178 | - いくつかのタイルエンティティのAPIは,タイルエンティティが非推奨となると同時に対応する`Block`クラスで公開されるようになりました。 179 | - 名前空間`pocketmine\tile`は`pocketmine\block\tile`に移動されました。 180 | - `Block->recalculateBoundingBox()`と`Block->recalculateCollisionBoxes()`は自身の位置基準ではなく`0,0,0`に基準のAABBsを返すようになります。 181 | - ブロックの破壊情報は新しい動的な`BlockBreakInfo`ユニットへと展開されました。以下のメソッドが移動されます。 182 | - `Block->getBlastResistance()` -> `BlockBreakInfo->getBlastResistance()` 183 | - `Block->getBreakTime()` -> `BlockBreakInfo->getBreakTime()` 184 | - `Block->getHardness()` -> `BlockBreakInfo->getHardness()` 185 | - `Block->getToolHarvestLevel()` -> `BlockBreakInfo->getToolHarvestLevel()` 186 | - `Block->getToolType()` -> `BlockBreakInfo->getToolType()` 187 | - `Block->isBreakable()` -> `BlockBreakInfo->isBreakable()` 188 | - `Block->isCompatibleWithTool()` -> `BlockBreakInfo->isToolCompatible()` 189 | - 以下のAPIメソッドが追加されました。 190 | - `Block->asItem()`: ブロックに対応するアイテムスタックを返す。 191 | - `Block->isSameState()`: ステート情報を含めてブロックが同じパラメータであるかを返す。 192 | - `Block->isSameType()`: ステート情報を含めずにブロックが同じパラメータであるかを返す。 193 | - `Block->isFullCube()` 194 | - 以下のフックが追加されました。 195 | - `Block->onAttack()`: サバイバルモードのプレイヤーがブロックを左クリックしブロックの破壊をし始めた時に呼ばれる。 196 | - `Block->onEntityLand()`: エンティティが(高さによらず)落下後にブロック上に乗ったときに呼ばれる。 197 | - `Block->onPostPlace()`: ワールドにおかれた直後に呼ばれ、レール接続やチェストの連結をハンドルする。 198 | - 以下のAPIメソッドがリネームされました。 199 | - `Block->getDamage()` -> `Block->getMeta()` 200 | - `Block->onActivate()` -> `Block->onInteract()` 201 | - `Block->onEntityCollide()` -> `Block->onEntityInside()` 202 | - 以下のAPIメソッドはシグネチャが変わりました。 203 | - `Block->onInteract()` は現在ではシグネチャ `onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null) : bool` を持ちます。 204 | - `Block->getCollisionBoxes()` はファイナルになりました。 子クラスは`recalculateCollisionBoxes()`をオーバーライドするべきです。 205 | - 以下のAPIメソッドは削除されました。 206 | - `Block->canPassThrough()` 207 | - `Block->setDamage()` 208 | - `Block::get()`: これはずいぶん前に `BlockFactory::get()`に置き換えられています。 209 | - `Block->getBoundingBox()` 210 | - 以下のクラスはリネームされました。 211 | - `BlockIds` -> `BlockLegacyIds` 212 | - `CobblestoneWall` -> `Wall` 213 | - `NoteBlock` -> `Note` 214 | - `SignPost` -> `Sign` 215 | - `StandingBanner` -> `Banner` 216 | - 以下のクラスは削除されました。 217 | - `Bricks` 218 | - `BurningFurnace` 219 | - `CobblestoneStairs` 220 | - `Dandelion` 221 | - `DoubleSlab` 222 | - `DoubleStoneSlab` 223 | - `EndStone` 224 | - `GlowingRedstoneOre` 225 | - `GoldOre` 226 | - `Gold` 227 | - `IronDoor` 228 | - `IronOre` 229 | - `IronTrapdoor` 230 | - `Iron` 231 | - `Lapis` 232 | - `NetherBrickFence` 233 | - `NetherBrickStairs` 234 | - `Obsidian` 235 | - `PurpurStairs` 236 | - `Purpur` 237 | - `QuartzStairs` 238 | - `Quartz` 239 | - `RedSandstoneStairs` 240 | - `RedSandstone` 241 | - `SandstoneStairs` 242 | - `Sandstone` 243 | - `StainedClay` 244 | - `StainedGlassPane` 245 | - `StainedGlass` 246 | - `StoneBrickStairs` 247 | - `StoneBricks` 248 | - `StoneSlab2` 249 | - `StoneSlab` 250 | - `Stone` 251 | - `WallBanner` 252 | - `WallSign` 253 | - `Wood2` 254 | - `BlockToolType`の定数は`TYPE_`プレフィックスを削除する形でリネームされました。 255 | 256 | #### Command 257 | - 以下のクラスは削除されました。 258 | - `RemoteConsoleCommandSender` 259 | - 以下のAPIメソッドはシグネチャが変わりました。 260 | - `Command->setPermission()` nullableではありますが、引数が必須になりました 261 | - `CommandSender->setScreenLineHeight()` nullableではありますが、引数が必須になりました 262 | - 名前に空白を含むコマンドはサポートされなくなりました 263 | 264 | #### Entity 265 | ##### 一般 266 | - `Entity`は`Location`を継承しなくなります。 代わりに`Entity->getLocation()`や`Entity->getPosition()`を使ってください。 267 | - 以下のフィールドは削除されました。 268 | - `Entity->chunk`: エンティティはどのチャンクにいるのかを自身では記憶しなくなりました (かわりに`World`がそれを管理します)。 269 | - `Entity->height`: `EntitySizeInfo`に移動しました。 代わりに`Entity->size`を使ってください。 270 | - `Entity->width`: `EntitySizeInfo`に移動しました。 代わりに`Entity->size`を使ってください。 271 | - `Entity->eyeHeight`: `EntitySizeInfo`に移動しました。 代わりに `Entity->size`を使ってください。 272 | - 以下のAPIメソッドが追加されました。 273 | - `Entity->getFallDistance()` 274 | - `Entity->setFallDistance()` 275 | - `ItemEntity->getDespawnDelay()` 276 | - `ItemEntity->setDespawnDelay()` 277 | - `Living->calculateFallDamage()`: これは`protected`です。 サブクラスにより、これをオーバーライドすることでダメージロジックをカスタマイズできます。 278 | - `Human->getHungerManager()` 279 | - `Human->getXpManager()` 280 | - 以下のAPIメソッドはシグネチャが変わりました。 281 | - `Entity->entityBaseTick()`は`protected`になりました。 282 | - `Entity->move()`は`protected`になりました。 283 | - `Entity->setPosition()`は`protected`になりました。 (代わりに `Entity->teleport()`を使ってください). 284 | - `Entity->setPositionAndRotation()`は`protected` (代わりに`Entity->teleport()`を使ってください). 285 | - `Living->knockBack()`は`float, float, float`を受け入れるようになりました。 (最初の2つのパラメーターは削除されました). 286 | - `Living->getEffects()`は`Effect[]`の代わりに`EffectManager`を返すようになりました。 287 | - 以下のクラスは追加されました。 288 | - `effect\EffectManager`: `Living`から展開されたエフェクト管理の機能群を保持します。 289 | - `HungerManager`: `Human`から展開された空腹管理の機能群を保持します。 290 | - `ExperienceManager`: `Human`から展開された経験値管理の機能群を保持します。 291 | - 以下のAPIメソッドは移動、またはリネームされました。 292 | - `Entity->fall()` -> `Entity->onHitGround()` (また、アクセス権が`public`から`protected`になりました。) 293 | - `Living->removeAllEffects()` -> `EffectManager->clear()` 294 | - `Living->removeEffect()` -> `EffectManager->remove()` 295 | - `Living->addEffect()` -> `EffectManager->add()` 296 | - `Living->getEffect()` -> `EffectManager->get()` 297 | - `Living->hasEffect()` -> `EffectManager->has()` 298 | - `Living->hasEffects()` -> `EffectManager->hasEffects()` 299 | - `Living->getEffects()` -> `EffectManager->all()` 300 | - `Human->getFood()` -> `HungerManager->getFood()` 301 | - `Human->setFood()` -> `HungerManager->setFood()` 302 | - `Human->getMaxFood()` -> `HungerManager->getMaxFood()` 303 | - `Human->addFood()` -> `HungerManager->addFood()` 304 | - `Human->isHungry()` -> `HungerManager->isHungry()` 305 | - `Human->getSaturation()` -> `HungerManager->getSaturation()` 306 | - `Human->setSaturation()` -> `HungerManager->setSaturation()` 307 | - `Human->addSaturation()` -> `HungerManager->addSaturation()` 308 | - `Human->getExhaustion()` -> `HungerManager->getExhaustion()` 309 | - `Human->setExhaustion()` -> `HungerManager->setExhaustion()` 310 | - `Human->exhaust()` -> `HungerManager->exhaust()` 311 | - `Human->getXpLevel()` -> `ExperienceManager->getXpLevel()` 312 | - `Human->setXpLevel()` -> `ExperienceManager->setXpLevel()` 313 | - `Human->addXpLevels()` -> `ExperienceManager->addXpLevels()` 314 | - `Human->subtractXpLevels()` -> `ExperienceManager->subtractXpLevels()` 315 | - `Human->getXpProgress()` -> `ExperienceManager->getXpProgress()` 316 | - `Human->setXpProgress()` -> `ExperienceManager->setXpProgress()` 317 | - `Human->getRemainderXp()` -> `ExperienceManager->getRemainderXp()` 318 | - `Human->getCurrentTotalXp()` -> `ExperienceManager->getCurrentTotalXp()` 319 | - `Human->setCurrentTotalXp()` -> `ExperienceManager->setCurrentTotalXp()` 320 | - `Human->addXp()` -> `ExperienceManager->addXp()` 321 | - `Human->subtractXp()` -> `ExperienceManager->subtractXp()` 322 | - `Human->getLifetimeTotalXp()` -> `ExperienceManager->getLifetimeTotalXp()` 323 | - `Human->setLifetimeTotalXp()` -> `ExperienceManager->setLifetimeTotalXp()` 324 | - `Human->canPickupXp()` -> `ExperienceManager->canPickupXp()` 325 | - `Human->onPickupXp()` -> `ExperienceManager->onPickupXp()` 326 | - `Human->resetXpCooldown()` -> `ExperienceManager->resetXpCooldown()` 327 | - 以下のAPIメソッドは削除されました。 328 | - `Human->getRawUniqueId()`は、代わりに`Human->getUniqueId()->toBinary()`を使うようになりました。 329 | - 以下のクラスは削除されました。 330 | - `Creature` 331 | - `Damageable` 332 | - `Monster` 333 | - `NPC` 334 | - `Rideable` 335 | - `Vehicle` 336 | - `Skin`無効なデータを受け取ると例外を投げるようになりました。 337 | 338 | ##### Effect 339 | - 全ての`Effect`に関連したクラスは`pocketmine\entity\effect`の名前空間に移動しました。 340 | - `Effect`クラスに入っていたエフェクト機能はいくつかのクラスに分けられました。以下のクラスが新しく追加されました。 341 | - `AbsorptionEffect` 342 | - `HealthBoostEffect` 343 | - `HungerEffect` 344 | - `InstantDamageEffect` 345 | - `InstantEffect` 346 | - `InstantHealthEffect` 347 | - `InvisibilityEffect` 348 | - `LevitationEffect` 349 | - `PoisonEffect` 350 | - `RegenerationEffect` 351 | - `SaturationEffect` 352 | - `SlownessEffect` 353 | - `SpeedEffect` 354 | - `WitherEffect` 355 | - `VanillaEffects`クラスが追加されました。これは全てのバニラエフェクトタイプを静的メソッドで表現し、`Effect::getEffect()`よりもきれいに書けるようになります。 356 | - 例: `Effect::getEffect(Effect::NIGHT_VISION)`は`VanillaEffects::NIGHT_VISION()`に置き換えることができます。 357 | - エフェクトの強さ(amplifiers)を負の値にすることは現在では明確に禁止されます。エフェクトの生み出す効果が定義されていないためです。 358 | - MCPEのエフェクトIDとPocketMine-MP内部のIDの境目がより明確になりました。 359 | - IDハンドリングは`pocketmine\data\bedrock\EffectIdMap`へ移動しました。 360 | - すべてのエフェクトID定数は`Effect`から削除されました。何らかの理由でレガシーエフェクトIDが必要なら`pocketmine\data\bedrock\EffectIds`を利用してください。 361 | - 以下のAPIメソッドは移動しました。 362 | - `Effect->getId()` -> `EffectIdMap->toId()` 363 | - `Effect::registerEffect()` -> `EffectIdMap->register()` 364 | - `Effect::getEffect()` -> `EffectIdMap->fromId()` 365 | - `Effect::getEffectByName()` -> `VanillaEffects::fromString()` 366 | - 以下のAPIメソッドが追加されました。 367 | - `Effect->getRuntimeId()`: これは**動的ID**でありエフェクトタイプの比較に用いることができます。**これは決して保持されないため、configやNBTでは利用しないでください!** 368 | 369 | ##### 実行時エンティティNBTの削除 370 | - エンティティは実行時にNBTを存在させ続けなくなりました。 371 | - `Entity->namedtag`は削除されました。 372 | - `Entity->saveNBT()`はその場で前のNBTに変更を加えるのではなく、現在では新規生成された`CompoundTag`を返すようになりました。 373 | - `Entity->initEntity()`は現在では`CompoundTag`パラメータを受け付けます。 374 | 375 | ##### エンティティ生成 376 | - `Entity::createEntity()`は削除されました。もはや実行時に新たなエンティティを生成するためには必要なくなりました。代わりに、単に`new YourEntity`のようにしてください。 377 | - `Entity`の子クラスのコンストラクタは普通のクラスと同様にどのようなシグネチャでも持つことができます。 378 | - NBTからのエンティティの読み込みは現在では`EntityFactory`にハンドルされるようになりました。`Entity::createEntity()`の動作とはかなり違った動作をします。 `YourEntity::class`を一式のMinecraft save IDに登録する代わりに、 あるNBTと`World`が与えられたときにエンティティを構築するコールバックを与える必要があります。 379 | - 生成コールバックは`EntityFactory::register()`を用いて登録されます。 380 | - 生成コールバックはシグネチャ`function(World, CompoundTag) : Entity`を持つ必要があります。 381 | - これにより`Entity`の子クラスはそれぞれにふさわしいコンストラクタ引数を持てるようになりました。 382 | - また、特定のデータが常に与えられるように要求することも可能になります。(例えば、`FallingBlock`をどの種類のブロックかを指定することなく生成するというのは理解できません。) 383 | - 例: 384 | - `ItemEntity`は現在では`Item`をコンストラクタで要求するようになりました。そのため、生成コールバックは`Item`をコンストラクタに渡されたNBTからデコードするものです。 385 | - `Painting`は現在では`PaintingMotive`をコンストラクタで要求するようになりました。そのため、生成コールバックはどの`PaintingMotive`を与えるべきかを受け取ったNBTに応じて決定するものです。 386 | - さらなる例は`EntityFactory`をご覧ください。 387 | - `EntityFactory::register()`(以前の`Entity::registerEntity()`)はエラー発生時に`false`のかわりに例外を投げるようになりました。 388 | - 以下のAPIメソッドが移動しました。 389 | - `Entity::registerEntity()` -> `EntityFactory::register()` 390 | - 以下のクラスはコンストラクタが変更されました。 391 | - すべての発射物の子クラスは現在では`?Entity $thrower`パラメータを必要とします。 392 | - `Arrow->__construct()`は現在では`bool $critical` パラメータを必要とします。 393 | - `ExperienceOrb->__construct()`は現在では`int $xpValue`パラメータを必要とします。 394 | - `FallingBlock->__construct()`は現在では`Block $block`パラメータを必要とします。 395 | - `ItemEntity->__construct()`は現在では`Item $item`パラメータを必要とします。 396 | - `Painting->__construct()`は現在では`PaintingMotive $motive`を必要とします。 397 | - `SplashPotion->__construct()`は現在では`int $potionId`を必要とします。 398 | - 以下のAPIメソッドは削除されました。 399 | - `Entity::createBaseNBT()`: `new YourEntity`と適切なAPIメソッドが利用されるべきです。 400 | - `Entity->getSaveId()` 401 | - `Entity::getKnownEntityTypes()` 402 | - `Entity::createEntity()`: `new YourEntity`をかわりに利用してください。 403 | 404 | ##### やりかけ エンティティのネットワークメタデータの削除 405 | - 定数に関するすべてのネットワークメタデータは`Entity`クラスから削除され、プロトコル層へ移動されました。これはネットワークメタデータをAPIから全体的に削除することを意図していますが、完了はしていません。 406 | - 定数`Entity::DATA_FLAG_*`は`pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags`に移動されました。 407 | - 定数`Entity::DATA_TYPE_*`は`pocketmine\network\mcpe\protocol\types\entity\EntityMetadataTypes`に移動されました。 408 | - 定数`Entity::DATA_*`は`pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties`に移動されました。 409 | - `DataPropertyManager`は 名前空間`pocketmine\network\mcpe\protocol\types\entity`に移動され、したがってAPIの一部ではないものとして扱われます。 410 | - 導入された内部の`Entity`は`syncNetworkData()`をフックします。この関数はエンティティのプロパティをエンティティはエンティティのネットワークデータセット同期することが期待されます。 411 | - 内部のエンティティのプロパティを保存するためのネットワークメタデータセットの内部利用は削除されました。エンティティは現在では正規のクラスプロパティを使用し、ネットワークデータセットを同期することが期待されます。 412 | - `Entity->propertyManager`は`Entity->networkProperties`にリネームされました。 413 | - `Entity->getDataPropertyManager()`は`Entity->getNetworkProperties()`にリネームされました。 414 | 415 | #### Event 416 | ##### 内部イベントシステムにおける`Listener`依存の排除 417 | - 内部イベント処理システムは`Listener`オブジェクトに依存しなくなりました。ハンドラーになるための標準要求さえ満たせば任意のクロージャーが利用できます。 418 | - この変更により、イベントハンドラーの呼び出し性能が15%程改善されます。プラグインが行っていることは何も含まれません。 419 | - 以下のクラスが削除されました。 420 | - `pocketmine\plugin\EventExecutor` 421 | - `pocketmine\plugin\MethodEventExecutor` 422 | - `RegisteredListener->__construct()`は先頭のパラメータとして`Listener, EventExecutor`の代わりに`Closure`を必要とします。 423 | - `RegisteredListener->getListener()`は削除されました。 424 | 425 | ##### デフォルトのキャンセルハンドリングの振る舞いの変化 426 | - ハンドラー関数は**デフォルトではキャンセルされたイベントを受け取らなくなります**。 これは**静かに後方互換性を損なうもの**であり、すなわち直接エラーを吐くことはなくともバグを引き起こす可能性があります。 427 | - `@ignoreCancelled`は無視されるようになりました。 428 | - `@handleCancelled`が追加されました。これを用いるとキャンセルされたイベントを _受け取る_ ことができるようになります。(`@ignoreCancelled`の反対です) 429 | 430 | 431 | ##### `PlayerPreLoginEvent`の変更 432 | - `Player`オブジェクトはログインのこのフェーズでは存在しなくなりました。代わりに`PlayerInfo`オブジェクトが接続情報とともに与えられます。 433 | - Ban、サーバーの満員、ホワイトリストの確認は`PlayerPreLoginEvent`に一元化されます。もはやこの手の切断をハンドルするために`PlayerKickEvent`に介入する必要はなくなるとともに、介入することはできなくなりました。 434 | - 複数のキック理由を使用すると、他にプレイヤーを切断する理由があって内一つが除外されたときにもプレイヤーを確実に切断することができます。例えばあるプレイヤーがBanされていてサーバーが満員であったとすると、Banフラグを除外してもサーバーが満員であることからプレイヤーはそれでも切断されます。 435 | - プラグインはカスタムのキック理由をセットできます。どの理由も絶対的な優先度を持ちます。 436 | - もし複数のフラグがセットされていた場合、キックメッセージには最も優先度が高いものが表示されます。優先度(このスナップショットにおいて)は下記の順に続きます。 437 | - カスタム (最優先) 438 | - 満員 439 | - ホワイトリスト 440 | - Ban 441 | - `PlayerPreLoginEvent::KICK_REASON_PRIORITY`定数は高いほうが先にくるキック理由の優先度のリストを保持します。 442 | - 以下の定数が追加されました 443 | - `PlayerPreLoginEvent::KICK_REASON_PLUGIN` 444 | - `PlayerPreLoginEvent::KICK_REASON_SERVER_FULL` 445 | - `PlayerPreLoginEvent::KICK_REASON_SERVER_WHITELISTED` 446 | - `PlayerPreLoginEvent::KICK_REASON_BANNED` 447 | - `PlayerPreLoginEvent::KICK_REASON_PRIORITY` 448 | - 以下のAPIメソッドが追加されました。 449 | - `PlayerPreLoginEvent->clearAllKickReasons()` 450 | - `PlayerPreLoginEvent->clearKickReason()` 451 | - `PlayerPreLoginEvent->getFinalKickMessage()`: 現在の理由リストでプレイヤーに表示されるメッセージ 452 | - `PlayerPreLoginEvent->getIp()` 453 | - `PlayerPreLoginEvent->getKickReasons()`: キック理由を示すフラグの配列, 参加できる時には空 454 | - `PlayerPreLoginEvent->getPlayerInfo()` 455 | - `PlayerPreLoginEvent->getPort()` 456 | - `PlayerPreLoginEvent->isAllowed()` 457 | - `PlayerPreLoginEvent->isAuthRequired()`: XBL認証が強制されているか 458 | - `PlayerPreLoginEvent->isKickReasonSet()` 459 | - `PlayerPreLoginEvent->setAuthRequired()` 460 | - `PlayerPreLoginEvent->setKickReason()` 461 | - 以下のAPIメソッドは変更されました。 462 | - `PlayerPreLoginEvent->getKickMessage()`は現在ではシグネチャ`getKickMessage(int $flag) : ?string`を持ちます。 463 | - 以下のAPIメソッドは削除されました。 464 | - `PlayerPreLoginEvent->setKickMessage()` 465 | - `PlayerPreLoginEvent->getPlayer()` 466 | - 以下のAPIメソッドは移動/リネームされました。 467 | - `InventoryPickupItemEvent->getItem()` -> `InventoryPickupItemEvent->getItemEntity()` 468 | 469 | ##### その他の変更 470 | - イベントの間にプレイヤーが切断されてもサーバーはクラッシュしなくなりました。(それでも他の副作用を引き起こす可能性があります) 471 | - `PlayerKickEvent`は最初のログインシークエンスが完了する以前に発生した切断では着火されなくなりました。(例 リソースパックのダウンロード完了時) 472 | - キャンセル可能なイベントはインターフェースの要件を満たすために必要なキャンセル可能なコンポーネントを得るための`CancellableTrait`を実装する必要があります。`Event`はこれらのメソッドをスタブを持たなくなりました。 473 | - `PlayerInteractEvent`はプレイヤーがアイテムをアクティベートしたときに着火されなくなりました。これは古くからの問題であった`PlayerInteractEvent`が一回触った時にも繰り返し発火されてしまう問題を修正します。以下の定数は削除されました。 474 | - `PlayerInteractEvent::LEFT_CLICK_AIR` 475 | - `PlayerInteractEvent::RIGHT_CLICK_AIR` 476 | - `PlayerInteractEvent::PHYSICAL` 477 | - 以下のイベントが追加されます。 478 | - `PlayerEntityInteractEvent`: プレイヤーがエンティティを右クリック(スマホでは長押し)した時のイベント 479 | - `PlayerItemUseEvent`: プレイヤーが持っているアイテムをアクティベートした時のイベント, 例えば雪玉を投げるなど。 480 | - `BlockTeleportEvent`: ブロックがテレポートした時のイベント、例えばエンドラの卵が攻撃されたときなど。 481 | - `PlayerDisplayNameChangeEvent` 482 | - `EntityItemPickupEvent`: プレイヤーやエンティティが落ちているアイテム(か矢)を拾った時のイベント。 `InventoryPickupItemEvent`と`InventoryPickupArrowEvent`の置き換え 483 | - 置き換え前とは違って、アイテムが入るインベントリを変更することができます。 484 | - もし入るインベントリを`null`にすると、アイテムは破棄されます。これはインベントリが満杯の状態でクリエイティブのプレイヤーが拾うときに見られる動作です。 485 | - `EntityTrampleFarmlandEvent`: 農地上でmobやプレイヤーがジャンプをして土に変化させるときのイベント。 486 | - `StructureGrowEvent`: 木や竹、その他の複数ブロックの苗木構造物が成長するときに呼ばれます。 487 | - 以下のイベントは削除されました。 488 | - `EntityArmorChangeEvent` 489 | - `EntityInventoryChangeEvent` 490 | - `EntityLevelChangeEvent` - `EntityTeleportEvent`にてワールドの確認をすることで代用してください。 491 | - `InventoryPickupItemEvent` - `EntityItemPickupEvent`を代わりに使用してください。 492 | - `InventoryPickupArrowEvent` - `EntityItemPickupEvent`を代わり使用してください。 493 | - `NetworkInterfaceCrashEvent` 494 | - `PlayerCheatEvent` 495 | - `PlayerIllegalMoveEvent` 496 | - 以下のAPIメソッドが追加されました。 497 | - `EntityDeathEvent->getXpDropAmount()` 498 | - `EntityDeathEvent->setXpDropAmount()` 499 | - `PlayerDeathEvent->getXpDropAmount()` 500 | - `PlayerDeathEvent->setXpDropAmount()` 501 | - 以下のメソッドは削除されました。 502 | - `PlayerPreLoginEvent->getPlayer()` 503 | - `Cancellable->setCancelled()`: これにより`Cancellable`実装はそのイベント特有のキャンセル機構を実装できるようになりました。例えば`PlayerPreLoginEvent`における複雑な機構などです。 504 | - 以下のAPIメソッドは移動されました。 505 | - `Event->isCancelled()` -> `CancellableTrait->isCancelled()`: これはクラスが`Cancellable`を実装していなかった場合に`BadMethodCallException`を投げるスタブでした。これは現在ではキャンセル不可能なイベントでは単に使えなくなっています。 506 | - `Event->setCancelled()`は`cancel()`と`uncancel()`に分割され、`CancellableTrait`に移動しました。 507 | - `HandlerList::unregisterAll()` -> `HandlerListManager->unregisterAll()` 508 | - `HandlerList::getHandlerListFor()` -> `HandlerListManager->getListFor()` 509 | - `HandlerList::getHandlerLists()` -> `HandlerListManager->getAll()` 510 | - 以下のクラスは移動しました。 511 | - `pocketmine\plugin\RegisteredListener` -> `pocketmine\event\RegisteredListener` 512 | 513 | #### Inventory 514 | - すべてのクラフトとレシピに関するクラスは名前空間`pocketmine\crafting`に移動しました。 515 | - 以下のクラスが追加されました。 516 | - `CallbackInventoryChangeListener` 517 | - `CreativeInventory`: 以前まで`pocketmine\item\Item`に埋め込まれていた機能群を含みます。詳細はアイテムの変更をご覧ください 518 | - `InventoryChangeListener`: 一つのインベントリのイベントを監視できます(ただし介入はできません)。 519 | - `transaction\CreateItemAction` 520 | - `transaction\DestroyItemAction` 521 | - 以下のクラスはリネーム/移動されました。 522 | - `ContainerInventory` -> `pocketmine\block\inventory\BlockInventory` 523 | - 以下のクラスは名前空間`pocketmine\block\inventory` に移動されました。 524 | - `AnvilInventory` 525 | - `ChestInventory` 526 | - `DoubleChestInventory` 527 | - `EnchantInventory` 528 | - `EnderChestInventory` 529 | - `FurnaceInventory` 530 | - 以下のクラスは削除されました。 531 | - `CustomInventory` 532 | - `InventoryEventProcessor` 533 | - `Recipe` 534 | - `transaction\CreativeInventoryAction` 535 | - 以下のAPIメソッドが追加されました。 536 | - `Inventory->addChangeListeners()` 537 | - `Inventory->getChangeListeners()` 538 | - `Inventory->removeChangeListeners()` 539 | - `Inventory->swap()`: 二つのスロットのコンテンツを入れ替えます。 540 | - 以下のAPIメソッドは削除されました。 541 | - `BaseInventory->getDefaultSize()` 542 | - `BaseInventory->setSize()` 543 | - `Inventory->close()` 544 | - `Inventory->dropContents()` 545 | - `Inventory->getName()` 546 | - `Inventory->getTitle()` 547 | - `Inventory->onSlotChange()` 548 | - `Inventory->open()` 549 | - `Inventory->sendContents()` 550 | - `Inventory->sendSlot()` 551 | - `InventoryAction->onExecuteFail()` 552 | - `InventoryAction->onExecuteSuccess()` 553 | - `PlayerInventory->sendCreativeContents()` 554 | - 以下のAPIメソッドはシグネチャが変更されました。 555 | - `Inventory->clear()`は`bool`の代わりに現在では`void`を返します。 556 | - `Inventory->setItem()`は`bool`の代わりに現在では`void`を返します。 557 | - `InventoryAction->execute()`は`bool`の代わりに現在では`void`を返します。 558 | - `BaseInventory->construct()`は初期化用のアイテムリストを受け取らなくなりました。 559 | - `PlayerInventory->setItemInHand()`は現在ではそのプレイヤーが見える人にアイテム更新を送信します。 560 | 561 | #### Item 562 | ##### General 563 | - 新たに`VanillaItems`クラスが追加されました。すべての既知のアイテムタイプを生成する静的メソッドを含んでいます。これは定数が使われている`ItemFactory::get()`の代わりとして使われることが好ましいです。 564 | - `StringToItemParser`が追加されました。あらゆる文字列をIDに関係なくアイテムへとマッピングすることができるようになりました。これらのマッピングは`/give`と`/clear`で使われていて、プラグインでのカスタムエイリアスを念頭に置いて作られています。 565 | - つまり、見苦しいハックなしに`/give`のカスタムエイリアスが追加できるようになったということです。 566 | - `LegacyStringToItemParser`が追加されました。これは少しだけ動的な(しかし推奨はされない)`ItemFactory::fromString()`の置き換えです。 567 | - `Item->count`はアクセス権がpublicから変更されました。 568 | - 書き込める本(本と羽ペン,記入済みの本)のヒエラルキーが変更されました。`WritableBook`と`WrittenBook`は現在では`WritableBookBase`を継承します。 569 | - 以下のAPIはシグネチャが変更されました。 570 | - `WritableBookBase->setPages()`は現在では`CompoundTag[]`の代わりに`WritableBookPage[]`を受け付けます。 571 | - `ItemFactory::get()`は`string`を`tags`パラメータとして受け付けなくなりました。 572 | - `ItemFactory::fromString()`は`$multiple`パラメータを受け取らなくなり、`Item|Item[]`ではなく`Item`のみを返すようになりました。 573 | - 以下のメソッドはメソッドチェーンが利用できるようになりました。(原文: The following methods are now fluent) 574 | - `WritableBookBase->setPages()` 575 | - `Item->addEnchantment()` 576 | - `Item->removeEnchantment()` 577 | - `Item->removeEnchantments()` 578 | - `Armor->setCustomColor()` 579 | - `WrittenBook->setTitle()` 580 | - `WrittenBook->setAuthor()` 581 | - `WrittenBook->setGeneration()` 582 | - 以下のAPIメソッドは削除されました。 583 | - `Item->getNamedTagEntry()` 584 | - `Item->removeNamedTagEntry()` 585 | - `Item->setDamage()`: 現在では`Durable`を実装しているアイテム以外ではダメージは不変です。 586 | - `Item->setNamedTagEntry()` 587 | - `Item::get()`: これはずいぶん前に`ItemFactory::get()`にとってかわられました。 588 | - `Item::fromString()`: これはずいぶん前に`ItemFactory::fromString()`にとってかわられました。 589 | - `Item->setCompoundTag()` 590 | - `Item->getCompoundTag()` 591 | - `Item->hasCompoundTag()` 592 | - `Potion::getPotionEffectsById()` 593 | - `ProjectileItem->getProjectileEntityType()` 594 | - 以下の定数は削除されました。 595 | - `Potion::ALL` - `PotionType::getAll()`を代わりに使ってください。 596 | - `Potion::WATER` 597 | - `Potion::MUNDANE` 598 | - `Potion::LONG_MUNDANE` 599 | - `Potion::THICK` 600 | - `Potion::AWKWARD` 601 | - `Potion::NIGHT_VISION` 602 | - `Potion::LONG_NIGHT_VISION` 603 | - `Potion::INVISIBILITY` 604 | - `Potion::LONG_INVISIBILITY` 605 | - `Potion::LEAPING` 606 | - `Potion::LONG_LEAPING` 607 | - `Potion::STRONG_LEAPING` 608 | - `Potion::FIRE_RESISTANCE` 609 | - `Potion::LONG_FIRE_RESISTANCE` 610 | - `Potion::SWIFTNESS` 611 | - `Potion::LONG_SWIFTNESS` 612 | - `Potion::STRONG_SWIFTNESS` 613 | - `Potion::SLOWNESS` 614 | - `Potion::LONG_SLOWNESS` 615 | - `Potion::WATER_BREATHING` 616 | - `Potion::LONG_WATER_BREATHING` 617 | - `Potion::HEALING` 618 | - `Potion::STRONG_HEALING` 619 | - `Potion::HARMING` 620 | - `Potion::STRONG_HARMING` 621 | - `Potion::POISON` 622 | - `Potion::LONG_POISON` 623 | - `Potion::STRONG_POISON` 624 | - `Potion::REGENERATION` 625 | - `Potion::LONG_REGENERATION` 626 | - `Potion::STRONG_REGENERATION` 627 | - `Potion::STRENGTH` 628 | - `Potion::LONG_STRENGTH` 629 | - `Potion::STRONG_STRENGTH` 630 | - `Potion::WEAKNESS` 631 | - `Potion::LONG_WEAKNESS` 632 | - `Potion::WITHER` 633 | - 以下のメソッドはリネームされました。 634 | - `Item->getDamage()` -> `Item->getMeta()` 635 | - 以下のメソッドは `pocketmine\inventory\CreativeInventory`へと移動されました: 636 | - `Item::addCreativeItem()` -> `CreativeInventory::add()` 637 | - `Item::clearCreativeItems()` -> `CreativeInventory::clear()` 638 | - `Item::getCreativeItemIndex()` -> `CreativeInventory::getItemIndex()` 639 | - `Item::getCreativeItems()` -> `CreativeInventory::getAll()` 640 | - `Item::initCreativeItems()` -> `CreativeInventory::init()` 641 | - `Item::isCreativeItem()` -> `CreativeInventory::contains()` 642 | - `Item::removeCreativeItem()` -> `CreativeInventory::remove()` 643 | - 以下のクラスが追加されました。 644 | - `ArmorTypeInfo` 645 | - `Fertilizer` 646 | - `LiquidBucket` 647 | - `MilkBucket` 648 | - `PotionType`: バニラのポーションタイプについての情報を保持する列挙クラス 649 | - `WritableBookBase` 650 | - `WritableBookPage` 651 | - 以下のAPIメソッドが追加されました。 652 | - `Armor->getArmorSlot()` 653 | - `Item->canStackWith()`: 二つのアイテムが数量やサイズ上限は考慮せずに、同じアイテムスロットで保持できるかを返します。 654 | - `Potion->getType()`: 適用されるエッふぇくとなどの情報をもつ`PotionType`列挙オブジェクトを返します。 655 | - `ProjectileItem->createEntity()`: 投げられるプロジェクタイルエンティティの新規インスタンスを返します。 656 | - 以下のクラスは削除されました。 657 | - `ChainBoots` 658 | - `ChainChestplate` 659 | - `ChainHelmet` 660 | - `ChainLeggings` 661 | - `DiamondBoots` 662 | - `DiamondChestplate` 663 | - `DiamondHelmet` 664 | - `DiamondLeggings` 665 | - `GoldBoots` 666 | - `GoldChestplate` 667 | - `GoldHelmet` 668 | - `GoldLeggings` 669 | - `IronBoots` 670 | - `IronChesplate` 671 | - `IronHelmet` 672 | - `IronLeggings` 673 | - `LeatherBoots` 674 | - `LeatherCap` 675 | - `LeatherPants` 676 | - `LeatherTunic` 677 | 678 | ##### NBT handling 679 | - シリアライズされたNBTバイト配列キャッシュはアイテムスタックに保持されなくなりました。これらのキャッシュはネットワークレイヤーシリアライズに用いられる早すぎる最適化であり、それ自体がネットワークNBT形式に依存していました。 680 | - 内部NBTの利用は周縁化されます。 もはや即座に変更点をNBTへ書き込む必要はありません。以下のフックが追加されます: 681 | - `Item->serializeCompoundTag()` 682 | - `Item->deserializeCompoundTag()` 683 | - 実行時NBTをアイテムから完全に取り除くことが計画されていますが、現段階では未解決の後方互換性の問題があります。 684 | 685 | ##### Enchantment 686 | - `VanillaEnchantments`クラスが追加されました。これはバニラのすべてのエンチャントを静的メソッドとして公開していて、 `Enchantment::get()`の意地の悪さを置き換えます。 687 | - 例: `Enchantment::get(Enchantment::PROTECTION)`は`VanillaEnchantments::PROTECTION()`で置き換えられました。 688 | - これらのメソッドは`Enchantment`の代わりに適切なタイプの情報を静的解析に渡し、コーディングがしやすくなりました。 689 | - MCPEのエンチャントIDとPocketMine-MP内部のIDの境目がより明確になりました。 690 | - IDハンドリングは`pocketmine\data\bedrock\EnchantmentIdMap`へ移動しました。 691 | - すべてのエンチャントID定数は`Enchantment`から削除されました。何らかの理由でレガシーエンチャントIDが必要なら`pocketmine\data\bedrock\EnchantmentIds`を利用してください。 692 | - `Enchantment::RARITY_*`定数は`Rarity`に移動され、`RARITY_`プレフィックスは削除されました。 693 | - `Enchantment::SLOT_*`定数は`ItemFlags`に移動され、`SLOT_`プレフィックスは削除されました。 694 | - 以下のAPIメソッドは移動されました。 695 | - `Enchantment::registerEnchantment()` -> `EnchantmentIdMap->register()` 696 | - `Enchantment::getEnchantment()` -> `EnchantmentIdMap->fromId()` 697 | - `Enchantment->getId()` -> `EnchantmentIdMap->toId()` 698 | - `Enchantment::getEnchantmentByName()` -> `VanillaEnchantments::fromString()` 699 | - 以下のAPIメソッドが追加されました。 700 | - `Enchantment->getRuntimeId()`: これは**動的ID**でありエンチャントタイプの比較に用いることができます。**これは決して保持されないため、configやNBTでは利用しないでください!** 701 | 702 | #### Lang 703 | - 以下のクラスはリネームされました。 704 | - `BaseLang` -> `Language` 705 | - `TranslationContainer` -> `Translatable` 706 | - 以下のクラスは削除されました。 707 | - `TextContainer` 708 | - 以下のAPIメソッドが追加されました。 709 | - `Translatable->format()`: 変換に対してフォーマット(カラーコードなど)を追加できます。 710 | - `Translatable->prefix()`: プレフィックスを追加できます。 711 | - `Translatable->postfix()`: ポストフィキシングを追加できます。 712 | - 以下のAPIメソッドはシグネチャが変更されました。 713 | - `Translatable->__construct()`は現在では`list`だけではなく`array`をパラメータとして受け取ります。 714 | - `Translatable->getParameter()`は現在では`int`だけではなく`int|string`をインデックスとして受け取ります。 715 | - `Translatable->getParameter()`は現在では`string`だけではなく`Translatable|string`を返します。 716 | - `Translatable->getParameters()`は現在では`array`を返します。 717 | - `LanguageNotFoundException`が追加されました。これはサーバーファイルに存在しない`Language`を構成しようとした際に投げられます。 718 | - `Translatable`は現在では変換パラメータのキーを無視しなくなりました。以前までは挿入される順番のみが考慮されていました。 719 | - `Translatable`は変換パラメータの文字列キーをサポートするようになりました。 720 | - `Translatable`は現在では、他の`Translatable`を変換パラメータとして提供することをサポートします。 721 | - `Language->translateString()`は現在では、`Translatable`を変換パラメータとして提供することをサポートします。 722 | - `Language->translateString()`は自動的な文字列パラメータ変換を試みなくなりました。もし変換したければ、明示的に変換する必要があります。これによりプレイヤーが変換キーを含むメッセージを送信した際に図らずも変換されてしまうバグが修正されます。 723 | - `Language->translate()`は`Translatable`の文字列パラメータを変換しなくなりました。(上で指摘した点と同様) 724 | 725 | #### Network 726 | - 以下のフィールドが削除されました。 727 | - `Network::$BATCH_THRESHOLD` 728 | - 以下のクラスがリネームされました。 729 | - `SourceInterface` -> `NetworkInterface` 730 | - `AdvancedSourceInterface` -> `AdvancedNetworkInterface` 731 | - 以下のクラスが移動されました。 732 | - `CompressBatchedTask` -> `mcpe\CompressBatchTask` 733 | - `level\format\io\ChunkRequestTask` -> `mcpe\ChunkRequestTask` 734 | - `mcpe\RakLibInterface` -> `mcpe\raklib\RakLibInterface` 735 | - 以下のクラスが削除されました。 736 | - `mcpe\PlayerNetworkSessionAdapter` 737 | - 以下のメソッドがリネームされました。 738 | - `UPnP::PortForward()` -> `UPnP::portForward()` 739 | - `UPnP::RemovePortForward()` -> `UPnP::removePortForward()` 740 | - 以下のメソッドはシグネチャが変更されました。 741 | - `UPnP::portForward()`は`string $serviceURL, string $internalIP, int $internalPort, int $externalPort`を受け取るようになりました。 742 | - `UPnP::removePortForward()`は`string $serviceURL, int $externalPort`を受け取るようになりました。 743 | - 以下のメソッドは削除されました。 744 | - `NetworkInterface->putPacket()` 745 | - `NetworkInterface->close()` 746 | - `NetworkInterface->emergencyShutdown()` 747 | - `NetworkInterface`はプレイヤーネットワークインターフェースに特化するものではなく、現在ではいかなるネットワークコンポーネントにも実装されるためにより汎用なインターフェースを表します。 748 | - `rcon`サブ名前空間以下にあるものはすべて削除されました。 749 | - `upnp\UPnP`には重大な変更点があります。これは現在では二つの静的メソッドではなくネットワークコンポーネントになりました。 750 | 751 | 752 | #### Permission 753 | - 以下の新規許可ノードが導入されます。 754 | - `pocketmine.group.everyone`: デフォルトで全員に与えられます。 755 | - `pocketmine.group.operator`: OPのプレイヤーとコンソールに与えられます。 756 | これらの許可ノードはほかのノードと同様に許可付与によって割り当て・上書き可能です。つまり、現在ではプレイヤー切断時(や付与が外れた際)に無くなる**一時的OP**状態を与えることができます。 757 | - 許可が明示的にセットされていない時やほかの許可により暗示的に付与されている場合には、現在では常にfalseとなるようになりました。 758 | - 定義されていない許可は`Permission::$DEFAULT_PERMISSION`ではなく、現在では常に`false`となりました。 759 | - 許可は内部的にデフォルト値を持たなくなりました。 その代わりに、デフォルト値は`pocketmine.group`の子として許可として割り当てられます。 760 | - `true`: `pocketmine.group.everyone`に子として値`true`で追加する 761 | - `false`: いかなる許可にも与えない 762 | - `op`: `pocketmine.group.operator`に子として値`true`で追加する 763 | - `notop`: `pocketmine.group.everyone`に子として値`true`で、`pocketmine.group.operator`に`false`で追加する 764 | しかし、`plugin.yml`での許可定義での`default`キーはサポートされ続けます。 765 | - `PermissibleBase`を利用する際のひな形を減らすために`PermissibleDelegateTrait`が追加されました。このトレイトは`ConsoleCommandSender`と`Player`で利用されています。 766 | - 以下のAPIメソッドは移動されました。 767 | - `Permission::getByName()` -> `PermissionParser::defaultFromString()` 768 | - `Permission::loadPermissions()` -> `PermissionParser::loadPermissions()` 769 | - `Permission::loadPermission()` -> `PermissionParser::loadPermission()` 770 | - 以下の定数は移動されました。 771 | - `Permission::DEFAULT_FALSE` -> `PermissionParser::DEFAULT_FALSE` 772 | - `Permission::DEFAULT_TRUE` -> `PermissionParser::DEFAULT_TRUE` 773 | - `Permission::DEFAULT_OP` -> `PermissionParser::DEFAULT_OP` 774 | - `Permission::DEFAULT_NOT_OP` -> `PermissionParser::DEFAULT_NOT_OP` 775 | - 以下のAPIメソッドが追加されました。 776 | - `Permission->addChild()` 777 | - `Permission->removeChild()` 778 | - `Permissible->getPermissionRecalculationCallbacks()` - 新規許可が与えられたり拒否されたりなど、許可の変更に対しての反応が行えるようになります。 779 | - `Permissible->setBasePermission()` - `pocketmine.group.operator`などのルート許可を割り当てる際に使用されます。通常プラグインでは使用するべきではありません。 780 | - `Permissible->unsetBasePermission()` 781 | - `PermissionAttachmentInfo->getGroupPermissionInfo()` - 許可の`PermissionAttachmentInfo`を返します。これは現在の許可の値を定めたり、許可が明らかなときには空にするものです。 782 | - 以下のAPIメソッドが削除されました。 783 | - `Permissible->isOp()`: `Permissible->hasPermission(DefaultPermissions::ROOT_OPERATOR)`を代わりに使用してください。 **ただし、プレイヤーがOPかどうかには直接的に依存するべきではありません。そのプラグイン固有の許可を与えてください。** 784 | - `Permissible->setOp()`: `addAttachment($plugin, DefaultPermissions::ROOT_OPERATOR, true)`を追加時に、`removeAttachment()`を削除時に使用してください。(もしくは`addAttachment()`をfalseで使うとほかの許可と同様に明示的に拒否することもできます) 785 | - `Permission->addParent()` 786 | - `Permission->getDefault()` 787 | - `Permission->setDefault()` 788 | - `PermissionManager->getDefaultPermissions()` 789 | - `PermissionManager->recalculatePermissionDefaults()` 790 | - `PermissionManager->subscribeToDefaultPerms()` 791 | - `PermissionManager->unsubscribeFromDefaultPerms()` 792 | - `PermissionManager->getDefaultPermSubscriptions()` 793 | - `PermissionAttachment->getPermissible()` 794 | - `PermissionAttachmentInfo->getPermissible()` 795 | - 以下のフィールドは削除されました。 796 | - `Permission::$DEFAULT_PERMISSION` 797 | - 以下のAPIは変更されました。 798 | - `PermissionParser::defaultFromString()`は現在では未知の値を渡されたときに`InvalidArgumentException`を投げるようになりました。 799 | - `Permission->__construct()`は現在では`$defaultValue`パラメータを受け取らなくなりました(上記のデフォルト値に関するリファクタに関するノートを参照してください)。代わりに`pocketmine.group.everyone`か`pocketmine.group.operator`の子要素として許可を与える必要があります。 800 | - 以下のクラスは削除されました。 801 | - `ServerOperator` 802 | 803 | #### Player 804 | - 以下のクラスは新規名前空間`pocketmine\Player`に移動されました。 805 | - `Achievement` 806 | - `GameMode` 807 | - `IPlayer` 808 | - `OfflinePlayer` 809 | - `PlayerInfo` 810 | - `Player` 811 | - 以下の定数は削除されました 812 | - `Player::SURVIVAL` - `GameMode::SURVIVAL()`を使用してください 813 | - `Player::CREATIVE` - `GameMode::CREATIVE()`を使用してください 814 | - `Player::ADVENTURE` - `GameMode::ADVENTURE()`を使用してください 815 | - `Player::SPECTATOR` - `GameMode::SPECTATOR()`を使用してください 816 | - `Player::VIEW` - `GameMode::SPECTATOR()`を使用してください 817 | - (ほぼ)すべてのパケットハンドラーは`プレイヤー`から除去されました。これらのハンドラーはネットワークレイヤー内にカプセル化されました 818 | - `Player->getSpawn()`は現在ではプレイヤーのスポーン地点が設定されていないときにワールドのセーフスポーンを返さなくなりました。コールしたときのセーフスポーンを返すというのは意味がありません。実際に使われるときにセーフスポーンであるとは限らないからです。セーフスポーンを取得したい場合には`World->getSafeSpawn()`にこの関数の返り値を渡してください。 819 | - 以下のAPIメソッドが追加されました。 820 | - `Player->attackBlock()`: ターゲットブロックを殴る(左クリック), 例. ブロックの破壊を開始(サバイバル) 821 | - `Player->attackEntity()`: (範囲内にいれば)ターゲットエンティティを素手攻撃(左クリック) 822 | - `Player->breakBlock()`: 現在のワールドのターゲットブロックを(即座に)破壊する 823 | - `Player->consumeHeldItem()`: 以前にアクティベートされたアイテムを消費する, 例. 食べ物を食べる 824 | - `Player->continueBreakBlock()`: サバイバル時に破壊アニメーションとパーティクルを生成しながらターゲットブロックを殴る 825 | - `Player->getItemCooldownExpiry()`: 与えられたアイテムのクールダウンが失効するtickを返す 826 | - `Player->hasFiniteResources()` 827 | - `Player->interactBlock()`: 現在のワールドのターゲットブロックを触る(右クリック) 828 | - `Player->interactEntity()`: ターゲットエンティティを触る(右クリック), 例. エンティティに名札で名前をつける 829 | - `Player->pickBlock()`: 現在のワールドのターゲットブロックをピックする(マウスホイールクリック) 830 | - `Player->releaseHeldItem()`: 以前にアクティベートされたアイテムをリリースする, 例. 竿を振る 831 | - `Player->selectHotbarSlot()`: 特定のホットバースロットを選択する 832 | - `Player->stopBreakBlock()`: それ以前に攻撃されていたブロックへの攻撃をやめる 833 | - `Player->toggleFlight()`: 飛行を開始/停止しようとする (イベントを発火し、キャンセルされる可能性がある) 834 | - `Player->updateNextPosition()`: プレイヤーの次に試みられる移動場所を設定する (イベントを発火し、キャンセルされる可能性がある) 835 | - `Player->useHeldItem()`: 持っているアイテムをアクティベートする, 例. 雪玉を投げる 836 | - `Player->getSaveData()`: その場でセーブデータを生成し、セーブデータを返す。 837 | - 以下のAPIメソッドは削除されました。 838 | - `Player->addActionBarMessage()`: `sendActionBarMessage()`に置き換えられました。 839 | - `Player->addSubTitle()`: `sendSubTitle()`に置き換えられました。 840 | - `Player->addTitle()`: `sendTitle()`に置き換えられました。 841 | - `Player->getAddress()`: `NetworkSession->getIp()`に置き換えられました。 842 | - `Player->getPing()`: `NetworkSession`に移動されました。 843 | - `Player->getPort()`: `NetworkSession`に移動されました。 844 | - `Player->updatePing()`: `NetworkSession`に移動されました。 845 | - `Player->dataPacket()`: `NetworkSession->sendDataPacket()`に置き換えられました。 846 | - `Player->sendDataPacket()`: `NetworkSession->sendDataPacket()`に置き換えられました。 847 | - `Player->updateNextPosition()`: `Player->handleMovement()`を代わりに使用してください。 848 | - `IPlayer->isWhitelisted()`: `Server->isWhitelisted()`を代わりに使用してください。 849 | - `IPlayer->setWhitelisted()`: `Server->setWhitelisted()`を代わりに使用してください。 850 | - `IPlayer->isBanned()`: これはネームBANのみをチェックしプラグインによる独自のBANシステムについて把握していなかったため信頼性に欠けていました。`Server->getNameBans()->isBanned()`と`Server->getIPBans()->isBanned()`を代わりに使用してください。 851 | - `IPlayer->setBanned()`: `Server`のAPIを代わりに使用してください。 852 | - `IPlayer->isOp()`: `Server`のAPIを代わりに使用してください。 853 | - `IPlayer->setOp()`: `Server`のAPIを代わりに使用してください。 854 | 855 | #### Plugin 856 | - APIバージョンのチェックがより厳格になりました。現在では同じメジャーバージョン内における複数の最小バージョンの宣言をすることができなくなりました。複数宣言した場合、プラグインは読み込みに失敗し、`Multiple minimum API versions found for some major versions`というメッセージが表示されます。 857 | - `plugin.yml`のYAMLコマンドのロードは`PluginBase`に取り込まれました。 858 | - `PluginManager->registerEvent()`はよりシンプルなシグネチャを持つようになります: `registerEvent(string $event, \Closure $handler, int $priority, Plugin $plugin, bool $handleCancelled = false)`。 与えられるクロージャーはその唯一のパラメータとしてその特定のイベントのみを受け取る必要があります. 詳しくは[Event APIの変更](#event)をご覧ください。 859 | - 以下のクラスは削除されました。 860 | - `PluginLogger` 861 | - 以下の定数は削除されました。 862 | - `PluginLoadOrder::STARTUP` - `PluginEnableOrder::STARTUP()`を使用してください。 863 | - `PluginLoadOrder::POSTWORLD` - `PluginEnableOrder::POSTWORLD()`を使用してください。 864 | - 以下のインターフェース要求は削除されました。 865 | - `Plugin->onEnable()`: `PluginBase`に取り込まれました。 866 | - `Plugin->onDisable()`: 同上 867 | - `Plugin->onLoad()`: 同上 868 | - `Plugin->getServer()`は実装が要求されなくなりました。利便性のために`PluginBase`に実装されます。 869 | - `Plugin->isDisabled()`は削除されました。(`Plugin->isEnabled()`を代わりに使用してください) 870 | - `Plugin`は`CommandExecutor`を継承しなくなりました。つまりこれは`Plugin`実装は`onCommand()`をこれからは実装する必要がないことを表します。 871 | - 以下のフックメソッドはアクセス権が変更されました。 872 | - `PluginBase->onEnable()`は`public`から`protected`に変更されました。 873 | - `PluginBase->onDisable()`は`public`から`protected`に変更されました。 874 | - `PluginBase->onLoad()`は`public`に`protected`変更されました。 875 | - 以下のフックメソッドはリネームされました。 876 | - `Plugin->setEnabled()` -> `Plugin->onEnableStateChange()` - この変更はプラグイン開発者に、このフックメソッドを誤って使わせないようにしこのメソッドが行うことをより正確に説明する名前を与えるためのものです。 877 | - 以下の(非推奨の)APIメソッドは削除されました。 878 | - `PluginManager->callEvent()`: `Event->call()`を代わりに使用してください。 879 | - `PluginManager->addPermission()`: `PermissionManager`を代わりに使用してください。 880 | - `PluginManager->getDefaultPermSubscriptions()`: `PermissionManager`を代わりに使用してください。 881 | - `PluginManager->getDefaultPermissions()`: `PermissionManager`を代わりに使用してください。 882 | - `PluginManager->getPermission()`: `PermissionManager`を代わりに使用してください。 883 | - `PluginManager->getPermissionSubscriptions()`: `PermissionManager`を代わりに使用してください。 884 | - `PluginManager->getPermissions()`: `PermissionManager`を代わりに使用してください。 885 | - `PluginManager->recalculatePermissionDefaults()`: `PermissionManager`を代わりに使用してください。 886 | - `PluginManager->removePermission()`: `PermissionManager`を代わりに使用してください。 887 | - `PluginManager->subscribeToDefaultPerms()`: `PermissionManager`を代わりに使用してください。 888 | - `PluginManager->subscribeToPermission()`: `PermissionManager`を代わりに使用してください。 889 | - `PluginManager->unsubscribeFromDefaultPerms()`: `PermissionManager`を代わりに使用してください。 890 | - `PluginManager->unsubscribeFromPermission()`: `PermissionManager`を代わりに使用してください。 891 | - `PluginBase->onEnable()`や`PluginBase->onLoad()`で例外を投げることは許可されなくなりました。現在では例外を投げるとサーバーがクラッシュします。 892 | 893 | #### Scheduler 894 | ##### AsyncTaskのためのスレッドローカルストレージ 895 | - TLSは自己完結し、より安定し、使いやすくなるようにこのリリースで完全に書き直されました。 896 | - そして、よりシンプルなプロパティのように振る舞います。`storeLocal()` は書き込み、 `fetchLocal()` は読み込みです。 897 | - 自己完結し、その後クリーンアップするために非同期プールに依存もしません。 898 | - 値は `AsyncTask` がガベージコレクトされたときに、通常のプロパティと同様に自動的に削除されます。 899 | - 複数の値を文字列の名前で識別して保存できます。 900 | - `fetchLocal()` は複数回使えるようになりました。保存されている値を削除することはなくなりました。 901 | - 以下のクラスは削除されました。 902 | - `FileWriteTask` 903 | - 以下のメソッドは削除されました。 904 | - `AsyncTask->peekLocal()`: `fetchLocal()` を代わりに使用してください。 905 | - 以下のメソッドはシグネチャが変わりました。 906 | - `AsyncTask->storeLocal()` は `storeLocal(string $key, mixed $complexData) : void` をシグネチャに持ちます。 907 | - `AsyncTask->fetchLocal()` は `fetchLocal(string $key) : mixed` をシグネチャに持ちます。 908 | 909 | ##### その他の変更 910 | - `AsyncPool` は新しく、かなり効率の良いアルゴリズムをタスクコレクションに使用します。 911 | - `BulkCurlTask` のコンストラクタ引数 `$complexData` は削除されました。 912 | - `BulkCurlTask->__construct()` は `mixed[]` の代わりに `BulkCurlTaskOperation[]` を受け取ります。 913 | - `CancelTaskException` が追加されました。これは、 `Task::onRun()` からタスクをキャンセルするために投げられます。(特に `ClosureTask` に便利です) 914 | - `pocketmine\Collectable` は削除され、 `AsyncTask` から継承されなくなりました。 915 | - 以下のフックが追加されました。 916 | - `AsyncTask->onError()`: メインスレッドにおいて非同期処理でメモリ不足などの制御不能なエラーを検知したときに呼び出されます。 917 | - 以下のフックはシグネチャが変わりました。 918 | - `AsyncTask->onCompletion()` は `Server` パラメーターを受け取らなくなり、 `void` を戻り値の型とします。 919 | - `AsyncTask->onProgressUpdate()` は `Server` パラメーターを受け取らなくなり、 `void` を戻り値の型とします。 920 | - 以下のAPIメソッドは削除されました。 921 | - `AsyncTask->getFromThreadStore()`: `AsyncTask->worker->getFromThreadStore()` を代わりに使用してください。 922 | - `AsyncTask->removeFromThreadStore()`: `AsyncTask->worker->removeFromThreadStore()` を代わりに使用してください。 923 | - `AsyncTask->saveToThreadStore()`: `AsyncTask->worker->saveToThreadStore()` を代わりに使用してください。 924 | 925 | #### Server 926 | - 権限システムに依存しない、新しいチャット配信APIが実装されました。 927 | - 以下のAPIメソッドが追加されました。 928 | - `subscribeToBroadcastChannel()` - チャット(及びその他の種類の)メッセージを受信するために、`CommandSender`をサブスクライブできます。 929 | - `unsubscribeFromBroadcastChannel()` 930 | - `unsubscribeFromAllBroadcastChannels()` 931 | - `getBroadcastChannelSubscribers()` 932 | - `Player`に`pocketmine.broadcast.*`のいずれかの権限を与えると、自動的に対応するブロードキャストチャンネルに加入できます。(権限を削除すると登録も解除されます) 933 | - 権限を使わずにカスタムブロードキャストチャンネルを作成・登録できるようになりました。 934 | - しかし、`Player`達が適切な権限を持っていなければ、内蔵ブロードキャストチャンネルからは自動的に登録解除されるでしょう。 935 | - カスタムブロードキャストチャンネルからの自動的な登録/登録解除は新しい`Permissible`権限再計算コールバックAPI使用して実装できます。 936 | - 以下のAPIメソッドは削除されました。 937 | - `reloadWhitelist()` 938 | - `getLevelMetadata()` 939 | - `getPlayerMetadata()` 940 | - `getEntityMetadata()` 941 | - `getDefaultGamemode()` 942 | - `getLoggedInPlayers()` 943 | - `onPlayerLogout()` 944 | - `addPlayer()` 945 | - `removePlayer()` 946 | - `reload()` 947 | - `getSpawnRadius()` 948 | - `enablePlugin()` 949 | - `disablePlugin()` 950 | - `getGamemodeString()` - `pocketmine\player\GameMode->getTranslationKey()` に置き換えられました。 951 | - `getGamemodeName()` - `pocketmine\player\GameMode->name()` に置き換えられました。 952 | - `getGamemodeFromString()` - `GameMode::fromString()` に置き換えられました。 953 | - `broadcast()` - `broadcastMessage()` を代わりに使用してください。 954 | - 以下のAPIメソッドは変更されました。 955 | - `getOfflinePlayerData()` 存在しないデータを生成しなくなりました。 956 | - 以下のAPIメソッドは名前が変更されました。 957 | - `getPlayer()` -> `getPlayerByPrefix()` (可能な場所では `getPlayerExact()` を代わりに使用することを検討してください) 958 | 959 | #### Level / World 960 | ##### General 961 | - "world"の文脈での`Level`への言及は全て`World`に変更されました。 962 | - 名前空間`pocketmine\level`は`pocketmine\world`に変更されました。 963 | - "world"の文脈で`Level`を名前に含む全てのクラスの該当箇所は、`World`に変更されました。 964 | - 例えば、`Position->getLevel()`は`Position->getWorld()`に変更され、`Position->level`は`Position->world`に変更されました。 965 | - `WorldManager`ユニットを`Server`から分割しました。 966 | - `Server->findEntity()` -> `WorldManager->findEntity()` 967 | - `Server->generateLevel()` -> `WorldManager->generateWorld()` 968 | - `Server->getAutoSave()` -> `WorldManager->getAutoSave()` 969 | - `Server->getDefaultLevel()` -> `WorldManager->getDefaultWorld()` 970 | - `Server->getLevel()` -> `WorldManager->getWorld()` 971 | - `Server->getLevelByName()` -> `WorldManager->getWorldByName()` 972 | - `Server->getLevels()` -> `WorldManager->getWorlds()` 973 | - `Server->isLevelGenerated()` -> `WorldManager->isWorldGenerated()` 974 | - `Server->isLevelLoaded()` -> `WorldManager->isWorldLoaded()` 975 | - `Server->loadLevel()` -> `WorldManager->loadWorld()` 976 | - `WorldManager->loadWorld()` 要求された場合はワールドを変換できます。 (`$autoUpgrade`パラメーターが提供されている必要があります) 977 | - `Server->setAutoSave()` -> `WorldManager->setAutoSave()` 978 | - `Server->setDefaultLevel()` -> `WorldManager->setDefaultWorld()` 979 | - `Server->unloadLevel()` -> `WorldManager->unloadWorld()` 980 | - `WorldManager->getAutoSaveTicks()`が追加され、自動セーブの間隔を操作できるようになりました。 981 | - 以下のクラスは追加されました。 982 | - `BlockTransaction`: 検証条件付きでブロックの一括変更を行えます - 一つでも変更不可なブロックがある場合、変更全体が適用できなくなります。 983 | - `ChunkListenerNoOpTrait`: チャンクリスナーの実装のための標準のno-opスタブを含みます。 984 | - `ChunkListener`: 与えられたチャンクで発生したイベントを監視することができるインタフェースです。 985 | - `TickingChunkLoader`: チャンクの時を刻むことに特化した`ChunkLoader`です。 986 | - `ChunkLoader`は`getX()`と`getZ()`の実装を必要としなくなりました。 987 | - `ChunkLoader`でチャンクがランダムに更新されることがなくなりました。この動作が必要なら`TickingChunkLoader`を実装してください。 988 | - 以下のクラスは改名されました。 989 | - `pocketmine\world\utils\SubChunkIteratorManager` -> `pocketmine\world\utils\SubChunkExplorer` 990 | - 以下のAPIメソッドは追加されました。 991 | - `World->registerChunkListener()` 992 | - `World->unregisterChunkListener()` 993 | - `World->getBlockAt()` (Vector3の代わりにint x/y/zを受け入れ、場合によってはより速くなります) 994 | - `World->setBlockAt()` (Vector3の代わりにint x/y/zを受け入れ、場合によってはより速くなります) 995 | - `Chunk->isDirty()` (`Chunk->hasChanged()`の置換) 996 | - `Chunk->getDirtyFlag()` (より細かなコンポーネント・ベースのチャンクダーティフラッギングで、チャンクの変更されていない部分を保存することを回避するために使用されます) 997 | - `Chunk->setDirty()` 998 | - `Chunk->setDirtyFlag()` 999 | - 以下のAPIメソッドは削除されました。 1000 | - `ChunkLoader->getLoaderId()` (オブジェクトIDが使われるようになりました) 1001 | - `ChunkLoader->isLoaderActive()` 1002 | - `ChunkLoader->getPosition()` 1003 | - `ChunkLoader->getLevel()` 1004 | - `Chunk->fastSerialize()` (`FastChunkSerializer::serialize()`を代わりに使用してください) 1005 | - `Chunk->getBlockData()` 1006 | - `Chunk->getBlockDataColumn()` 1007 | - `Chunk->getBlockId()` 1008 | - `Chunk->getBlockIdColumn()` 1009 | - `Chunk->getBlockLight()` 1010 | - `Chunk->getBlockLightColumn()` 1011 | - `Chunk->getBlockSkyLight()` 1012 | - `Chunk->getBlockSkyLightColumn()` 1013 | - `Chunk->getMaxY()` 1014 | - `Chunk->getSubChunkSendCount()` (これはプロトコルの取り扱いに特化していました) 1015 | - `Chunk->getX()` 1016 | - `Chunk->getZ()` 1017 | - `Chunk->hasChanged()` (`Chunk->isDirty()`または`Chunk->getDirtyFlag()`を代わりに使用してください) 1018 | - `Chunk->isGenerated()` 1019 | - `Chunk->networkSerialize()` (`network\mcpe\serializer`の中にある`ChunkSerializer`を確認してください) 1020 | - `Chunk->populateSkyLight()` (`SkyLightUpdate->recalculateChunk()`を代わりに使用してください) 1021 | - `Chunk->recalculateHeightMap()` (`SkyLightUpdate`に移動しました) 1022 | - `Chunk->recalculateHeightMapColumn()` (`SkyLightUpdate`に移動しました) 1023 | - `Chunk->setAllBlockLight()` 1024 | - `Chunk->setAllBlockSkyLight()` 1025 | - `Chunk->setBlock()` 1026 | - `Chunk->setBlockData()` 1027 | - `Chunk->setBlockId()` 1028 | - `Chunk->setBlockLight()` 1029 | - `Chunk->setBlockSkyLight()` 1030 | - `Chunk->setChanged()` (`Chunk->setDirty()`または`Chunk->setDirtyFlag()`を代わりに使用してください) 1031 | - `Chunk->setGenerated()` 1032 | - `Chunk->setX()` 1033 | - `Chunk->setZ()` 1034 | - `Chunk::fastDeserialize()` (`FastChunkSerializer::deserialize()`を代わりに使用してください) 1035 | - `World->isFullBlock()` 1036 | - `World->getFullBlock()` 1037 | - `World->getBlockIdAt()` 1038 | - `World->setBlockIdAt()` 1039 | - `World->getBlockDataAt()` 1040 | - `World->setBlockDataAt()` 1041 | - `World->setBlockLightAt()` 1042 | - `World->setBlockSkyLightAt()` 1043 | - `World->getBlockSkyLightAt()` (場合によって、`World->getRealBlockSkyLightAt()`または`World->getPotentialBlockSkyLightAt()`を使用してください) 1044 | - `World->getHeightMap()` (誤解を招く名前であり、空の光の計算にのみ有益です - おそらく`getHighestBlockAt()`が求められているものでしょう) 1045 | - `World->setHeightMap()` (誤解を招く名前であり、空の光の計算にのみ有益です) 1046 | - `World->getChunkEntities()` 1047 | - `World->getChunkTiles()` 1048 | - `World->getTileById()` 1049 | - `World->checkSpawnProtection()` 1050 | - `World->updateBlockLight()` 1051 | - `World->updateSkyLight()` 1052 | - `World->isFullBlock()` (`Block->isFullCube()`を代わりに使用してください) 1053 | - `World->sendBlocks()` 1054 | - `World->sendTime()` 1055 | - `World->addGlobalPacket()` 1056 | - `World->broadcastGlobalPacket()` 1057 | - `World->addChunkPacket()` 1058 | - `World->broadcastLevelSoundEvent()` 1059 | - `World->broadcastLevelEvent()` 1060 | - `World->getTickRate()` 1061 | - `World->setTickRate()` 1062 | - `World::generateChunkLoaderId()` 1063 | - 以下のAPIメソッドはシグネチャーが変更されました。 1064 | - `World->addParticle()`は`addParticle(Vector3 $pos, Particle $particle, ?Player[] $players = null) : void`のシグネチャーを持つようになります。 1065 | - `World->addSound()`は`addSound(?Vector3 $pos, Sound $sound, ?Player[] $players = null) : void`のシグネチャーを持つようになります。 1066 | - `World->getRandomTickedBlocks()`は`SplFixedArray`の代わりに`bool[]`を受け付けます。 1067 | - `World->addRandomTickedBlock()`は`int, int`の代わりに`Block`を受け付けます。 1068 | - `World->removeRandomTickedBlock()`は`int, int`の代わりに`Block`を受け付けます。 1069 | - `World->setBlock()`にあった`$direct`パラメーターは削除されました。 1070 | - `World->loadChunk()`は`?Chunk`を返し、`$create`パラメーターは削除されました。 1071 | - `World->getChunk()`は`$create`パラメーターを受け付けなくなりました。 1072 | - `World->updateAllLight()`は`Vector3`の代わりに`int, int, int`を受け付けます。 1073 | - `ChunkManager->setChunk()` (および`World`と`SimpleChunkManager`の中の注目に値する実装) は`$chunk`パラメーターにNULLを受け付けなくなりました。 1074 | - `Chunk->__construct()`は`array $subChunks, ?list $entities, ?list $tiles, ?BiomeArray $biomeArray, ?HeightArray $heightArray`のシグネチャーを持つようになります。 1075 | - `Chunk->getSubChunk()`は`SubChunkInterface|null`の代わりに`SubChunk`を返します。(範囲外の座標では`InvalidArgumentException`を投げます) 1076 | - `Chunk->setSubChunk()`はもう`SubChunkInterface`を受け入れず、`$allowEmpty`パラメーターは削除されました。 1077 | - `WorldManager->generateWorld()` (以前の`Server->generateWorld()`) は`int $seed, class-string $generator, mixed[] $options`の代わりに`WorldCreationOptions`を受け付けるようになりました。 1078 | - 以下のAPIメソッドは改名または移動しました。 1079 | - `Level->getChunks()` -> `World->getLoadedChunks()` 1080 | - `Level->getCollisionCubes()` -> `World->getCollisionBoxes()` 1081 | - `World->getName()` -> `World->getDisplayName()` 1082 | - `World->populateChunk()`は`World->requestChunkPopulation()`と`World->orderChunkPopulation()`に分割されました。 1083 | - 以下のAPIメソッドは動作が変更されました。 1084 | - `World->getChunk()`はディスクからチャンクを読み込もうとしなくなりました。チャンクがすでにメモリになかった場合、`null`が返されます。 (この動作は他の`ChunkManager`の実装と適切に調和します) 1085 | - `World->getHighestBlockAt()`は目標のX/Z列にブロックがなかった場合`-1`の代わりに`null`を返すようになりました。 1086 | - 以下のメソッドは未生成の地形を指定したときに`WorldException`を投げるようになりました。 1087 | - `World->getSafeSpawn()` (以前はただ黙って入力位置を返していました) 1088 | - `World->getHighestBlockAt()` (以前は-1を返していました) 1089 | - `World->loadChunk()`はディスクに指定のチャンクが存在しなかった時に空のチャンクを生成しなくなりました。 1090 | - `World->setChunk()`は`ChunkLoadEvent`と`ChunkListener->onChunkLoaded()`を以前存在していなかったチャンクを置き換えるときに呼び出します。 1091 | - `World->useBreakOn()`は指定の場所が未生成、または未ロードの(または生成のためにロックされている)チャンクに含まれていた場合に`false`を返すようになりました。 1092 | - `World->useItemOn()`は指定の場所が未生成、または未ロードの(または生成のためにロックされている)チャンクに含まれていた場合に`false`を返すようになりました。 1093 | - `ChunkListener`インタフェースは`ChunkLoader`から分割されました。以下のメソッドは移動しました。 1094 | - `ChunkLoader->onBlockChanged()` -> `ChunkListener->onBlockChanged()` 1095 | - `ChunkLoader->onChunkChanged()` -> `ChunkListener->onChunkChanged()` 1096 | - `ChunkLoader->onChunkLoaded()` -> `ChunkListener->onChunkLoaded()` 1097 | - `ChunkLoader->onChunkPopulated()` -> `ChunkListener->onChunkPopulated()` 1098 | - `ChunkLoader->onChunkUnloaded()` -> `ChunkListener->onChunkUnloaded()` 1099 | - `Location`は`pocketmine\entity\Location`に移動しました。 1100 | 1101 | ##### Particles 1102 | - `DestroyBlockParticle`は`BlockBreakParticle`に一貫性のために名前が変更されました。 1103 | - `DustParticle->__construct()`は`pocketmine\color\Color`オブジェクトを`r, g, b, a`の代わりに受け付けるようになりました。 1104 | - `pocketmine\world\particle\Particle`は`pocketmine\math\Vector3`を継承しなくなり、インタフェースに変換されました。 1105 | - 以下の`Particle`が追加されました。 1106 | - `DragonEggTeleportParticle` 1107 | - `PunchBlockParticle` 1108 | 1109 | ##### Sounds 1110 | - `pocketmine\world\sound\Sound`は`pocketmine\math\Vector3`を継承しなくなり、インタフェースに変換されました。 1111 | - `Sound->encode()`は`?\pocketmine\math\Vector3`を受け付けるようになりました。全体へのサウンドの場合は`NULL`を渡すことができます。 1112 | - 以下のクラスが追加されました。 1113 | - `ArrowHitSound` 1114 | - `BlockBreakSound` 1115 | - `BlockPlaceSound` 1116 | - `BowShootSound` 1117 | - `BucketEmptyLavaSound` 1118 | - `BucketEmptyWaterSound` 1119 | - `BucketFillLavaSound` 1120 | - `BucketFillWaterSound` 1121 | - `ChestCloseSound` 1122 | - `ChestOpenSound` 1123 | - `EnderChestCloseSound` 1124 | - `EnderChestOpenSound` 1125 | - `ExplodeSound` 1126 | - `FlintSteelSound` 1127 | - `ItemBreakSound` 1128 | - `NoteInstrument` 1129 | - `NoteSound` 1130 | - `PaintingPlaceSound` 1131 | - `PotionSplashSound` 1132 | - `RedstonePowerOffSound` 1133 | - `RedstonePowerOnSound` 1134 | - `ThrowSound` 1135 | - `XpCollectSound` 1136 | - `XpLevelUpSound` 1137 | 1138 | #### Utils 1139 | - `Color`クラスは移動されました。現在では[`pocketmine/color`](https://github.com/pmmp/Color)パッケージ内の`pocketmine\color\Color`に存在します。 1140 | - `UUID`クラスは削除されました。 [`ramsey/uuid`](https://github.com/ramsey/uuid)のバージョン4.1が代わりに使用されます。 1141 | - `UUID::fromData()`は`Ramsey\Uuid\Uuid::uuid3()`に置き換えられます 1142 | - `UUID::fromRandom()`は`Ramsey\Uuid\Uuid::uuid4()`に置き換えられます 1143 | - `UUID::fromBinary()`は`Ramsey\Uuid\Uuid::fromBytes()`に置き換えられます (`Ramsey\Uuid\Uuid::isValid()`で有効か確認してください) 1144 | - `UUID::toBinary()`は`Ramsey\Uuid\UuidInterface::getBytes()`で置き換えられます 1145 | - 詳細は で確認できます 1146 | - `Terminal::hasFormattingCodes()`はフォーマットに用いるコードが利用できるかを自動的に検出しなくなりました。 代わりに`Terminal::init()`をパラメータなしで用いて初期化するか、`true`か`false`を与えて上書きする必要があります。 1147 | - `Config->save()`はディスク書き込み時の例外を受け取らなくなりました。 1148 | - 以下のクラスが追加されました。 1149 | - `InternetException` 1150 | - `Internet` 1151 | - `Process` 1152 | - 以下のAPIメソッドが追加されました。 1153 | - `Config->getPath()`: ディスク上のConfigのパスを返します 1154 | - `Terminal::write()`: Minecraftフォーマットを使用したテキストを新たな行を作ることなく出力します 1155 | - `Terminal::writeLine()`: Minecraftフォーマットを使用したテキストを新たな行を作って出力します 1156 | - `Utils::recursiveUnlink()`: 再帰的にディレクトリ内のコンテンツとそのディレクトリを削除します 1157 | - 以下のAPIクラス定数が追加されました。 1158 | - `TextFormat::COLORS`: すべての既知のカラーコードのリスト 1159 | - `TextFormat::FORMATS`: すべての既知のフォーマットコードのリスト(例. イタリック,ボールド)。 (`RESET`は含まれません。これはフォーマットを追加せず _削除_ するためです。) 1160 | - 以下の非推奨のAPIリダイレクトが削除されました。 1161 | - `Utils::execute()`: `Process`に移動されました。 1162 | - `Utils::getIP()`: `Internet`に移動されました。 1163 | - `Utils::getMemoryUsage()`: `Process`に移動されました。 1164 | - `Utils::getRealMemoryUsage()`: `Process`に移動されました。 1165 | - `Utils::getThreadCount()`: `Process`に移動されました。 1166 | - `Utils::getURL()`: `Internet`に移動されました。 1167 | - `Utils::kill()`: `Process`に移動されました。 1168 | - `Utils::postURL()`: `Internet`に移動されました。 1169 | - `Utils::simpleCurl()`: `Internet`に移動されました。 1170 | - 以下のAPIフィールドは削除/隠蔽されました。 1171 | - `Utils::$ip` 1172 | - `Utils::$online` 1173 | - `Utils::$os` 1174 | - 以下のAPIメソッドはシグネチャが変更されました。 1175 | - `Internet::simpleCurl()`は現在では`callable`ではなく`Closure`を`onSuccess`パラメータとして要求します 1176 | - 以下のAPIメソッドは削除されました。 1177 | - `TextFormat::toJSON()` 1178 | - `Utils::getCallableIdentifier()` 1179 | 1180 | ### Gameplay 1181 | #### Blocks 1182 | - 以下のブロックが実装されました 1183 | - bamboo 1184 | - bamboo sapling 1185 | - barrel 1186 | - barrier 1187 | - blast furnace 1188 | - blue ice 1189 | - carved pumpkin 1190 | - coral block 1191 | - daylight sensor 1192 | - dried kelp 1193 | - elements (from Minecraft: Education Edition) 1194 | - hard (stained and unstained) glass (from Minecraft: Education Edition) 1195 | - hard (stained and unstained) glass pane (from Minecraft: Education Edition) 1196 | - jukebox 1197 | - note block 1198 | - red, green, blue and purple torches (from Minecraft: Education Edition) 1199 | - sea pickle 1200 | - slime 1201 | - smoker 1202 | - underwater torches (from Minecraft: Education Edition) 1203 | - additional wood variants of the following: 1204 | - buttons 1205 | - pressure plates 1206 | - signs 1207 | - trapdoors 1208 | - stairs of the following materials: 1209 | - andesite (smooth and natural) 1210 | - diorite (smooth and natural) 1211 | - end stone 1212 | - end stone brick 1213 | - granite (smooth and natural) 1214 | - mossy cobblestone 1215 | - prismarine (natural, dark and bricks) 1216 | - red nether brick 1217 | - red sandstone (and variants) 1218 | - stone-like slabs of many variants 1219 | - プレイヤーでないエンティティがベッドに落ちた際に跳ねるようになりました。 1220 | - プレイヤーとmobはベッドに落ちた際にダメージが軽減されるようになりました。 1221 | 1222 | #### Items 1223 | - 以下のアイテムが実装されました 1224 | - records 1225 | - compounds (from Minecraft: Education Edition) 1226 | - black, brown, blue and white dyes 1227 | 1228 | #### Inventory 1229 | - オフハンドインベントリが実装されました。 1230 | --------------------------------------------------------------------------------