diff --git a/.github/workflows/1_18.yml b/.github/workflows/1_18.yml new file mode 100644 index 0000000000..8d7340c4b1 --- /dev/null +++ b/.github/workflows/1_18.yml @@ -0,0 +1,99 @@ +name: 1.18 build check + +on: + push: + branches: + - 1_18 + paths: + - src/** + - build.sbt + - .scalafix.conf + - .scalafmt.conf + - project/* + - .github/workflows/**.yml + - .github/actions/**/**.yml + +jobs: + build_check: + env: + BUILD_ENVIRONMENT_IS_CI_OR_LOCAL: "CI" + runs-on: ubuntu-20.04 + container: ghcr.io/giganticminecraft/seichiassist-builder-v2:424c09f + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Prepare build dependencies cache + uses: actions/cache@v3 + env: + cache-name: cache-build-dependencies + cache-version: v-5 + with: + # sbt等は$HOMEではなくユーザーディレクトリを見ているようで、 + # GH Actionsでの ~ は /github/home/ に展開されるにもかかわらず + # 実際のキャッシュは /root/ 以下に配備される。 + # + # /root/.ivy/cache, /root/.sbt - sbt関連のキャッシュ + # /root/.m2 - ビルドログを観察した感じprotoc等はここを利用する + # /root/.cache - cousierがscalasbt等をキャッシュするのに使っている + path: | + /root/.ivy2/cache + /root/.sbt + /root/.m2 + /root/.cache + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ hashFiles('**/build.sbt') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- + + - name: Prepare build cache + if: github.ref != 'refs/heads/master' + uses: actions/cache@v3 + env: + cache-name: cache-build + cache-version: v-5 + with: + path: | + target + project/target + project/project/target + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- + + # CIでのcheckoutはファイルのタイムスタンプをチェックアウト時刻に設定するため、 + # そのままビルドするとlocalDependenciesにあるjarに変更が行われたと見なされ + # 不要なインクリメンタルコンパイルが走る + # タイムスタンプをコミット時刻に設定することでこれが回避できる + - name: Restore localDependencies' timestamps + # 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 + run: | + git config --global --add safe.directory /__w/SeichiAssist/SeichiAssist + for jar in localDependencies/*.jar; do + timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $jar` + touch -t "$timestamp" $jar + done + + # scalapbは.protoの再コンパイルの必要性を判定する際にタイムスタンプを見ているから、コミット時刻に合わせる + - name: Restore protocol timestamps + ## 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 + run: | + for proto in protocol/*.proto; do + timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $proto` + touch -t "$timestamp" $proto + done + + - name: Check format with Scalafmt + run: ./sbt scalafmtCheckAll + + - name: Check lint with Scalafix on push + run: ./sbt "scalafix --check" + + - name: Test and build artifact + run: ./sbt assembly + + - name: Clean build artifact for caching target folder + run: rm -r target/build diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 21d057b752..e4f32fd2d0 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -14,17 +14,17 @@ on: - .github/workflows/**.yml - .github/actions/**/**.yml - pull_request: - branches: - - develop - paths: - - src/**/ - - build.sbt - - .scalafix.conf - - .scalafmt.conf - - project/* - - .github/workflows/**.yml - - .github/actions/**/**.yml + # pull_request: + # branches: + # - develop + # paths: + # - src/**/ + # - build.sbt + # - .scalafix.conf + # - .scalafmt.conf + # - project/* + # - .github/workflows/**.yml + # - .github/actions/**/**.yml jobs: build_test_and_upload: @@ -144,7 +144,7 @@ jobs: output-sha: name: 最終コミットのSHA値を取得する - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 outputs: sha: ${{ steps.output-sha.outputs.sha }} steps: @@ -159,7 +159,7 @@ jobs: create_prerelease: name: GitHub ReleasesにPreReleaseを作成する - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 if: github.ref == 'refs/heads/develop' needs: - build_test_and_upload diff --git a/.github/workflows/create_1_18_release.yml b/.github/workflows/create_1_18_release.yml new file mode 100644 index 0000000000..c38cb9341c --- /dev/null +++ b/.github/workflows/create_1_18_release.yml @@ -0,0 +1,104 @@ +name: Create 1.18 release + +on: + workflow_dispatch: + +jobs: + get_version: + runs-on: ubuntu-20.04 + outputs: + value: ${{ steps.version.outputs.version }} + steps: + - name: Output release version + id: version + run: echo "version=${{ github.run_number }}" >> "$GITHUB_OUTPUT" + + create_release: + runs-on: ubuntu-20.04 + container: ghcr.io/giganticminecraft/seichiassist-builder-v2:424c09f + needs: [get_version] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Prepare build dependencies cache + uses: actions/cache@v3 + env: + cache-name: cache-build-dependencies + cache-version: v-5 + with: + # sbt等は$HOMEではなくユーザーディレクトリを見ているようで、 + # GH Actionsでの ~ は /github/home/ に展開されるにもかかわらず + # 実際のキャッシュは /root/ 以下に配備される。 + # + # /root/.ivy/cache, /root/.sbt - sbt関連のキャッシュ + # /root/.m2 - ビルドログを観察した感じprotoc等はここを利用する + # /root/.cache - cousierがscalasbt等をキャッシュするのに使っている + path: | + /root/.ivy2/cache + /root/.sbt + /root/.m2 + /root/.cache + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ hashFiles('**/build.sbt') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- + + - name: Prepare build cache + if: github.ref != 'refs/heads/master' + uses: actions/cache@v3 + env: + cache-name: cache-build + cache-version: v-5 + with: + path: | + target + project/target + project/project/target + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}-${{ github.ref }}- + ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.cache-version }}- + + # CIでのcheckoutはファイルのタイムスタンプをチェックアウト時刻に設定するため、 + # そのままビルドするとlocalDependenciesにあるjarに変更が行われたと見なされ + # 不要なインクリメンタルコンパイルが走る + # タイムスタンプをコミット時刻に設定することでこれが回避できる + - name: Restore localDependencies' timestamps + # 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 + run: | + git config --global --add safe.directory /__w/SeichiAssist/SeichiAssist + for jar in localDependencies/*.jar; do + timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $jar` + touch -t "$timestamp" $jar + done + + # scalapbは.protoの再コンパイルの必要性を判定する際にタイムスタンプを見ているから、コミット時刻に合わせる + - name: Restore protocol timestamps + ## 参考: https://qiita.com/tomlla/items/219cea9dd071c8a9e147 + run: | + for proto in protocol/*.proto; do + timestamp=`git log -1 --pretty=format:'%cd' --date=format:'%Y%m%d%H%M.%S' $proto` + touch -t "$timestamp" $proto + done + + - name: Build artifact + run: ./sbt assembly + + - name: Rename artifact + run: | + mv target/build/SeichiAssist.jar target/build/SeichiAssist-for-1.18-v${{ needs.get_version.outputs.value }}.jar + + - name: Create release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: target/build/SeichiAssist-for-1.18-v${{ needs.get_version.outputs.value }}.jar + tag_name: "v${{ needs.get_version.outputs.value }}-for-1.18" + draft: false + + - name: Clean build artifact for caching target folder + run: rm -r target/build diff --git a/.gitignore b/.gitignore index bade594553..0d629f7d8b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,8 @@ # Local files deployLocal.sh -localDependencies/spigot-1.12.2.jar +localDependencies/spigot-1.18.2.jar +plugins/* # Docker docker/spigot/serverfiles/eula.txt diff --git a/.java-version b/.java-version new file mode 100644 index 0000000000..03b6389f32 --- /dev/null +++ b/.java-version @@ -0,0 +1 @@ +17.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1269c9143b..56916bff92 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,18 +2,18 @@ ## 開発を始めるために必要なもの - [IntelliJ IDEA](https://www.jetbrains.com/idea/) などの統合開発環境 -- [JDK 8](https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot) +- [AdoptOpenJDK 17](https://adoptium.net/temurin/releases/?version=17) - [sbt 1.6](https://www.scala-sbt.org/1.x/docs/Setup.html) - [Scala 2.13](https://www.scala-lang.org/download/) -- Spigot 1.12.2 +- Spigot 1.18.2 - Docker - GitHubのアカウント - Git ### 準備 #### Java Development Kit -最初に、Java Development Kit (JDK) 8をインストールする必要があります。 -[AdoptOpenJDK 1.8](https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot) のインストールを推奨します。 +最初に、Java Development Kit (JDK) 17をインストールする必要があります。 +[AdoptOpenJDK 17](https://adoptium.net/temurin/releases/?version=17) のインストールを推奨します。 #### 統合開発環境 次に、[IntelliJ IDEA](https://www.jetbrains.com/idea/)などの統合開発環境を導入します。 @@ -152,6 +152,10 @@ IntelliJ IDEAの設定でフォーマットに `scalafmt` を使う #### 手元でデバッグ SeichiAssistは手元でデバッグできる環境を整えています。環境を立ち上げるためには、Dockerが必要です。 +/pluginsディレクトリに対してjarファイル配置すると、そのjarファイルとSeichiAssistを同時に起動した場合の動作を確認することができます。 +整地鯖で利用しているプラグインはGiganticMinecraftのメンバーのみ[MinIOからダウンロード](https://minio-console.onp-k8s.admin.seichi.click/browser/seichi-plugins/ZGViLTEtMTYtNS8=)することができます。 +接続情報などの詳しい情報は、Discordで聞いてください。 + ##### Dockerを立ち上げる Linux環境では、`./prepare-docker.sh`、Windowsでは`prepare-docker.bat`を実行することで @@ -159,7 +163,7 @@ Linux環境では、`./prepare-docker.sh`、Windowsでは`prepare-docker.bat`を サーバーやDB等を停止する場合、 `docker compose down` を実行してください。 -なお、SeichiAssistがJDK 8以外でコンパイルされた場合は、実行時にエラーとなります。必ずJDKのバージョンを揃えるようにしてください。 +なお、SeichiAssistがJava 17未満でコンパイルされた場合は、実行時にエラーとなります。必ずJDKのバージョンを揃えるようにしてください。 ##### データベースの初期化 diff --git a/README.md b/README.md index 966d7cde88..c408412ebc 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,21 @@ [![GitHub Actions](https://github.com/GiganticMinecraft/SeichiAssist/actions/workflows/build_and_deploy.yml/badge.svg)](https://github.com/GiganticMinecraft/SeichiAssist/actions/workflows/build_and_deploy.yml) ## 開発環境 -- [Intellij IDEA](https://www.jetbrains.com/idea/) などの統合開発環境 -- [AdoptOpenJDK 1.8](https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot) +- [IntelliJ IDEA](https://www.jetbrains.com/idea/) などの統合開発環境 +- [AdoptOpenJDK 17](https://adoptium.net/temurin/releases/?version=17) - [Scala 2.13](https://www.scala-lang.org/download/) - [sbt 1.6](https://www.scala-sbt.org/1.x/docs/Setup.html) -- Spigot 1.12.2 +- Spigot 1.18.2 ## 前提プラグイン -- [CoreProtect-2.14.4](https://www.spigotmc.org/resources/coreprotect.8631/download?version=231781) -- [item-nbt-api-plugin-1.8.2-SNAPSHOT](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/download?version=241690) -- [Multiverse-Core-2.5.0](https://dev.bukkit.org/projects/multiverse-core/files/2428161/download) -- [Multiverse-Portals-2.5.0](https://dev.bukkit.org/projects/multiverse-portals/files/2428333/download) +- [CoreProtect-2.15.0](https://www.spigotmc.org/resources/coreprotect.8631/download?version=231781) +- [item-nbt-api-plugin-2.11.2](https://www.spigotmc.org/resources/item-entity-tile-nbt-api.7939/download?version=241690) +- [Multiverse-Core-4.3.1](https://dev.bukkit.org/projects/multiverse-core/files/2428161/download) +- [Multiverse-Portals-4.2.1](https://dev.bukkit.org/projects/multiverse-portals/files/2428333/download) - [ParticleAPI_v2.1.1](https://dl.inventivetalent.org/download/?file=plugin/ParticleAPI_v2.1.1) -- [WorldBorder1.8.7](https://dev.bukkit.org/projects/worldborder/files/2415838/download) -- [worldedit-bukkit-6.1.9](https://dev.bukkit.org/projects/worldedit/files/2597538/download) -- [worldguard-bukkit-6.2.2](https://dev.bukkit.org/projects/worldguard/files/2610618/download) +- [WorldBorder1.9.10 (beta)](https://www.spigotmc.org/resources/worldborder.60905/download?version=275003) +- [worldedit-bukkit-7.0.0](https://dev.bukkit.org/projects/worldedit/files/2597538/download) +- [worldguard-bukkit-7.0.0](https://dev.bukkit.org/projects/worldguard/files/2610618/download) ## 前提プラグイン(整地鯖内製) - RegenWorld [リポジトリ](https://github.com/GiganticMinecraft/RegenWorld) | [jar](https://redmine.seichi.click/attachments/download/890/RegenWorld-1.0.jar) diff --git a/build.sbt b/build.sbt index d0e535006f..6a6b33a3ce 100644 --- a/build.sbt +++ b/build.sbt @@ -58,11 +58,11 @@ val providedDependencies = Seq( "org.jetbrains" % "annotations" % "24.0.1", "org.apache.commons" % "commons-lang3" % "3.12.0", "commons-codec" % "commons-codec" % "1.15", - "org.spigotmc" % "spigot-api" % "1.12.2-R0.1-SNAPSHOT", + "org.spigotmc" % "spigot-api" % "1.18.2-R0.1-SNAPSHOT", // https://maven.enginehub.org/repo/com/sk89q/worldedit/worldedit-bukkit/ - "com.sk89q.worldguard" % "worldguard-legacy" % "6.2", - "net.coreprotect" % "coreprotect" % "2.14.2", - "com.mojang" % "authlib" % "1.6.25", + "com.sk89q.worldguard" % "worldguard-bukkit" % "7.0.7", + "net.coreprotect" % "coreprotect" % "21.3", + "com.mojang" % "authlib" % "3.11.50", // no runtime "org.typelevel" %% "simulacrum" % "1.0.1" diff --git a/docker-compose.yml b/compose.yml similarity index 94% rename from docker-compose.yml rename to compose.yml index 29679b9821..5a8066424e 100644 --- a/docker-compose.yml +++ b/compose.yml @@ -1,5 +1,3 @@ -version: '3.7' - networks: seichi: external: false @@ -23,9 +21,9 @@ services: - "25566:25565" - "7091:7091" environment: - - VERSION=1.12.2 + - VERSION=1.18.2 - EULA=TRUE - - TYPE=SPIGOT + - TYPE=PAPER - ONLINE_MODE=FALSE - ENABLE_JMX=true - JMX_PORT=7091 @@ -53,9 +51,9 @@ services: - "25567:25565" - "7092:7091" environment: - - VERSION=1.12.2 + - VERSION=1.18.2 - EULA=TRUE - - TYPE=SPIGOT + - TYPE=PAPER - ONLINE_MODE=FALSE - ENABLE_JMX=true - JMX_PORT=7091 @@ -72,7 +70,7 @@ services: - redis stdin_open: true bungeecord: - image: itzg/bungeecord:java8 + image: itzg/bungeecord:java17 ports: - "25565:25577" volumes: diff --git a/docker/spigot/Dockerfile b/docker/spigot/Dockerfile index 6b0d041581..153dc436c1 100644 --- a/docker/spigot/Dockerfile +++ b/docker/spigot/Dockerfile @@ -1,13 +1,11 @@ # syntax=docker/dockerfile:1.4 -FROM ghcr.io/giganticminecraft/chunk-search-rs:sha-598517c as chunk-search-provider -FROM ghcr.io/giganticminecraft/seichiassist-runner:ba2aa54 +FROM ghcr.io/giganticminecraft/chunk-search-rs:sha-f1943b1 as chunk-search-provider +FROM ghcr.io/giganticminecraft/seichiassist-runner-v2:3731293 -FROM itzg/minecraft-server:java8-multiarch +FROM itzg/minecraft-server:java17-jdk -# JDKとnkfをインストール -RUN apt-get update && apt-get install -y \ - nkf \ - openjdk-8-jdk \ +# nkfをインストール +RUN apt-get update && apt-get install -y nkf \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -20,9 +18,10 @@ chmod a+x /usr/local/bin/yq COPY --link --from=chunk-search-provider /build/chunk-search-rs /usr/bin/chunk-search-rs # プラグインとスクリプトをローカルからコピーする -COPY --link ./localDependencies/ /data/plugins/ COPY --link ./target/build/ /SeichiAssist/ COPY --link ./docker/spigot/ /data/ +ADD ./localDependencies/ /data/plugins/ +ADD ./plugins /plugins RUN chmod a+x /data/update-seichiassist.sh RUN nkf -Lu --overwrite /data/update-seichiassist.sh diff --git a/localDependencies/Multiverse-Core-2.5.0.jar b/localDependencies/Multiverse-Core-2.5.0.jar deleted file mode 100644 index bb694d66ae..0000000000 Binary files a/localDependencies/Multiverse-Core-2.5.0.jar and /dev/null differ diff --git a/localDependencies/Multiverse-Core-4.3.1.jar b/localDependencies/Multiverse-Core-4.3.1.jar new file mode 100644 index 0000000000..09b089552f Binary files /dev/null and b/localDependencies/Multiverse-Core-4.3.1.jar differ diff --git a/localDependencies/Multiverse-Portals-2.5.0.jar b/localDependencies/Multiverse-Portals-2.5.0.jar deleted file mode 100644 index 1527c60b6a..0000000000 Binary files a/localDependencies/Multiverse-Portals-2.5.0.jar and /dev/null differ diff --git a/localDependencies/Multiverse-Portals-4.2.1.jar b/localDependencies/Multiverse-Portals-4.2.1.jar new file mode 100644 index 0000000000..f4ed83cc7c Binary files /dev/null and b/localDependencies/Multiverse-Portals-4.2.1.jar differ diff --git a/localDependencies/WorldBorder.jar b/localDependencies/WorldBorder.jar index a6388760d2..151682c937 100644 Binary files a/localDependencies/WorldBorder.jar and b/localDependencies/WorldBorder.jar differ diff --git a/localDependencies/item-nbt-api-plugin-1.8.2-SNAPSHOT.jar b/localDependencies/item-nbt-api-plugin-1.8.2-SNAPSHOT.jar deleted file mode 100644 index 6c399eab4a..0000000000 Binary files a/localDependencies/item-nbt-api-plugin-1.8.2-SNAPSHOT.jar and /dev/null differ diff --git a/localDependencies/item-nbt-api-plugin-2.11.2.jar b/localDependencies/item-nbt-api-plugin-2.11.2.jar new file mode 100644 index 0000000000..f1f6904215 Binary files /dev/null and b/localDependencies/item-nbt-api-plugin-2.11.2.jar differ diff --git a/localDependencies/worldedit-bukkit-6.1.9.jar b/localDependencies/worldedit-bukkit-6.1.9.jar deleted file mode 100644 index fd5d0036f5..0000000000 Binary files a/localDependencies/worldedit-bukkit-6.1.9.jar and /dev/null differ diff --git a/localDependencies/worldedit-bukkit-7.2.14.jar b/localDependencies/worldedit-bukkit-7.2.14.jar new file mode 100644 index 0000000000..76af69ee03 Binary files /dev/null and b/localDependencies/worldedit-bukkit-7.2.14.jar differ diff --git a/localDependencies/worldguard-bukkit-6.2.2.jar b/localDependencies/worldguard-bukkit-6.2.2.jar deleted file mode 100644 index 2f615d493c..0000000000 Binary files a/localDependencies/worldguard-bukkit-6.2.2.jar and /dev/null differ diff --git a/localDependencies/worldguard-bukkit-7.0.7-dist.jar b/localDependencies/worldguard-bukkit-7.0.7-dist.jar new file mode 100644 index 0000000000..9c4ea0bb77 Binary files /dev/null and b/localDependencies/worldguard-bukkit-7.0.7-dist.jar differ diff --git a/prepare-docker.sh b/prepare-docker.sh index 1c9a029f30..3c63e62d00 100755 --- a/prepare-docker.sh +++ b/prepare-docker.sh @@ -4,6 +4,7 @@ build_image() { set -e rm -r target/build || true + ./sbt clean ## ソースコードからSeichiAssist.jarをビルド ./sbt assembly @@ -35,7 +36,7 @@ docker compose up --abort-on-container-exit ## 以下、リファレンス ## ## バックグラウンドでdockerコンテナを起動 -## (カレントディレクトリにdocker-compose.ymlが存在する必要がある) +## (カレントディレクトリにcompose.ymlが存在する必要がある) # docker compose up -d ## バックグラウンドで起動したdockerコンテナを停止 diff --git a/sbt b/sbt index 41eb81eca9..42c1aa581f 100755 --- a/sbt +++ b/sbt @@ -37,8 +37,8 @@ set -o pipefail declare -r sbt_release_version="1.9.0" declare -r sbt_unreleased_version="1.9.0" -declare -r latest_213="2.13.10" -declare -r latest_212="2.12.17" +declare -r latest_213="2.13.11" +declare -r latest_212="2.12.18" declare -r latest_211="2.11.12" declare -r latest_210="2.10.7" declare -r latest_29="2.9.3" diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3def2e3633..99dfab09e6 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -2,7 +2,9 @@ name: @name@ main: com.github.unchama.seichiassist.SeichiAssist version: @version@ -softdepend: [WorldGuard, CoreProtect] +api-version: 1.18 + +softdepend: [WorldGuard, CoreProtect, NBTAPI, Multiverse-Core, RegenWorld] loadbefore: # ワールドマイグレーション時にこれらプラグインのタスクがworldへの参照を持ちデータのGCが行われなくなる diff --git a/src/main/scala/com/github/unchama/buildassist/BuildAssist.scala b/src/main/scala/com/github/unchama/buildassist/BuildAssist.scala index 32072d60da..318116771b 100644 --- a/src/main/scala/com/github/unchama/buildassist/BuildAssist.scala +++ b/src/main/scala/com/github/unchama/buildassist/BuildAssist.scala @@ -97,8 +97,11 @@ object BuildAssist { , Material.COBBLESTONE // 丸石 , - Material.WOOD // 木 - , + Material.ACACIA_WOOD, + Material.BIRCH_WOOD, + Material.DARK_OAK_WOOD, + Material.JUNGLE_WOOD, + Material.OAK_WOOD, Material.SAND // 砂 , Material.GRAVEL // 砂利 @@ -109,18 +112,34 @@ object BuildAssist { , Material.COAL_ORE // 石炭鉱石 , - Material.LOG // 原木 - , + Material.ACACIA_LOG, + Material.BIRCH_LOG, + Material.DARK_OAK_LOG, + Material.JUNGLE_LOG, + Material.OAK_LOG, Material.GLASS // ガラス , Material.LAPIS_ORE // ラピス鉱石 , Material.LAPIS_BLOCK // ラピスB , - Material.SANDSTONE // 砂岩 - , - Material.WOOL // 羊毛 - , + Material.SANDSTONE, // 砂岩 + Material.BLACK_WOOL, + Material.BLUE_WOOL, + Material.BROWN_WOOL, + Material.CYAN_WOOL, + Material.GRAY_WOOL, + Material.GREEN_WOOL, + Material.LIGHT_BLUE_WOOL, + Material.LIGHT_GRAY_WOOL, + Material.LIME_WOOL, + Material.MAGENTA_WOOL, + Material.ORANGE_WOOL, + Material.PINK_WOOL, + Material.PURPLE_WOOL, + Material.RED_WOOL, + Material.WHITE_WOOL, + Material.YELLOW_WOOL, Material.GOLD_BLOCK // 金B , Material.IRON_BLOCK // 鉄B @@ -149,38 +168,76 @@ object BuildAssist { , Material.SOUL_SAND // ソウルサンド , - Material.GLOWSTONE // グロウストーン - , - Material.STAINED_GLASS // 色付きガラス - , - Material.SMOOTH_BRICK // 石レンガ - , - Material.MYCEL // 菌糸 + Material.GLOWSTONE, + Material.BLACK_STAINED_GLASS, + Material.BLUE_STAINED_GLASS, + Material.BROWN_STAINED_GLASS, + Material.CYAN_STAINED_GLASS, + Material.GRAY_STAINED_GLASS, + Material.GREEN_STAINED_GLASS, + Material.LIGHT_BLUE_STAINED_GLASS, + Material.LIGHT_GRAY_STAINED_GLASS, + Material.LIME_STAINED_GLASS, + Material.MAGENTA_STAINED_GLASS, + Material.ORANGE_STAINED_GLASS, + Material.PINK_STAINED_GLASS, + Material.PURPLE_STAINED_GLASS, + Material.RED_STAINED_GLASS, + Material.WHITE_STAINED_GLASS, + Material.YELLOW_STAINED_GLASS, + Material.STONE_BRICKS // 石レンガ + , + Material.MYCELIUM // 菌糸 , Material.NETHER_BRICK // ネザーレンガ , - Material.ENDER_STONE // エンドストーン + Material.END_STONE // エンドストーン , Material.EMERALD_ORE // エメ鉱石 , Material.EMERALD_BLOCK // エメB , - Material.COBBLE_WALL // 丸石の壁 + Material.COBBLESTONE_WALL // 丸石の壁 , - Material.QUARTZ_ORE // 水晶鉱石 + Material.NETHER_QUARTZ_ORE // 水晶鉱石 , Material.QUARTZ_BLOCK // 水晶B , - Material.STAINED_CLAY // 色付き固焼き粘土 - , - Material.LOG_2 // 原木2 - , + Material.BLACK_TERRACOTTA, + Material.BLUE_TERRACOTTA, + Material.BROWN_TERRACOTTA, + Material.CYAN_TERRACOTTA, + Material.GRAY_TERRACOTTA, + Material.GREEN_TERRACOTTA, + Material.LIGHT_BLUE_TERRACOTTA, + Material.LIGHT_GRAY_TERRACOTTA, + Material.LIME_TERRACOTTA, + Material.MAGENTA_TERRACOTTA, + Material.ORANGE_TERRACOTTA, + Material.PINK_TERRACOTTA, + Material.PURPLE_TERRACOTTA, + Material.RED_TERRACOTTA, + Material.WHITE_TERRACOTTA, + Material.YELLOW_TERRACOTTA, Material.PRISMARINE // プリズマリン , - Material.SEA_LANTERN // シーランタン - , - Material.HARD_CLAY // 固焼き粘土 - , + Material.SEA_LANTERN, // シーランタン + Material.BLACK_GLAZED_TERRACOTTA, + Material.BLUE_GLAZED_TERRACOTTA, + Material.BROWN_GLAZED_TERRACOTTA, + Material.CYAN_GLAZED_TERRACOTTA, + Material.GRAY_GLAZED_TERRACOTTA, + Material.GREEN_GLAZED_TERRACOTTA, + Material.LIGHT_BLUE_GLAZED_TERRACOTTA, + Material.LIGHT_GRAY_GLAZED_TERRACOTTA, + Material.LIME_GLAZED_TERRACOTTA, + Material.MAGENTA_GLAZED_TERRACOTTA, + Material.ORANGE_GLAZED_TERRACOTTA, + Material.PINK_GLAZED_TERRACOTTA, + Material.PURPLE_GLAZED_TERRACOTTA, + Material.RED_GLAZED_TERRACOTTA, + Material.WHITE_GLAZED_TERRACOTTA, + Material.YELLOW_GLAZED_TERRACOTTA, Material.COAL_BLOCK // 石炭B , Material.PACKED_ICE // 氷塊 @@ -191,22 +248,49 @@ object BuildAssist { , Material.PURPUR_PILLAR // 柱状プルパーブ , - Material.END_BRICKS // エンドレンガB + Material.END_STONE_BRICKS // エンドレンガB , - Material.RED_NETHER_BRICK // 赤ネザーレンガB + Material.RED_NETHER_BRICKS // 赤ネザーレンガB , Material.BONE_BLOCK // 骨B , - Material.NETHER_WART_BLOCK // ネザーウォートB - , - Material.CONCRETE // コンクリート - , - Material.CONCRETE_POWDER // コンクリートパウダー - , + Material.NETHER_WART_BLOCK, // ネザーウォートB + Material.BLACK_CONCRETE, + Material.BLUE_CONCRETE, + Material.BROWN_CONCRETE, + Material.CYAN_CONCRETE, + Material.GRAY_CONCRETE, + Material.GREEN_CONCRETE, + Material.LIGHT_BLUE_CONCRETE, + Material.LIGHT_GRAY_CONCRETE, + Material.LIME_CONCRETE, + Material.MAGENTA_CONCRETE, + Material.ORANGE_CONCRETE, + Material.PINK_CONCRETE, + Material.PURPLE_CONCRETE, + Material.RED_CONCRETE, + Material.WHITE_CONCRETE, + Material.YELLOW_CONCRETE, + Material.BLACK_CONCRETE_POWDER, + Material.BLUE_CONCRETE_POWDER, + Material.BROWN_CONCRETE_POWDER, + Material.CYAN_CONCRETE_POWDER, + Material.GRAY_CONCRETE_POWDER, + Material.GREEN_CONCRETE_POWDER, + Material.LIGHT_BLUE_CONCRETE_POWDER, + Material.LIGHT_GRAY_CONCRETE_POWDER, + Material.LIME_CONCRETE_POWDER, + Material.MAGENTA_CONCRETE_POWDER, + Material.ORANGE_CONCRETE_POWDER, + Material.PINK_CONCRETE_POWDER, + Material.PURPLE_CONCRETE_POWDER, + Material.RED_CONCRETE_POWDER, + Material.WHITE_CONCRETE_POWDER, + Material.YELLOW_CONCRETE_POWDER, Material.ACACIA_STAIRS, Material.ACACIA_FENCE, Material.ACACIA_FENCE_GATE, - Material.BIRCH_WOOD_STAIRS, + Material.BIRCH_STAIRS, Material.BIRCH_FENCE, Material.BIRCH_FENCE_GATE, Material.BONE_BLOCK, @@ -215,28 +299,33 @@ object BuildAssist { Material.BRICK_STAIRS, Material.CACTUS, Material.CHEST, - Material.CLAY_BRICK, Material.DARK_OAK_STAIRS, Material.DARK_OAK_FENCE, Material.DARK_OAK_FENCE_GATE, - Material.END_BRICKS, + Material.END_STONE_BRICKS, Material.FURNACE, Material.GLOWSTONE, - Material.HARD_CLAY, Material.JACK_O_LANTERN, Material.JUKEBOX, Material.JUNGLE_FENCE, Material.JUNGLE_FENCE_GATE, - Material.JUNGLE_WOOD_STAIRS, + Material.STRIPPED_JUNGLE_WOOD, Material.LADDER, - Material.LEAVES, - Material.LEAVES_2, - Material.LOG, - Material.LOG_2, + Material.OAK_LEAVES, + Material.BIRCH_LEAVES, + Material.JUNGLE_LEAVES, + Material.ACACIA_LEAVES, + Material.DARK_OAK_LEAVES, + Material.SPRUCE_LEAVES, + Material.ACACIA_LOG, + Material.BIRCH_LOG, + Material.DARK_OAK_LOG, + Material.JUNGLE_LOG, + Material.OAK_LOG, Material.NETHER_BRICK, Material.NETHER_BRICK_STAIRS, Material.NETHER_WART_BLOCK, - Material.RED_NETHER_BRICK, + Material.RED_NETHER_BRICKS, Material.OBSIDIAN, Material.PACKED_ICE, Material.PRISMARINE, @@ -252,31 +341,72 @@ object BuildAssist { Material.SANDSTONE_STAIRS, Material.SEA_LANTERN, Material.SLIME_BLOCK, - Material.SMOOTH_BRICK, - Material.SMOOTH_STAIRS, + Material.SMOOTH_STONE, + Material.CHISELED_STONE_BRICKS, + Material.CRACKED_STONE_BRICKS, + Material.INFESTED_STONE_BRICKS, + Material.MOSSY_STONE_BRICKS, + Material.STONE_BRICK_STAIRS, Material.SNOW_BLOCK, Material.SPRUCE_FENCE, Material.SPRUCE_FENCE_GATE, - Material.SPRUCE_WOOD_STAIRS, - Material.FENCE, - Material.FENCE_GATE, - Material.STAINED_CLAY, - Material.STAINED_GLASS, - Material.STAINED_GLASS_PANE, - Material.STEP, + Material.STRIPPED_ACACIA_WOOD, + Material.STRIPPED_BIRCH_WOOD, + Material.STRIPPED_DARK_OAK_WOOD, + Material.STRIPPED_JUNGLE_WOOD, + Material.STRIPPED_OAK_WOOD, + Material.OAK_FENCE, + Material.ACACIA_FENCE, + Material.BIRCH_FENCE, + Material.DARK_OAK_FENCE, + Material.JUNGLE_FENCE, + Material.OAK_FENCE_GATE, + Material.ACACIA_FENCE_GATE, + Material.BIRCH_FENCE_GATE, + Material.DARK_OAK_FENCE_GATE, + Material.JUNGLE_FENCE_GATE, + Material.OAK_FENCE_GATE, + Material.BLACK_STAINED_GLASS_PANE, + Material.BLUE_STAINED_GLASS_PANE, + Material.BROWN_STAINED_GLASS_PANE, + Material.CYAN_STAINED_GLASS_PANE, + Material.GRAY_STAINED_GLASS_PANE, + Material.GREEN_STAINED_GLASS_PANE, + Material.LIGHT_BLUE_STAINED_GLASS_PANE, + Material.LIGHT_GRAY_STAINED_GLASS_PANE, + Material.LIME_STAINED_GLASS_PANE, + Material.MAGENTA_STAINED_GLASS_PANE, + Material.ORANGE_STAINED_GLASS_PANE, + Material.PINK_STAINED_GLASS_PANE, + Material.PURPLE_STAINED_GLASS_PANE, + Material.RED_STAINED_GLASS_PANE, + Material.WHITE_STAINED_GLASS_PANE, + Material.YELLOW_STAINED_GLASS_PANE, + Material.ACACIA_SLAB, + Material.BIRCH_SLAB, + Material.DARK_OAK_SLAB, + Material.JUNGLE_SLAB, + Material.OAK_SLAB, Material.STONE, - Material.STONE_SLAB2, - Material.THIN_GLASS, + Material.STONE_SLAB, Material.TORCH, - Material.WOOD, - Material.WOOD_STAIRS, - Material.WOOD_STEP, - Material.WOOL, - Material.CARPET, - Material.WORKBENCH, - // #1008 - Material.LEAVES, - Material.LEAVES_2 + Material.BLACK_CARPET, + Material.BLUE_CARPET, + Material.BROWN_CARPET, + Material.CYAN_CARPET, + Material.GRAY_CARPET, + Material.GREEN_CARPET, + Material.LIGHT_BLUE_CARPET, + Material.LIGHT_GRAY_CARPET, + Material.LIME_CARPET, + Material.MAGENTA_CARPET, + Material.ORANGE_CARPET, + Material.PINK_CARPET, + Material.PURPLE_CARPET, + Material.RED_CARPET, + Material.WHITE_CARPET, + Material.YELLOW_CARPET, + Material.CRAFTING_TABLE ) // 直列設置ブロックの対象リスト @@ -291,8 +421,11 @@ object BuildAssist { , Material.COBBLESTONE // 丸石 , - Material.WOOD // 木 - , + Material.ACACIA_WOOD, + Material.BIRCH_WOOD, + Material.DARK_OAK_WOOD, + Material.JUNGLE_WOOD, + Material.OAK_WOOD, Material.SAND // 砂 , Material.GRAVEL // 砂利 @@ -303,8 +436,11 @@ object BuildAssist { , Material.COAL_ORE // 石炭鉱石 , - Material.LOG // 原木 - , + Material.ACACIA_LOG, + Material.BIRCH_LOG, + Material.DARK_OAK_LOG, + Material.JUNGLE_LOG, + Material.OAK_LOG, Material.GLASS // ガラス , Material.LAPIS_ORE // ラピス鉱石 @@ -313,8 +449,22 @@ object BuildAssist { , Material.SANDSTONE // 砂岩 , - Material.WOOL // 羊毛 - , + Material.BLACK_WOOL, + Material.BLUE_WOOL, + Material.BROWN_WOOL, + Material.CYAN_WOOL, + Material.GRAY_WOOL, + Material.GREEN_WOOL, + Material.LIGHT_BLUE_WOOL, + Material.LIGHT_GRAY_WOOL, + Material.LIME_WOOL, + Material.MAGENTA_WOOL, + Material.ORANGE_WOOL, + Material.PINK_WOOL, + Material.PURPLE_WOOL, + Material.RED_WOOL, + Material.WHITE_WOOL, + Material.YELLOW_WOOL, Material.GOLD_BLOCK // 金B , Material.IRON_BLOCK // 鉄B @@ -345,36 +495,76 @@ object BuildAssist { , Material.GLOWSTONE // グロウストーン , - Material.STAINED_GLASS // 色付きガラス - , - Material.SMOOTH_BRICK // 石レンガ - , - Material.MYCEL // 菌糸 + Material.BLACK_STAINED_GLASS, + Material.BLUE_STAINED_GLASS, + Material.BROWN_STAINED_GLASS, + Material.CYAN_STAINED_GLASS, + Material.GRAY_STAINED_GLASS, + Material.GREEN_STAINED_GLASS, + Material.LIGHT_BLUE_STAINED_GLASS, + Material.LIGHT_GRAY_STAINED_GLASS, + Material.LIME_STAINED_GLASS, + Material.MAGENTA_STAINED_GLASS, + Material.ORANGE_STAINED_GLASS, + Material.PINK_STAINED_GLASS, + Material.PURPLE_STAINED_GLASS, + Material.RED_STAINED_GLASS, + Material.WHITE_STAINED_GLASS, + Material.YELLOW_STAINED_GLASS, + Material.STONE_BRICKS // 石レンガ + , + Material.MYCELIUM // 菌糸 , Material.NETHER_BRICK // ネザーレンガ , - Material.ENDER_STONE // エンドストーン + Material.END_STONE // エンドストーン , Material.EMERALD_ORE // エメ鉱石 , Material.EMERALD_BLOCK // エメB , - Material.COBBLE_WALL // 丸石の壁 + Material.COBBLESTONE_WALL // 丸石の壁 , - Material.QUARTZ_ORE // 水晶鉱石 + Material.NETHER_QUARTZ_ORE // 水晶鉱石 , Material.QUARTZ_BLOCK // 水晶B , - Material.STAINED_CLAY // 色付き固焼き粘土 - , - Material.LOG_2 // 原木2 - , + Material.BLACK_TERRACOTTA, + Material.BLUE_TERRACOTTA, + Material.BROWN_TERRACOTTA, + Material.CYAN_TERRACOTTA, + Material.GRAY_TERRACOTTA, + Material.GREEN_TERRACOTTA, + Material.LIGHT_BLUE_TERRACOTTA, + Material.LIGHT_GRAY_TERRACOTTA, + Material.LIME_TERRACOTTA, + Material.MAGENTA_TERRACOTTA, + Material.ORANGE_TERRACOTTA, + Material.PINK_TERRACOTTA, + Material.PURPLE_TERRACOTTA, + Material.RED_TERRACOTTA, + Material.WHITE_TERRACOTTA, + Material.YELLOW_TERRACOTTA, Material.PRISMARINE // プリズマリン , Material.SEA_LANTERN // シーランタン , - Material.HARD_CLAY // 固焼き粘土 - , + Material.BLACK_GLAZED_TERRACOTTA, + Material.BLUE_GLAZED_TERRACOTTA, + Material.BROWN_GLAZED_TERRACOTTA, + Material.CYAN_GLAZED_TERRACOTTA, + Material.GRAY_GLAZED_TERRACOTTA, + Material.GREEN_GLAZED_TERRACOTTA, + Material.LIGHT_BLUE_GLAZED_TERRACOTTA, + Material.LIGHT_GRAY_GLAZED_TERRACOTTA, + Material.LIME_GLAZED_TERRACOTTA, + Material.MAGENTA_GLAZED_TERRACOTTA, + Material.ORANGE_GLAZED_TERRACOTTA, + Material.PINK_GLAZED_TERRACOTTA, + Material.PURPLE_GLAZED_TERRACOTTA, + Material.RED_GLAZED_TERRACOTTA, + Material.WHITE_GLAZED_TERRACOTTA, + Material.YELLOW_GLAZED_TERRACOTTA, Material.COAL_BLOCK // 石炭B , Material.PACKED_ICE // 氷塊 @@ -385,22 +575,53 @@ object BuildAssist { , Material.PURPUR_PILLAR // 柱状プルパーブ , - Material.END_BRICKS // エンドレンガB + Material.END_STONE_BRICKS // エンドレンガB , - Material.RED_NETHER_BRICK // 赤ネザーレンガB + Material.RED_NETHER_BRICKS // 赤ネザーレンガB , Material.BONE_BLOCK // 骨B , - Material.FENCE // オークフェンス - , - Material.IRON_FENCE // 鉄フェンス - , - Material.THIN_GLASS // 板ガラス - , - Material.NETHER_FENCE // ネザーフェンス - , - Material.STAINED_GLASS_PANE // 色付き板ガラス - , + Material.OAK_FENCE, + Material.ACACIA_FENCE, + Material.BIRCH_FENCE, + Material.DARK_OAK_FENCE, + Material.JUNGLE_FENCE, + Material.IRON_BARS // 鉄フェンス + , + Material.BLACK_STAINED_GLASS, + Material.BLUE_STAINED_GLASS, + Material.BROWN_STAINED_GLASS, + Material.CYAN_STAINED_GLASS, + Material.GRAY_STAINED_GLASS, + Material.GREEN_STAINED_GLASS, + Material.LIGHT_BLUE_STAINED_GLASS, + Material.LIGHT_GRAY_STAINED_GLASS, + Material.LIME_STAINED_GLASS, + Material.MAGENTA_STAINED_GLASS, + Material.ORANGE_STAINED_GLASS, + Material.PINK_STAINED_GLASS, + Material.PURPLE_STAINED_GLASS, + Material.RED_STAINED_GLASS, + Material.WHITE_STAINED_GLASS, + Material.YELLOW_STAINED_GLASS, + Material.NETHER_BRICK_FENCE // ネザーフェンス + , + Material.BLACK_STAINED_GLASS_PANE, + Material.BLUE_STAINED_GLASS_PANE, + Material.BROWN_STAINED_GLASS_PANE, + Material.CYAN_STAINED_GLASS_PANE, + Material.GRAY_STAINED_GLASS_PANE, + Material.GREEN_STAINED_GLASS_PANE, + Material.LIGHT_BLUE_STAINED_GLASS_PANE, + Material.LIGHT_GRAY_STAINED_GLASS_PANE, + Material.LIME_STAINED_GLASS_PANE, + Material.MAGENTA_STAINED_GLASS_PANE, + Material.ORANGE_STAINED_GLASS_PANE, + Material.PINK_STAINED_GLASS_PANE, + Material.PURPLE_STAINED_GLASS_PANE, + Material.RED_STAINED_GLASS_PANE, + Material.WHITE_STAINED_GLASS_PANE, + Material.YELLOW_STAINED_GLASS_PANE, Material.SLIME_BLOCK // スライムB , Material.SPRUCE_FENCE // 松フェンス @@ -413,40 +634,79 @@ object BuildAssist { , Material.ACACIA_FENCE // アカシアフェンス , - Material.NETHER_WART_BLOCK // ネザーウォートB - , - Material.CONCRETE // コンクリート - , - Material.CONCRETE_POWDER // コンクリートパウダー - , - Material.LEAVES, - Material.LEAVES_2 + Material.NETHER_WART_BLOCK, // ネザーウォートB + Material.BLACK_CONCRETE, + Material.BLUE_CONCRETE, + Material.BROWN_CONCRETE, + Material.CYAN_CONCRETE, + Material.GRAY_CONCRETE, + Material.GREEN_CONCRETE, + Material.LIGHT_BLUE_CONCRETE, + Material.LIGHT_GRAY_CONCRETE, + Material.LIME_CONCRETE, + Material.MAGENTA_CONCRETE, + Material.ORANGE_CONCRETE, + Material.PINK_CONCRETE, + Material.PURPLE_CONCRETE, + Material.RED_CONCRETE, + Material.WHITE_CONCRETE, + Material.YELLOW_CONCRETE, + Material.BLACK_CONCRETE_POWDER, + Material.BLUE_CONCRETE_POWDER, + Material.BROWN_CONCRETE_POWDER, + Material.CYAN_CONCRETE_POWDER, + Material.GRAY_CONCRETE_POWDER, + Material.GREEN_CONCRETE_POWDER, + Material.LIGHT_BLUE_CONCRETE_POWDER, + Material.LIGHT_GRAY_CONCRETE_POWDER, + Material.LIME_CONCRETE_POWDER, + Material.MAGENTA_CONCRETE_POWDER, + Material.ORANGE_CONCRETE_POWDER, + Material.PINK_CONCRETE_POWDER, + Material.PURPLE_CONCRETE_POWDER, + Material.RED_CONCRETE_POWDER, + Material.WHITE_CONCRETE_POWDER, + Material.YELLOW_CONCRETE_POWDER, + Material.OAK_LEAVES, + Material.BIRCH_LEAVES, + Material.JUNGLE_LEAVES, + Material.ACACIA_LEAVES, + Material.DARK_OAK_LEAVES, + Material.SPRUCE_LEAVES ) // ハーフブロックとして扱うMaterial val material_slab2: java.util.Set[Material] = util .EnumSet .of( - Material.STONE_SLAB2 // 赤砂岩 - , - Material.PURPUR_SLAB // プルパー - , - Material.WOOD_STEP // 木 - , - Material.STEP // 石 + Material.RED_SANDSTONE_SLAB, + Material.PURPUR_SLAB, + Material.ACACIA_SLAB, + Material.BIRCH_SLAB, + Material.DARK_OAK_SLAB, + Material.JUNGLE_SLAB, + Material.OAK_SLAB, + Material.STONE_SLAB, + Material.STONE_BRICK_SLAB ) val material_destruction: java.util.Set[Material] = util .EnumSet .of( - Material.LONG_GRASS // 草 - , + Material.GRASS, + Material.TALL_GRASS, Material.DEAD_BUSH // 枯れ木 , - Material.YELLOW_FLOWER // タンポポ - , - Material.RED_ROSE // 花9種 - , + Material.DANDELION, + Material.POPPY, + Material.BLUE_ORCHID, + Material.ALLIUM, + Material.AZURE_BLUET, + Material.RED_TULIP, + Material.ORANGE_TULIP, + Material.WHITE_TULIP, + Material.PINK_TULIP, + Material.OXEYE_DAISY, Material.BROWN_MUSHROOM // きのこ , Material.RED_MUSHROOM // 赤きのこ @@ -455,16 +715,15 @@ object BuildAssist { , Material.SNOW // 雪 , - Material.DOUBLE_PLANT // 高い花、草 - , + Material.SUNFLOWER, + Material.LILAC, + Material.LARGE_FERN, + Material.ROSE_BUSH, + Material.PEONY, Material.WATER // 水 , - Material.STATIONARY_WATER // 水 - , Material.LAVA // 溶岩 , - Material.STATIONARY_LAVA // 溶岩 - , Material.VINE // ツタ ) diff --git a/src/main/scala/com/github/unchama/buildassist/MenuInventoryData.scala b/src/main/scala/com/github/unchama/buildassist/MenuInventoryData.scala index 95666d3373..e0a80541bc 100644 --- a/src/main/scala/com/github/unchama/buildassist/MenuInventoryData.scala +++ b/src/main/scala/com/github/unchama/buildassist/MenuInventoryData.scala @@ -2,6 +2,8 @@ package com.github.unchama.buildassist import cats.effect.SyncIO import com.github.unchama.buildassist.util.AsyncInventorySetter +import com.github.unchama.itemstackbuilder.SkullItemStackBuilder +import com.github.unchama.seichiassist.SkullOwners import com.github.unchama.seichiassist.subsystems.itemmigration.infrastructure.minecraft.JdbcBackedUuidRepository import com.github.unchama.seichiassist.util.ItemMetaFactory import org.bukkit.ChatColor._ @@ -26,25 +28,21 @@ object MenuInventoryData { val playerdata = BuildAssist.instance.temporaryData(uuid) val inventory = Bukkit.getServer.createInventory(null, 4 * 9, s"$DARK_PURPLE$BOLD「直列設置」設定") - var itemstack = new ItemStack(Material.SKULL_ITEM, 1) - var itemmeta: ItemMeta = Bukkit.getItemFactory.getItemMeta(Material.WOOD) + var itemstack = new ItemStack(Material.PLAYER_HEAD, 11) + var itemmeta: ItemMeta = itemstack.getItemMeta val skullmeta: SkullMeta = ItemMetaFactory.SKULL.getValue var lore = List(s"$RESET$DARK_RED${UNDERLINE}クリックで移動") // ホームを開く itemstack.setDurability(3.toShort) - skullmeta.setDisplayName(s"$YELLOW$UNDERLINE${BOLD}ホームへ") - skullmeta.setLore(lore.asJava) - - /** - * 参加したことのないプレーヤーはgetOfflinePlayerでデータが取れないのでこうするしか無い - */ - skullmeta.setOwner("MHF_ArrowLeft") - itemstack.setItemMeta(skullmeta) + new SkullItemStackBuilder(SkullOwners.MHF_ArrowLeft) + .title(s"$YELLOW$UNDERLINE${BOLD}ホームへ") + .lore(lore) + .transformItemMetaOnBuild(skullmeta) AsyncInventorySetter.setItemAsync(inventory, 27, itemstack) // 直列設置設定 - itemstack = new ItemStack(Material.WOOD, 1) + itemstack = new ItemStack(Material.OAK_WOOD, 1) itemmeta.setDisplayName( s"$YELLOW$UNDERLINE${BOLD}直列設置 :${BuildAssist.line_up_str(playerdata.line_up_flg)}" ) @@ -59,8 +57,8 @@ object MenuInventoryData { inventory.setItem(0, itemstack) // 直列設置ハーフブロック設定 - itemstack = new ItemStack(Material.STEP, 1) - itemmeta = Bukkit.getItemFactory.getItemMeta(Material.STEP) + itemstack = new ItemStack(Material.STONE_SLAB, 1) + itemmeta = itemstack.getItemMeta itemmeta.setDisplayName( s"$YELLOW$UNDERLINE${BOLD}ハーフブロック設定 :${BuildAssist.line_up_step_str(playerdata.line_up_step_flg)}" ) diff --git a/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala b/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala index 539535777f..69f453401f 100644 --- a/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala +++ b/src/main/scala/com/github/unchama/buildassist/PlayerInventoryListener.scala @@ -58,7 +58,7 @@ class PlayerInventoryListener( // プレイヤーデータが無い場合は処理終了 // インベントリ名が以下の時処理 - if (topinventory.getTitle == s"${DARK_PURPLE.toString}$BOLD「直列設置」設定") { + if (view.getTitle == s"${DARK_PURPLE.toString}$BOLD「直列設置」設定") { event.setCancelled(true) // プレイヤーインベントリのクリックの場合終了 @@ -68,7 +68,7 @@ class PlayerInventoryListener( /* * クリックしたボタンに応じた各処理内容の記述ここから */ - if (itemstackcurrent.getType == Material.SKULL_ITEM) { + if (itemstackcurrent.getType == Material.PLAYER_HEAD) { // ホームメニューへ帰還 effectEnvironment.unsafeRunAsyncTargetedEffect(player)( @@ -78,7 +78,7 @@ class PlayerInventoryListener( ), "BuildMainMenuを開く" ) - } else if (itemstackcurrent.getType == Material.WOOD) { + } else if (itemstackcurrent.getType == Material.OAK_WOOD) { // 直列設置設定 if (playerLevel < BuildAssist.config.getblocklineuplevel) { player.sendMessage(RED.toString + "建築Lvが足りません") @@ -91,7 +91,7 @@ class PlayerInventoryListener( player.playSound(player.getLocation, Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f) player.openInventory(MenuInventoryData.getBlockLineUpData(player)) } - } else if (itemstackcurrent.getType == Material.STEP) { + } else if (itemstackcurrent.getType == Material.STONE_SLAB) { // 直列設置ハーフブロック設定 if (playerdata.line_up_step_flg >= 2) { playerdata.line_up_step_flg = 0 diff --git a/src/main/scala/com/github/unchama/buildassist/listener/BlockLineUpTriggerListener.scala b/src/main/scala/com/github/unchama/buildassist/listener/BlockLineUpTriggerListener.scala index 6ecd1281c6..fe1f2985d0 100644 --- a/src/main/scala/com/github/unchama/buildassist/listener/BlockLineUpTriggerListener.scala +++ b/src/main/scala/com/github/unchama/buildassist/listener/BlockLineUpTriggerListener.scala @@ -7,7 +7,8 @@ import com.github.unchama.seichiassist.subsystems.buildcount.application.actions import com.github.unchama.seichiassist.subsystems.buildcount.domain.explevel.BuildExpAmount import com.github.unchama.seichiassist.subsystems.mana.ManaApi import com.github.unchama.seichiassist.subsystems.minestack.MineStackAPI -import com.github.unchama.util.external.ExternalPlugins +import com.github.unchama.util.external.WorldGuardWrapper +import org.bukkit.block.data.`type`.Slab import org.bukkit.entity.Player import org.bukkit.event.block.Action import org.bukkit.event.player.PlayerInteractEvent @@ -15,6 +16,7 @@ import org.bukkit.event.{EventHandler, Listener} import org.bukkit.inventory.ItemStack import org.bukkit.{Material, Sound} +import scala.util.chaining.scalaUtilChainingOps import scala.util.control.Breaks class BlockLineUpTriggerListener[ @@ -61,7 +63,6 @@ class BlockLineUpTriggerListener[ val pl = player.getLocation val mainHandItemType = mainHandItem.getType - val mainHandItemData = mainHandItem.getData.getData // 仰角は下向きがプラスで上向きがマイナス val pitch = pl.getPitch @@ -132,30 +133,20 @@ class BlockLineUpTriggerListener[ Seq(Some(available), manaCap, Some(64L)).flatten.min }.toInt - def slabToDoubleSlab(material: Material) = material match { - case Material.STONE_SLAB2 => Material.DOUBLE_STONE_SLAB2 - case Material.PURPUR_SLAB => Material.PURPUR_DOUBLE_SLAB - case Material.WOOD_STEP => Material.WOOD_DOUBLE_STEP - case Material.STEP => Material.DOUBLE_STEP - case _ => mainHandItemType - } + def slabToDoubleSlab(material: Material): Material = + if (material.createBlockData().isInstanceOf[Slab]) { + material.asInstanceOf[Slab].tap(slab => slab.setType(Slab.Type.DOUBLE)).getMaterial + } else material val playerHoldsSlabBlock = BuildAssist.material_slab2.contains(mainHandItemType) - val doesHoldLeaves = - (mainHandItemType eq Material.LEAVES) || (mainHandItemType eq Material.LEAVES_2) + (mainHandItemType eq Material.OAK_LEAVES) || (mainHandItemType eq Material.DARK_OAK_LEAVES) || ( + mainHandItemType eq Material.BIRCH_LEAVES + ) || (mainHandItemType eq Material.ACACIA_LEAVES) || ( + mainHandItemType eq Material.JUNGLE_LEAVES + ) || (mainHandItemType eq Material.SPRUCE_LEAVES) val slabLineUpStepMode = buildAssistData.line_up_step_flg val shouldPlaceDoubleSlabs = playerHoldsSlabBlock && slabLineUpStepMode == 2 - val upsideBit = 8 - val noDecayBit = 8 - val placingBlockData: Byte = - if (playerHoldsSlabBlock && slabLineUpStepMode == 0) - (mainHandItemData | upsideBit).toByte - else if (doesHoldLeaves) - (mainHandItemData | noDecayBit).toByte - else - mainHandItemData - val (placingBlockType, itemConsumptionPerPlacement, placementIteration) = if (shouldPlaceDoubleSlabs) (slabToDoubleSlab(mainHandItemType), 2, maxBlockUsage / 2) @@ -174,7 +165,7 @@ class BlockLineUpTriggerListener[ val block = playerWorld.getBlockAt(px, py, pz) // 他人の保護がかかっている場合は設置終わり - if (!ExternalPlugins.getWorldGuard.canBuild(player, block.getLocation)) b.break + if (!WorldGuardWrapper.canBuild(player, block.getLocation)) b.break() if (block.getType != Material.AIR) { // 空気以外にぶつかり、ブロック破壊をしないならば終わる @@ -183,7 +174,7 @@ class BlockLineUpTriggerListener[ .material_destruction .contains(block.getType) || buildAssistData.line_up_des_flg == 0 ) { - b.break + b.break() } block.getDrops.asScala.foreach { @@ -192,7 +183,6 @@ class BlockLineUpTriggerListener[ } block.setType(placingBlockType) - block.setData(placingBlockData) placedBlockCount += itemConsumptionPerPlacement } diff --git a/src/main/scala/com/github/unchama/buildassist/listener/TilingSkillTriggerListener.scala b/src/main/scala/com/github/unchama/buildassist/listener/TilingSkillTriggerListener.scala index 6b530f7166..b6facec382 100644 --- a/src/main/scala/com/github/unchama/buildassist/listener/TilingSkillTriggerListener.scala +++ b/src/main/scala/com/github/unchama/buildassist/listener/TilingSkillTriggerListener.scala @@ -2,10 +2,11 @@ package com.github.unchama.buildassist.listener import cats.effect.ConcurrentEffect.ops.toAllConcurrentEffectOps import cats.effect.{ConcurrentEffect, SyncEffect, SyncIO} -import com.github.unchama.buildassist.{BuildAssist, Util} +import com.github.unchama.buildassist.BuildAssist import com.github.unchama.seichiassist.subsystems.buildcount.application.actions.IncrementBuildExpWhenBuiltWithSkill import com.github.unchama.seichiassist.subsystems.buildcount.domain.explevel.BuildExpAmount import com.github.unchama.seichiassist.subsystems.minestack.MineStackAPI +import com.github.unchama.util.external.WorldGuardWrapper import org.bukkit.ChatColor.RED import org.bukkit.entity.Player import org.bukkit.event.block.Action @@ -48,10 +49,7 @@ class TilingSkillTriggerListener[G[_]: ConcurrentEffect, F[ ) return val clickedBlock = event.getClickedBlock - val offHandItemSelector = offHandItem.getData.getData - if ( - !(offHandItem.getType == clickedBlock.getType && offHandItemSelector == clickedBlock.getData) - ) { + if (!(offHandItem.getType == clickedBlock.getType)) { player.sendMessage(s"$RED「オフハンドと同じブロック」をクリックしてください。(基準になります)") return } @@ -79,29 +77,30 @@ class TilingSkillTriggerListener[G[_]: ConcurrentEffect, F[ val replaceableMaterials = Set( Material.AIR, Material.SNOW, - Material.LONG_GRASS, + Material.TALL_GRASS, Material.DEAD_BUSH, - Material.YELLOW_FLOWER, - Material.RED_ROSE, + Material.DANDELION, + Material.POPPY, + Material.BLUE_ORCHID, + Material.ALLIUM, + Material.AZURE_BLUET, + Material.RED_TULIP, + Material.ORANGE_TULIP, + Material.WHITE_TULIP, + Material.PINK_TULIP, + Material.OXEYE_DAISY, + Material.SUNFLOWER, + Material.LILAC, + Material.LARGE_FERN, + Material.ROSE_BUSH, + Material.PEONY, Material.RED_MUSHROOM, Material.BROWN_MUSHROOM ) - val fillTargetMaterials = Set( - Material.AIR, - Material.LAVA, - Material.STATIONARY_LAVA, - Material.WATER, - Material.STATIONARY_WATER - ) + val fillTargetMaterials = Set(Material.AIR, Material.LAVA, Material.WATER) val b1 = new Breaks - val rawDataModifier: Byte => Byte = offHandItem.getType match { - case Material.LEAVES | Material.LEAVES_2 => - val noDecayBit: Byte = 8 - x => (x | noDecayBit).asInstanceOf[Byte] - case _ => identity - } b1.breakable { val targetXValues = centerX - areaInt to centerX + areaInt @@ -121,7 +120,7 @@ class TilingSkillTriggerListener[G[_]: ConcurrentEffect, F[ val blockToBeReplaced = fillLocation.getBlock if (fillTargetMaterials.contains(blockToBeReplaced.getType)) { - if (Util.getWorldGuard.canBuild(player, fillLocation)) { + if (WorldGuardWrapper.canBuild(player, fillLocation)) { blockToBeReplaced.setType(Material.DIRT) } else { // 他人の保護がかかっている場合は通知を行う @@ -137,7 +136,6 @@ class TilingSkillTriggerListener[G[_]: ConcurrentEffect, F[ } targetSurfaceBlock.setType(offHandItem.getType) - targetSurfaceBlock.setData(rawDataModifier(offHandItemSelector)) placementCount += 1 } @@ -179,7 +177,7 @@ class TilingSkillTriggerListener[G[_]: ConcurrentEffect, F[ if (replaceableMaterials.contains(targetSurfaceBlock.getType)) { // 他人の保護がかかっている場合は処理を終了 - if (!Util.getWorldGuard.canBuild(player, targetSurfaceLocation)) { + if (!WorldGuardWrapper.canBuild(player, targetSurfaceLocation)) { player.sendMessage(s"${RED}付近に誰かの保護がかかっているようです") b1.break() } diff --git a/src/main/scala/com/github/unchama/datarepository/bukkit/player/BukkitRepositoryControls.scala b/src/main/scala/com/github/unchama/datarepository/bukkit/player/BukkitRepositoryControls.scala index fe292bf311..4c81d3d23c 100644 --- a/src/main/scala/com/github/unchama/datarepository/bukkit/player/BukkitRepositoryControls.scala +++ b/src/main/scala/com/github/unchama/datarepository/bukkit/player/BukkitRepositoryControls.scala @@ -163,7 +163,7 @@ object BukkitRepositoryControls { private def backupProcess[F[_]: Sync, Key, R]( finalization: RepositoryFinalization[F, Key, R] )(dataMap: TrieMap[Key, R]): F[Unit] = { - Sync[F].suspend { + Sync[F].defer { dataMap.toList.traverse(finalization.persistPair.tupled).as(()) } } diff --git a/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala b/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala index a48ed7755b..a287935e9a 100644 --- a/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala +++ b/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricSignallingRef.scala @@ -90,7 +90,7 @@ object AsymmetricSignallingRef { override val valuesAwait: Resource[F, Stream[F, A]] = changeTopic.subscribeAwait(topicQueueSize).flatMap { subscription => Resource - .liftF { + .eval { state.get.map { currentValue => subscription .through(ReorderingPipe.withInitialToken[F, A](currentValue.nextStamp)) diff --git a/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricTryableDeferred.scala b/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricTryableDeferred.scala index 17373b4c1b..d6debefe1a 100644 --- a/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricTryableDeferred.scala +++ b/src/main/scala/com/github/unchama/generic/effect/concurrent/AsymmetricTryableDeferred.scala @@ -119,7 +119,7 @@ object AsymmetricTryableDeferred { implicit F: Concurrent[F] ) extends AsymmetricTryableDeferred[F, A] { def get: F[A] = - F.suspend { + F.defer { ref.get match { case State.Set(a) => F.pure(a) @@ -168,7 +168,7 @@ object AsymmetricTryableDeferred { } def complete(a: A): F[Unit] = - F.suspend(unsafeComplete(a)) + F.defer(unsafeComplete(a)) @tailrec private def unsafeComplete(a: A): F[Unit] = diff --git a/src/main/scala/com/github/unchama/itemmigration/bukkit/targets/WorldLevelData.scala b/src/main/scala/com/github/unchama/itemmigration/bukkit/targets/WorldLevelData.scala index 54664f1147..07b646fe5b 100644 --- a/src/main/scala/com/github/unchama/itemmigration/bukkit/targets/WorldLevelData.scala +++ b/src/main/scala/com/github/unchama/itemmigration/bukkit/targets/WorldLevelData.scala @@ -109,7 +109,7 @@ object WorldLevelData { } private def queueChunkSaverFlush[F[_]](implicit F: Concurrent[F], logger: Logger) = { - import com.github.unchama.util.nms.v1_12_2.world.WorldChunkSaving + import com.github.unchama.util.nms.v1_18_2.world.WorldChunkSaving F.delay { logger.info("チャンクの保存キューの処理を要求します…") @@ -123,7 +123,7 @@ object WorldLevelData { } private def flushEntityRemovalQueue[F[_]: Sync](worldRef: Ref[F, World]): F[Unit] = { - import com.github.unchama.util.nms.v1_12_2.world.WorldChunkSaving + import com.github.unchama.util.nms.v1_18_2.world.WorldChunkSaving worldRef.get >>= WorldChunkSaving.flushEntityRemovalQueue[F] } diff --git a/src/main/scala/com/github/unchama/itemstackbuilder/AbstractItemStackBuilder.scala b/src/main/scala/com/github/unchama/itemstackbuilder/AbstractItemStackBuilder.scala index 2048320be8..dd2db3b87a 100644 --- a/src/main/scala/com/github/unchama/itemstackbuilder/AbstractItemStackBuilder.scala +++ b/src/main/scala/com/github/unchama/itemstackbuilder/AbstractItemStackBuilder.scala @@ -13,12 +13,10 @@ import org.bukkit.inventory.{ItemFlag, ItemStack} * @author * karayuu */ -abstract class AbstractItemStackBuilder[-M <: ItemMeta] protected ( - material: Material, - durability: Short -) extends ItemStackBuilder { +abstract class AbstractItemStackBuilder[-M <: ItemMeta] protected (material: Material) + extends ItemStackBuilder { - private val component: IconComponent = new IconComponent(material, durability) + private val component: IconComponent = new IconComponent(material) final override def build(): ItemStack = { val itemStack = component.itemStack() diff --git a/src/main/scala/com/github/unchama/itemstackbuilder/IconItemStackBuilder.scala b/src/main/scala/com/github/unchama/itemstackbuilder/IconItemStackBuilder.scala index 1e1a3fa24b..ff33a32f77 100644 --- a/src/main/scala/com/github/unchama/itemstackbuilder/IconItemStackBuilder.scala +++ b/src/main/scala/com/github/unchama/itemstackbuilder/IconItemStackBuilder.scala @@ -12,8 +12,8 @@ import org.bukkit.inventory.meta.ItemMeta * @param durability * ダメージ値 Created by karayuu on 2019/03/30 */ -class IconItemStackBuilder(material: Material, durability: Short = 0.toShort) - extends AbstractItemStackBuilder[ItemMeta](material, durability) { +class IconItemStackBuilder(material: Material) + extends AbstractItemStackBuilder[ItemMeta](material) { private var shouldShowAttribute: Boolean = false /** diff --git a/src/main/scala/com/github/unchama/itemstackbuilder/SkullItemStackBuilder.scala b/src/main/scala/com/github/unchama/itemstackbuilder/SkullItemStackBuilder.scala index 32a5326e42..803e2a0ff1 100644 --- a/src/main/scala/com/github/unchama/itemstackbuilder/SkullItemStackBuilder.scala +++ b/src/main/scala/com/github/unchama/itemstackbuilder/SkullItemStackBuilder.scala @@ -3,7 +3,7 @@ package com.github.unchama.itemstackbuilder import com.mojang.authlib.GameProfile import com.mojang.authlib.properties.Property import org.bukkit.inventory.meta.SkullMeta -import org.bukkit.{Bukkit, Material, SkullType} +import org.bukkit.{Bukkit, Material} import java.util.UUID @@ -11,10 +11,7 @@ import java.util.UUID * Created by karayuu on 2019/04/09 */ class SkullItemStackBuilder(private val owner: SkullOwnerReference) - extends AbstractItemStackBuilder[SkullMeta]( - Material.SKULL_ITEM, - SkullType.PLAYER.ordinal.toShort - ) { + extends AbstractItemStackBuilder[SkullMeta](Material.PLAYER_HEAD) { /** * プレーヤーがサーバーに参加したことのない場合に 頭のスキンを読み込むことができないため、そのようなケースが想定されるされる箇所では @@ -25,13 +22,13 @@ class SkullItemStackBuilder(private val owner: SkullOwnerReference) * @see * SkullMeta.setOwner * @param ownerUUID - * [Material.SKULL_ITEM] に表示するプレーヤーのUUID + * [Material.PLAYER_HEAD] に表示するプレーヤーのUUID */ def this(ownerUUID: UUID) = this(SkullOwnerUuid(ownerUUID)) /** * @param ownerName - * [Material.SKULL_ITEM] に表示するプレーヤーの名前 + * [Material.PLAYER_HEAD] に表示するプレーヤーの名前 */ def this(ownerName: String) = this(SkullOwnerName(ownerName)) diff --git a/src/main/scala/com/github/unchama/itemstackbuilder/TippedArrowIconItemStackBuilder.scala b/src/main/scala/com/github/unchama/itemstackbuilder/TippedArrowIconItemStackBuilder.scala index 2cfde169b9..02113dd995 100644 --- a/src/main/scala/com/github/unchama/itemstackbuilder/TippedArrowIconItemStackBuilder.scala +++ b/src/main/scala/com/github/unchama/itemstackbuilder/TippedArrowIconItemStackBuilder.scala @@ -6,7 +6,7 @@ import org.bukkit.inventory.meta.PotionMeta import org.bukkit.potion.{PotionData, PotionType} class TippedArrowIconItemStackBuilder(val potionData: PotionData) - extends AbstractItemStackBuilder[PotionMeta](Material.TIPPED_ARROW, 0) { + extends AbstractItemStackBuilder[PotionMeta](Material.TIPPED_ARROW) { def this(potionType: PotionType) = this(new PotionData(potionType)) diff --git a/src/main/scala/com/github/unchama/itemstackbuilder/component/IconComponent.scala b/src/main/scala/com/github/unchama/itemstackbuilder/component/IconComponent.scala index f36c28c4b1..9164c87019 100644 --- a/src/main/scala/com/github/unchama/itemstackbuilder/component/IconComponent.scala +++ b/src/main/scala/com/github/unchama/itemstackbuilder/component/IconComponent.scala @@ -13,7 +13,7 @@ import scala.jdk.javaapi.CollectionConverters.asJava * * Created by karayuu on 2019/04/09 */ -class IconComponent(val material: Material, private val durability: Short = 0.toShort) { +class IconComponent(val material: Material) { var title: String = Bukkit.getItemFactory.getItemMeta(material).ifNotNull(_.getDisplayName) var lore: List[String] = Nil @@ -24,7 +24,7 @@ class IconComponent(val material: Material, private val durability: Short = 0.to var itemFlagSet: Set[ItemFlag] = Set() - def itemStack(): ItemStack = new ItemStack(material, amount, durability) + def itemStack(): ItemStack = new ItemStack(material, amount) def itemMeta(): ItemMeta = { val meta = Bukkit.getItemFactory.getItemMeta(material) diff --git a/src/main/scala/com/github/unchama/seichiassist/MaterialSets.scala b/src/main/scala/com/github/unchama/seichiassist/MaterialSets.scala index 5f8a9a6498..fa18fcb483 100644 --- a/src/main/scala/com/github/unchama/seichiassist/MaterialSets.scala +++ b/src/main/scala/com/github/unchama/seichiassist/MaterialSets.scala @@ -13,9 +13,8 @@ object MaterialSets { Material.LAPIS_ORE, Material.EMERALD_ORE, Material.REDSTONE_ORE, - Material.GLOWING_REDSTONE_ORE, - Material.QUARTZ_ORE, - Material.MELON_BLOCK, + Material.NETHER_QUARTZ_ORE, + Material.MELON, Material.SEA_LANTERN ) @@ -26,58 +25,189 @@ object MaterialSets { Material.NETHER_BRICK, Material.DIRT, Material.GRAVEL, - Material.LOG, - Material.LOG_2, + Material.ACACIA_LOG, + Material.BIRCH_LOG, + Material.DARK_OAK_LOG, + Material.JUNGLE_LOG, + Material.OAK_LOG, Material.GRASS, Material.IRON_ORE, Material.GOLD_ORE, Material.SAND, Material.SANDSTONE, - Material.RED_SANDSTONE, - Material.END_BRICKS, - Material.ENDER_STONE, + Material.END_STONE_BRICKS, + Material.END_STONE, Material.ICE, Material.PACKED_ICE, Material.OBSIDIAN, - Material.MAGMA, + Material.MAGMA_BLOCK, Material.SOUL_SAND, - Material.LEAVES, - Material.LEAVES_2, + Material.OAK_LEAVES, + Material.BIRCH_LEAVES, + Material.JUNGLE_LEAVES, + Material.ACACIA_LEAVES, + Material.DARK_OAK_LEAVES, + Material.SPRUCE_LEAVES, Material.CLAY, - Material.STAINED_CLAY, + Material.BLACK_TERRACOTTA, + Material.BLUE_TERRACOTTA, + Material.BROWN_TERRACOTTA, + Material.CYAN_TERRACOTTA, + Material.GRAY_TERRACOTTA, + Material.GREEN_TERRACOTTA, + Material.LIGHT_BLUE_TERRACOTTA, + Material.LIGHT_GRAY_TERRACOTTA, + Material.LIME_TERRACOTTA, + Material.MAGENTA_TERRACOTTA, + Material.ORANGE_TERRACOTTA, + Material.PINK_TERRACOTTA, + Material.PURPLE_TERRACOTTA, + Material.RED_TERRACOTTA, + Material.WHITE_TERRACOTTA, + Material.YELLOW_TERRACOTTA, Material.COBBLESTONE, Material.MOSSY_COBBLESTONE, - Material.HARD_CLAY, - Material.MONSTER_EGGS, - Material.WEB, - Material.WOOD, - Material.FENCE, + Material.BLACK_GLAZED_TERRACOTTA, + Material.BLUE_GLAZED_TERRACOTTA, + Material.BROWN_GLAZED_TERRACOTTA, + Material.CYAN_GLAZED_TERRACOTTA, + Material.GRAY_GLAZED_TERRACOTTA, + Material.GREEN_GLAZED_TERRACOTTA, + Material.LIGHT_BLUE_GLAZED_TERRACOTTA, + Material.LIGHT_GRAY_GLAZED_TERRACOTTA, + Material.LIME_GLAZED_TERRACOTTA, + Material.MAGENTA_GLAZED_TERRACOTTA, + Material.ORANGE_GLAZED_TERRACOTTA, + Material.PINK_GLAZED_TERRACOTTA, + Material.PURPLE_GLAZED_TERRACOTTA, + Material.RED_GLAZED_TERRACOTTA, + Material.WHITE_GLAZED_TERRACOTTA, + Material.YELLOW_GLAZED_TERRACOTTA, + Material.BAT_SPAWN_EGG, + Material.BLAZE_SPAWN_EGG, + Material.CAVE_SPIDER_SPAWN_EGG, + Material.CHICKEN_SPAWN_EGG, + Material.COD_SPAWN_EGG, + Material.COW_SPAWN_EGG, + Material.CREEPER_SPAWN_EGG, + Material.DOLPHIN_SPAWN_EGG, + Material.DONKEY_SPAWN_EGG, + Material.DROWNED_SPAWN_EGG, + Material.ELDER_GUARDIAN_SPAWN_EGG, + Material.ENDERMAN_SPAWN_EGG, + Material.ENDERMITE_SPAWN_EGG, + Material.EVOKER_SPAWN_EGG, + Material.GHAST_SPAWN_EGG, + Material.GUARDIAN_SPAWN_EGG, + Material.HORSE_SPAWN_EGG, + Material.HUSK_SPAWN_EGG, + Material.LLAMA_SPAWN_EGG, + Material.MAGMA_CUBE_SPAWN_EGG, + Material.MOOSHROOM_SPAWN_EGG, + Material.MULE_SPAWN_EGG, + Material.OCELOT_SPAWN_EGG, + Material.PARROT_SPAWN_EGG, + Material.PHANTOM_SPAWN_EGG, + Material.PIG_SPAWN_EGG, + Material.POLAR_BEAR_SPAWN_EGG, + Material.PUFFERFISH_SPAWN_EGG, + Material.RABBIT_SPAWN_EGG, + Material.SALMON_SPAWN_EGG, + Material.SHEEP_SPAWN_EGG, + Material.SHULKER_SPAWN_EGG, + Material.SILVERFISH_SPAWN_EGG, + Material.SKELETON_HORSE_SPAWN_EGG, + Material.SKELETON_SPAWN_EGG, + Material.SLIME_SPAWN_EGG, + Material.SPIDER_SPAWN_EGG, + Material.SQUID_SPAWN_EGG, + Material.STRAY_SPAWN_EGG, + Material.TROPICAL_FISH_SPAWN_EGG, + Material.TURTLE_SPAWN_EGG, + Material.VEX_SPAWN_EGG, + Material.VILLAGER_SPAWN_EGG, + Material.VINDICATOR_SPAWN_EGG, + Material.WITCH_SPAWN_EGG, + Material.WITHER_SKELETON_SPAWN_EGG, + Material.WOLF_SPAWN_EGG, + Material.ZOMBIE_HORSE_SPAWN_EGG, + Material.ZOMBIFIED_PIGLIN_SPAWN_EGG, + Material.ZOMBIE_SPAWN_EGG, + Material.ZOMBIE_VILLAGER_SPAWN_EGG, + Material.COBWEB, + Material.ACACIA_WOOD, + Material.BIRCH_WOOD, + Material.DARK_OAK_WOOD, + Material.JUNGLE_WOOD, + Material.OAK_WOOD, + Material.OAK_FENCE, + Material.ACACIA_FENCE, + Material.BIRCH_FENCE, + Material.DARK_OAK_FENCE, + Material.JUNGLE_FENCE, Material.DARK_OAK_FENCE, - Material.RAILS, - Material.MYCEL, + Material.RAIL, + Material.POWERED_RAIL, + Material.DETECTOR_RAIL, + Material.ACTIVATOR_RAIL, + Material.MYCELIUM, Material.SNOW_BLOCK, - Material.HUGE_MUSHROOM_1, - Material.HUGE_MUSHROOM_2, + Material.BROWN_MUSHROOM, + Material.RED_MUSHROOM, Material.BONE_BLOCK, Material.PURPUR_BLOCK, Material.PURPUR_PILLAR, Material.SEA_LANTERN, Material.PRISMARINE, - Material.SMOOTH_BRICK, + Material.STONE_BRICKS, Material.GLOWSTONE, - Material.STAINED_GLASS, - Material.STAINED_GLASS_PANE, - Material.THIN_GLASS, + Material.BLACK_STAINED_GLASS, + Material.BLUE_STAINED_GLASS, + Material.BROWN_STAINED_GLASS, + Material.CYAN_STAINED_GLASS, + Material.GRAY_STAINED_GLASS, + Material.GREEN_STAINED_GLASS, + Material.LIGHT_BLUE_STAINED_GLASS, + Material.LIGHT_GRAY_STAINED_GLASS, + Material.LIME_STAINED_GLASS, + Material.MAGENTA_STAINED_GLASS, + Material.ORANGE_STAINED_GLASS, + Material.PINK_STAINED_GLASS, + Material.PURPLE_STAINED_GLASS, + Material.RED_STAINED_GLASS, + Material.WHITE_STAINED_GLASS, + Material.YELLOW_STAINED_GLASS, + Material.BLACK_STAINED_GLASS_PANE, + Material.BLUE_STAINED_GLASS_PANE, + Material.BROWN_STAINED_GLASS_PANE, + Material.CYAN_STAINED_GLASS_PANE, + Material.GRAY_STAINED_GLASS_PANE, + Material.GREEN_STAINED_GLASS_PANE, + Material.LIGHT_BLUE_STAINED_GLASS_PANE, + Material.LIGHT_GRAY_STAINED_GLASS_PANE, + Material.LIME_STAINED_GLASS_PANE, + Material.MAGENTA_STAINED_GLASS_PANE, + Material.ORANGE_STAINED_GLASS_PANE, + Material.PINK_STAINED_GLASS_PANE, + Material.PURPLE_STAINED_GLASS_PANE, + Material.RED_STAINED_GLASS_PANE, + Material.WHITE_STAINED_GLASS_PANE, + Material.YELLOW_STAINED_GLASS_PANE, Material.GLASS, - Material.WOOD_STAIRS, - Material.BIRCH_WOOD_STAIRS, - Material.SPRUCE_WOOD_STAIRS, + Material.ACACIA_STAIRS, + Material.BIRCH_STAIRS, + Material.BRICK_STAIRS, + Material.DARK_OAK_STAIRS, + Material.NETHER_BRICK_STAIRS, + Material.PURPUR_STAIRS, + Material.QUARTZ_STAIRS, + Material.SANDSTONE_STAIRS, + Material.STONE_BRICK_STAIRS, Material.ACACIA_STAIRS, Material.DARK_OAK_STAIRS, Material.BIRCH_FENCE, Material.SPRUCE_FENCE, Material.ACACIA_FENCE, - Material.FENCE_GATE, Material.BIRCH_FENCE_GATE, Material.SPRUCE_FENCE_GATE, Material.ACACIA_FENCE_GATE, @@ -87,71 +217,119 @@ object MaterialSets { Material.BRICK_STAIRS, Material.QUARTZ_STAIRS, Material.BOOKSHELF, - Material.IRON_FENCE, Material.ICE, - Material.WOOL, + Material.BLACK_WOOL, + Material.BLUE_WOOL, + Material.BROWN_WOOL, + Material.CYAN_WOOL, + Material.GRAY_WOOL, + Material.GREEN_WOOL, + Material.LIGHT_BLUE_WOOL, + Material.LIGHT_GRAY_WOOL, + Material.LIME_WOOL, + Material.MAGENTA_WOOL, + Material.ORANGE_WOOL, + Material.PINK_WOOL, + Material.PURPLE_WOOL, + Material.RED_WOOL, + Material.WHITE_WOOL, + Material.YELLOW_WOOL, Material.GOLD_BLOCK, Material.END_ROD, Material.PUMPKIN, - Material.MELON_BLOCK, - Material.STONE_SLAB2, + Material.MELON, + Material.RED_SANDSTONE_SLAB, Material.SPONGE, - Material.SOIL, - Material.GRASS_PATH, - Material.MOB_SPAWNER, - Material.WORKBENCH, + Material.FARMLAND, + Material.DIRT_PATH, + Material.SPAWNER, + Material.CRAFTING_TABLE, Material.FURNACE, Material.QUARTZ_BLOCK, Material.CHEST, Material.TRAPPED_CHEST, - Material.NETHER_FENCE, + Material.NETHER_BRICK_FENCE, Material.NETHER_BRICK_STAIRS, Material.CAULDRON, Material.END_ROD, Material.PURPUR_STAIRS, - Material.END_BRICKS, + Material.END_STONE_BRICKS, Material.PURPUR_SLAB, Material.ENDER_CHEST, Material.PURPUR_SLAB, - Material.STEP, - Material.DOUBLE_STEP, - Material.ENDER_PORTAL_FRAME, - Material.ENDER_PORTAL, + Material.STONE_SLAB, + Material.NETHER_BRICK_SLAB, + Material.COBBLESTONE_SLAB, + Material.END_PORTAL_FRAME, + Material.END_PORTAL, Material.VINE, // #913 - Material.BED_BLOCK, - Material.TRAP_DOOR, + Material.BLACK_BED, + Material.BLUE_BED, + Material.BROWN_BED, + Material.CYAN_BED, + Material.GRAY_BED, + Material.GREEN_BED, + Material.LIGHT_BLUE_BED, + Material.LIGHT_GRAY_BED, + Material.LIME_BED, + Material.MAGENTA_BED, + Material.ORANGE_BED, + Material.PINK_BED, + Material.PURPLE_BED, + Material.RED_BED, + Material.WHITE_BED, + Material.YELLOW_BED, + Material.BIRCH_TRAPDOOR, + Material.OAK_TRAPDOOR, + Material.ACACIA_TRAPDOOR, + Material.JUNGLE_TRAPDOOR, + Material.DARK_OAK_TRAPDOOR, Material.IRON_TRAPDOOR, - Material.CARPET, - Material.IRON_DOOR_BLOCK, - // 木のドアはそれぞれMaterialが別れている - Material.WOODEN_DOOR, + Material.BLACK_CARPET, + Material.BLUE_CARPET, + Material.BROWN_CARPET, + Material.CYAN_CARPET, + Material.GRAY_CARPET, + Material.GREEN_CARPET, + Material.LIGHT_BLUE_CARPET, + Material.LIGHT_GRAY_CARPET, + Material.LIME_CARPET, + Material.MAGENTA_CARPET, + Material.ORANGE_CARPET, + Material.PINK_CARPET, + Material.PURPLE_CARPET, + Material.RED_CARPET, + Material.WHITE_CARPET, + Material.YELLOW_CARPET, + Material.IRON_DOOR, + Material.OAK_DOOR, Material.ACACIA_DOOR, Material.BIRCH_DOOR, Material.DARK_OAK_DOOR, Material.JUNGLE_DOOR, Material.SPRUCE_DOOR, - Material.SMOOTH_STAIRS, + Material.STONE_BRICK_STAIRS, Material.BREWING_STAND, - Material.WOOD_STEP, + Material.ACACIA_SLAB, + Material.BIRCH_SLAB, + Material.DARK_OAK_SLAB, + Material.JUNGLE_SLAB, + Material.OAK_SLAB, Material.TNT, - // #1027,#1159 - Material.WOOD_STEP, - Material.WOOD_DOUBLE_STEP, Material.DISPENSER, - Material.PISTON_STICKY_BASE, - Material.WEB + Material.STICKY_PISTON ) ++ fortuneMaterials // これらのマテリアルを持つブロックは破壊を整地量に計上しない val exclude: Set[Material] = Set( - Material.GRASS_PATH, - Material.SOIL, - Material.MOB_SPAWNER, + Material.DIRT_PATH, + Material.FARMLAND, + Material.SPAWNER, Material.CAULDRON, Material.ENDER_CHEST, - Material.ENDER_PORTAL_FRAME, - Material.ENDER_PORTAL + Material.END_PORTAL_FRAME, + Material.END_PORTAL ) val materialsToCountBlockBreak: Set[Material] = materials -- exclude @@ -164,20 +342,20 @@ object MaterialSets { * 例えば石をシャベルで掘った時にも、ツールのエンチャントを保ったままダイヤツルハシで掘ったものとして計算し、 結果得られるスタック数が最大のものが結果として採用される。 */ val breakTestToolMaterials: Seq[Material] = - Seq(Material.DIAMOND_PICKAXE, Material.DIAMOND_AXE, Material.DIAMOND_SPADE) + Seq(Material.DIAMOND_PICKAXE, Material.DIAMOND_AXE, Material.DIAMOND_SHOVEL) val breakToolMaterials: Set[Material] = Set( - Material.WOOD_PICKAXE, - Material.WOOD_SPADE, + Material.WOODEN_PICKAXE, + Material.WOODEN_SHOVEL, Material.STONE_PICKAXE, Material.STONE_AXE, - Material.STONE_SPADE, + Material.STONE_SHOVEL, Material.IRON_PICKAXE, Material.IRON_AXE, - Material.IRON_SPADE, - Material.GOLD_PICKAXE, - Material.GOLD_AXE, - Material.GOLD_SPADE + Material.IRON_SHOVEL, + Material.GOLDEN_PICKAXE, + Material.GOLDEN_AXE, + Material.GOLDEN_SHOVEL ) ++ breakTestToolMaterials val cancelledMaterials: Set[Material] = Set( @@ -189,10 +367,15 @@ object MaterialSets { Material.BEACON, Material.BIRCH_DOOR, Material.BIRCH_FENCE_GATE, - Material.BIRCH_WOOD_STAIRS, - Material.BOAT, + Material.BIRCH_STAIRS, + Material.BIRCH_BOAT, + Material.OAK_BOAT, + Material.ACACIA_BOAT, + Material.JUNGLE_BOAT, + Material.DARK_OAK_BOAT, + Material.SPRUCE_BOAT, Material.FURNACE, - Material.WORKBENCH, + Material.CRAFTING_TABLE, Material.HOPPER, Material.MINECART ) @@ -200,7 +383,19 @@ object MaterialSets { val transparentMaterials: Set[Material] = Set(Material.BEDROCK, Material.AIR) val gravityMaterials: Set[Material] = - Set(Material.LOG, Material.LOG_2, Material.LEAVES, Material.LEAVES_2) + Set( + Material.ACACIA_LOG, + Material.BIRCH_LOG, + Material.DARK_OAK_LOG, + Material.JUNGLE_LOG, + Material.OAK_LOG, + Material.OAK_LEAVES, + Material.BIRCH_LEAVES, + Material.JUNGLE_LEAVES, + Material.ACACIA_LEAVES, + Material.DARK_OAK_LEAVES, + Material.SPRUCE_LEAVES + ) val fluidMaterials: Set[Material] = Set(Material.WATER, Material.LAVA) diff --git a/src/main/scala/com/github/unchama/seichiassist/SeichiAssist.scala b/src/main/scala/com/github/unchama/seichiassist/SeichiAssist.scala index c4e3375fca..de64cb758d 100644 --- a/src/main/scala/com/github/unchama/seichiassist/SeichiAssist.scala +++ b/src/main/scala/com/github/unchama/seichiassist/SeichiAssist.scala @@ -219,7 +219,6 @@ class SeichiAssist extends JavaPlugin() { private lazy val itemMigrationSystem: subsystems.itemmigration.System[IO] = { import PluginExecutionContexts.asyncShift - implicit val effectEnvironment: EffectEnvironment = DefaultEffectEnvironment subsystems.itemmigration.System.wired[IO, SyncIO].unsafeRunSync() } @@ -383,7 +382,6 @@ class SeichiAssist extends JavaPlugin() { private lazy val presentSystem: Subsystem[IO] = { import PluginExecutionContexts.{asyncShift, onMainThread} - implicit val effectEnvironment: EffectEnvironment = DefaultEffectEnvironment implicit val concurrentEffect: ConcurrentEffect[IO] = IO.ioConcurrentEffect(asyncShift) implicit val uuidToLastSeenName: UuidToLastSeenName[IO] = new GlobalPlayerAccessor[IO] subsystems.present.System.wired @@ -590,8 +588,8 @@ class SeichiAssist extends JavaPlugin() { // BungeeCordとのI/O Bukkit .getMessenger - .registerIncomingPluginChannel(this, "SeichiAssistBungee", new BungeeReceiver(this)) - Bukkit.getMessenger.registerOutgoingPluginChannel(this, "SeichiAssistBungee") + .registerIncomingPluginChannel(this, "BungeeCord", new BungeeReceiver(this)) + Bukkit.getMessenger.registerOutgoingPluginChannel(this, "BungeeCord") // コンフィグ系の設定は全てConfig.javaに移動 SeichiAssist.seichiAssistConfig = Config.loadFrom(this) diff --git a/src/main/scala/com/github/unchama/seichiassist/achievement/AchievementConditions.scala b/src/main/scala/com/github/unchama/seichiassist/achievement/AchievementConditions.scala index bdac55431f..0731288c0e 100644 --- a/src/main/scala/com/github/unchama/seichiassist/achievement/AchievementConditions.scala +++ b/src/main/scala/com/github/unchama/seichiassist/achievement/AchievementConditions.scala @@ -214,7 +214,7 @@ object AchievementConditions { import scala.util.chaining._ stack != null && - stack.getType == Material.SKULL_ITEM && + stack.getType == Material.PLAYER_HEAD && stack .getItemMeta .asInstanceOf[SkullMeta] diff --git a/src/main/scala/com/github/unchama/seichiassist/commands/RegionOwnerTransferCommand.scala b/src/main/scala/com/github/unchama/seichiassist/commands/RegionOwnerTransferCommand.scala index 96c5659c44..c7d48ff5ea 100644 --- a/src/main/scala/com/github/unchama/seichiassist/commands/RegionOwnerTransferCommand.scala +++ b/src/main/scala/com/github/unchama/seichiassist/commands/RegionOwnerTransferCommand.scala @@ -34,12 +34,13 @@ object RegionOwnerTransferCommand { val sender = context.sender val region = - WorldGuardPlugin.inst().getRegionManager(sender.getWorld).getRegion(regionName) - if (region == null) { - IO(MessageEffect(s"${regionName}という名前の保護は存在しません。")) - } + WorldGuardWrapper.findByRegionName(regionName) - attemptRegionTransfer(sender, newOwner, region) + region match { + case Some(region) => + attemptRegionTransfer(sender, newOwner, region.getRegion(regionName)) + case None => IO(MessageEffect(s"${regionName}という名前の保護は存在しません。")) + } } .build() .asNonBlockingTabExecutor() @@ -52,7 +53,7 @@ object RegionOwnerTransferCommand { val owners = region.getOwners val regionWorld = donner.getWorld - val recipientLimit = WorldGuardWrapper.getMaxRegionCount(recipient, regionWorld) + val recipientLimit = WorldGuardWrapper.getMaxRegion(recipient, regionWorld) val recipientHas = WorldGuardWrapper.getNumberOfRegions(recipient, regionWorld) if (recipientLimit <= recipientHas) { diff --git a/src/main/scala/com/github/unchama/seichiassist/commands/RmpCommand.scala b/src/main/scala/com/github/unchama/seichiassist/commands/RmpCommand.scala index 45d5f7e3f0..5d23e142df 100644 --- a/src/main/scala/com/github/unchama/seichiassist/commands/RmpCommand.scala +++ b/src/main/scala/com/github/unchama/seichiassist/commands/RmpCommand.scala @@ -12,7 +12,7 @@ import com.github.unchama.seichiassist.{ManagedWorld, SeichiAssist} import com.github.unchama.targetedeffect import com.github.unchama.targetedeffect.TargetedEffect import com.github.unchama.targetedeffect.commandsender.MessageEffect -import com.github.unchama.util.external.ExternalPlugins +import com.github.unchama.util.external.WorldGuardWrapper import com.sk89q.worldguard.protection.regions.ProtectedRegion import org.bukkit.ChatColor._ import org.bukkit.command.{CommandSender, ConsoleCommandSender, TabExecutor} @@ -86,13 +86,7 @@ object RmpCommand { case None | Some(false) => MessageEffect(s"第1整地以外の保護をかけて整地する整地ワールドでのみ使用出来ます") case Some(true) => getOldRegionsIn(world, days).map { removalTargets => - removalTargets.foreach { target => - ExternalPlugins - .getWorldGuard - .getRegionContainer - .get(world) - .removeRegion(target.getId) - } + removalTargets.foreach(WorldGuardWrapper.removeByProtectedRegionRegion(world, _)) // メッセージ生成 if (removalTargets.isEmpty) { @@ -120,15 +114,15 @@ object RmpCommand { return Left(MessageEffect(s"${RED}データベースアクセスに失敗しました。")) } - val regions = ExternalPlugins.getWorldGuard.getRegionContainer.get(world).getRegions.asScala + val regions = WorldGuardWrapper.getRegions(world) - val oldRegions = regions - .values - .filter { region => - region.getId != "__global__" && region.getId != "spawn" && - region.getOwners.getUniqueIds.asScala.forall(leavers.contains(_)) - } - .toList + val oldRegions = regions.filter { region => + region.getId != "spawn" && region + .getOwners + .getUniqueIds + .asScala + .forall(leavers.contains(_)) + } Right(oldRegions) } diff --git a/src/main/scala/com/github/unchama/seichiassist/data/MenuInventoryData.java b/src/main/scala/com/github/unchama/seichiassist/data/MenuInventoryData.java index f5a75a1d6c..fc0159d7d6 100644 --- a/src/main/scala/com/github/unchama/seichiassist/data/MenuInventoryData.java +++ b/src/main/scala/com/github/unchama/seichiassist/data/MenuInventoryData.java @@ -450,8 +450,14 @@ public static Inventory getGiganticBerserkBeforeEvolutionMenu(final Player p) { final Inventory inventory = getEmptyInventory(6, ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "スキルを進化させますか?"); { // 色 - final byte[] table = {12, 15, 4, 0, 3}; - final ItemStack itemstack = new ItemStack(Material.STAINED_GLASS_PANE, 1, table[playerdata.giganticBerserk().stage()]); + final Material[] table = { + Material.ORANGE_STAINED_GLASS_PANE, + Material.BLACK_STAINED_GLASS_PANE, + Material.YELLOW_STAINED_GLASS_PANE, + Material.WHITE_STAINED_GLASS_PANE, + Material.LIGHT_BLUE_STAINED_GLASS_PANE + }; + final ItemStack itemstack = new ItemStack(table[playerdata.giganticBerserk().stage()], 1); final ItemMeta itemmeta = itemstack.getItemMeta(); itemmeta.setDisplayName(" "); itemstack.setItemMeta(itemmeta); @@ -495,10 +501,16 @@ public static Inventory getGiganticBerserkAfterEvolutionMenu(final Player p) { if (isError(p, playerdata, "GiganticBerserk進化後画面")) return null; final Inventory inventory = getEmptyInventory(6, ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + "スキルを進化させました"); { - final byte[] table = {12, 15, 4, 0, 3, 12}; - final byte b = table[playerdata.giganticBerserk().stage()]; + final Material[] table = { + Material.BROWN_STAINED_GLASS_PANE, + Material.BLACK_STAINED_GLASS_PANE, + Material.YELLOW_STAINED_GLASS_PANE, + Material.WHITE_STAINED_GLASS_PANE, + Material.LIGHT_BLUE_STAINED_GLASS_PANE, + Material.BROWN_STAINED_GLASS_PANE + }; - final ItemStack itemstack = new ItemStack(Material.STAINED_GLASS_PANE, 1, b); + final ItemStack itemstack = new ItemStack(table[playerdata.giganticBerserk().stage()], 1); final ItemMeta itemmeta = itemstack.getItemMeta(); if (playerdata.giganticBerserk().stage() >= 4) { @@ -570,7 +582,7 @@ private static ItemStack buildPlayerSkull(final String name, final List } private static ItemStack buildPlayerSkull(final String name, final List lore, final String owner, final Consumer modify) { - final ItemStack ret = new ItemStack(Material.SKULL_ITEM, 1, PLAYER_SKULL); + final ItemStack ret = new ItemStack(Material.PLAYER_HEAD, 1, PLAYER_SKULL); final SkullMeta sm = ItemMetaFactory.SKULL.getValue(); if (name != null) { sm.setDisplayName(name); diff --git a/src/main/scala/com/github/unchama/seichiassist/data/RegionMenuData.java b/src/main/scala/com/github/unchama/seichiassist/data/RegionMenuData.java index 70af3bf57a..35ba506537 100644 --- a/src/main/scala/com/github/unchama/seichiassist/data/RegionMenuData.java +++ b/src/main/scala/com/github/unchama/seichiassist/data/RegionMenuData.java @@ -51,7 +51,7 @@ public static Inventory getGridWorldGuardMenu(Player player) { lore0.add(ChatColor.AQUA + "" + playerData.unitPerClick() + ChatColor.GREEN + "ユニット(" + ChatColor.AQUA + playerData.unitPerClick() * 15 + ChatColor.GREEN + "ブロック)/1クリック"); lore0.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "クリックで変更"); - ItemStack menuicon0 = MenuIcon.getMenuIcon(Material.STAINED_GLASS_PANE, 1, 0, + ItemStack menuicon0 = MenuIcon.getMenuIcon(Material.WHITE_STAINED_GLASS_PANE, 1, 0, ChatColor.GREEN + "拡張単位の変更", CollectionConverters.ListHasAsScala(lore0).asScala().toList(), true); gridInv.setItem(0, menuicon0); @@ -62,7 +62,7 @@ public static Inventory getGridWorldGuardMenu(Player player) { } else if (!playerData.canGridReduce(RelativeDirection.ahead())) { lore1.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "これ以上縮小できません"); } - ItemStack menuicon1 = MenuIcon.getMenuIcon(Material.STAINED_GLASS_PANE, 1, 14, + ItemStack menuicon1 = MenuIcon.getMenuIcon(Material.RED_STAINED_GLASS_PANE, 1, 14, ChatColor.DARK_GREEN + "前に" + playerData.unitPerClick() + "ユニット増やす/減らす", CollectionConverters.ListHasAsScala(lore1).asScala().toList(), true); gridInv.setItem(1, menuicon1); @@ -80,7 +80,7 @@ public static Inventory getGridWorldGuardMenu(Player player) { } else if (!playerData.canGridReduce(RelativeDirection.left())) { lore3.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "これ以上縮小できません"); } - ItemStack menuicon3 = MenuIcon.getMenuIcon(Material.STAINED_GLASS_PANE, 1, 10, + ItemStack menuicon3 = MenuIcon.getMenuIcon(Material.PURPLE_STAINED_GLASS_PANE, 1, 10, ChatColor.DARK_GREEN + "左に" + playerData.unitPerClick() + "ユニット増やす/減らす", CollectionConverters.ListHasAsScala(lore3).asScala().toList(), true); gridInv.setItem(3, menuicon3); @@ -97,7 +97,7 @@ public static Inventory getGridWorldGuardMenu(Player player) { + "(" + ChatColor.AQUA + nfNum.format((Integer) unitMap.apply(RelativeDirection.left()) * 15) + ChatColor.GRAY + "ブロック)"); lore4.add(ChatColor.GRAY + "保護ユニット数:" + ChatColor.AQUA + playerData.gridChunkAmount()); lore4.add(ChatColor.GRAY + "保護ユニット上限値:" + ChatColor.RED + config.getGridLimitPerWorld(player.getWorld().getName())); - ItemStack menuicon4 = MenuIcon.getMenuIcon(Material.STAINED_GLASS_PANE, 1, 11, ChatColor.DARK_GREEN + "設定", + ItemStack menuicon4 = MenuIcon.getMenuIcon(Material.BLUE_STAINED_GLASS_PANE, 1, 11, ChatColor.DARK_GREEN + "設定", CollectionConverters.ListHasAsScala(lore4).asScala().toList(), true); gridInv.setItem(4, menuicon4); @@ -108,14 +108,14 @@ public static Inventory getGridWorldGuardMenu(Player player) { } else if (!playerData.canGridReduce(RelativeDirection.right())) { lore5.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "これ以上縮小できません"); } - ItemStack menuicon5 = MenuIcon.getMenuIcon(Material.STAINED_GLASS_PANE, 1, 5, + ItemStack menuicon5 = MenuIcon.getMenuIcon(Material.LIME_STAINED_GLASS_PANE, 1, 5, ChatColor.DARK_GREEN + "右に" + playerData.unitPerClick() + "ユニット増やす/減らす", CollectionConverters.ListHasAsScala(lore5).asScala().toList(), true); gridInv.setItem(5, menuicon5); //6マス目 List lore6 = new ArrayList<>(); lore6.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "取扱注意!!"); - ItemStack menuicon6 = MenuIcon.getMenuIcon(Material.STAINED_GLASS_PANE, 1, 4, ChatColor.RED + "全設定リセット", + ItemStack menuicon6 = MenuIcon.getMenuIcon(Material.YELLOW_STAINED_GLASS_PANE, 1, 4, ChatColor.RED + "全設定リセット", CollectionConverters.ListHasAsScala(lore6).asScala().toList(), true); gridInv.setItem(6, menuicon6); @@ -126,7 +126,7 @@ public static Inventory getGridWorldGuardMenu(Player player) { } else if (!playerData.canGridReduce(RelativeDirection.behind())) { lore7.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "これ以上縮小できません"); } - ItemStack menuicon7 = MenuIcon.getMenuIcon(Material.STAINED_GLASS_PANE, 1, 13, + ItemStack menuicon7 = MenuIcon.getMenuIcon(Material.GREEN_STAINED_GLASS_PANE, 1, 13, ChatColor.DARK_GREEN + "後ろに" + playerData.unitPerClick() + "ユニット増やす/減らす", CollectionConverters.ListHasAsScala(lore7).asScala().toList(), true); gridInv.setItem(7, menuicon7); @@ -134,7 +134,7 @@ public static Inventory getGridWorldGuardMenu(Player player) { if (!config.isGridProtectionEnabled(player.getWorld())) { List lore8 = new ArrayList<>(); lore8.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "このワールドでは保護を作成できません"); - ItemStack menuicon8 = MenuIcon.getMenuIcon(Material.WOOL, 1, 14, ChatColor.RED + "保護作成", + ItemStack menuicon8 = MenuIcon.getMenuIcon(Material.RED_WOOL, 1, 14, ChatColor.RED + "保護作成", CollectionConverters.ListHasAsScala(lore8).asScala().toList(), true); gridInv.setItem(8, menuicon8); } else if (!playerData.canCreateRegion()) { @@ -142,14 +142,14 @@ public static Inventory getGridWorldGuardMenu(Player player) { lore8.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "以下の原因により保護を作成できません"); lore8.add(ChatColor.RED + "・保護の範囲が他の保護と重複している"); lore8.add(ChatColor.RED + "・保護の作成上限に達している"); - ItemStack menuicon8 = MenuIcon.getMenuIcon(Material.WOOL, 1, 14, ChatColor.RED + "保護作成", + ItemStack menuicon8 = MenuIcon.getMenuIcon(Material.RED_WOOL, 1, 14, ChatColor.RED + "保護作成", CollectionConverters.ListHasAsScala(lore8).asScala().toList(), true); gridInv.setItem(8, menuicon8); } else { List lore8 = new ArrayList<>(); lore8.add(ChatColor.DARK_GREEN + "保護作成可能です"); lore8.add(ChatColor.RED + "" + ChatColor.UNDERLINE + "クリックで作成"); - ItemStack menuicon8 = MenuIcon.getMenuIcon(Material.WOOL, 1, 11, ChatColor.GREEN + "保護作成", + ItemStack menuicon8 = MenuIcon.getMenuIcon(Material.LIGHT_BLUE_WOOL, 1, 11, ChatColor.GREEN + "保護作成", CollectionConverters.ListHasAsScala(lore8).asScala().toList(), true); gridInv.setItem(8, menuicon8); } diff --git a/src/main/scala/com/github/unchama/seichiassist/data/player/GiganticBerserk.scala b/src/main/scala/com/github/unchama/seichiassist/data/player/GiganticBerserk.scala index 823d126560..e7e343e342 100644 --- a/src/main/scala/com/github/unchama/seichiassist/data/player/GiganticBerserk.scala +++ b/src/main/scala/com/github/unchama/seichiassist/data/player/GiganticBerserk.scala @@ -25,12 +25,12 @@ case class GiganticBerserk( def materialOnUI(): Material = { stage match { - case 0 => Material.WOOD_SWORD + case 0 => Material.WOODEN_SWORD case 1 => Material.STONE_SWORD - case 2 => Material.GOLD_SWORD + case 2 => Material.GOLDEN_SWORD case 3 => Material.IRON_SWORD case 4 => Material.DIAMOND_SWORD - case 5 => Material.WOOD_SWORD + case 5 => Material.WOODEN_SWORD case _ => throw new RuntimeException("This branch should not be reached") } } diff --git a/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala b/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala index 4ab8d426f0..a6b938a72f 100644 --- a/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/data/player/PlayerData.scala @@ -260,7 +260,7 @@ class PlayerData(@Deprecated() val uuid: UUID, val name: String) { // 総プレイ時間を更新する def updatePlayTick(): Unit = { // WARN: 1分毎にupdatePlayTickが呼び出されるというコンテクストに依存している. - val nowTotalPlayTick = player.getStatistic(Statistic.PLAY_ONE_TICK).toLong + val nowTotalPlayTick = player.getStatistic(Statistic.PLAY_ONE_MINUTE).toLong val diff = nowTotalPlayTick - totalPlayTick.getOrElse(nowTotalPlayTick) totalPlayTick = Some(nowTotalPlayTick) diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala index a3fd697648..0641d79367 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/EntityListener.scala @@ -18,6 +18,7 @@ import org.bukkit.enchantments.Enchantment import org.bukkit.entity.{Player, Projectile} import org.bukkit.event.entity._ import org.bukkit.event.{EventHandler, Listener} +import org.bukkit.inventory.meta.Damageable class EntityListener( implicit effectEnvironment: EffectEnvironment, @@ -77,7 +78,11 @@ class EntityListener( ) // 耐久値がマイナスかつ耐久無限ツールでない時処理を終了 - if (tool.getDurability > tool.getType.getMaxDurability && !tool.getItemMeta.isUnbreakable) + if ( + tool.getItemMeta.asInstanceOf[Damageable].getDamage > tool + .getType + .getMaxDurability && !tool.getItemMeta.isUnbreakable + ) return runArrowSkillOfHitBlock(player, block, tool) @@ -132,7 +137,7 @@ class EntityListener( val nextDurability = { val durabilityEnchantment = tool.getEnchantmentLevel(Enchantment.DURABILITY) - tool.getDurability + + tool.getItemMeta.asInstanceOf[Damageable].getDamage + BreakUtil.calcDurability( durabilityEnchantment, breakBlocks.size + 10 * (lavaBlocks.size + waterBlocks.size) @@ -157,7 +162,11 @@ class EntityListener( return // 耐久値を減らす - if (!tool.getItemMeta.isUnbreakable) tool.setDurability(nextDurability) + if (!tool.getItemMeta.isUnbreakable) { + val meta = tool.getItemMeta + meta.asInstanceOf[Damageable].setDamage(nextDurability) + tool.setItemMeta(meta) + } // 以降破壊する処理 // 溶岩と水を破壊する diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala index 22c412d85c..d5ddf3a3fd 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala @@ -15,21 +15,23 @@ import com.github.unchama.seichiassist.subsystems.mana.ManaApi import com.github.unchama.seichiassist.subsystems.mana.domain.ManaAmount import com.github.unchama.seichiassist.subsystems.minestack.MineStackAPI import com.github.unchama.seichiassist.util.BreakUtil -import com.github.unchama.seichiassist.util.BreakUtil.BlockBreakResult import com.github.unchama.seichiassist.{MaterialSets, SeichiAssist} import com.github.unchama.targetedeffect.player.FocusedSoundEffect import com.github.unchama.util.effect.BukkitResources -import com.github.unchama.util.external.ExternalPlugins +import com.github.unchama.util.external.WorldGuardWrapper import org.bukkit.ChatColor.RED import org.bukkit._ import org.bukkit.block.Block +import org.bukkit.block.data.`type`.Slab import org.bukkit.enchantments.Enchantment import org.bukkit.entity.Player import org.bukkit.event.block.BlockBreakEvent import org.bukkit.event.{EventHandler, EventPriority, Listener} import org.bukkit.inventory.ItemStack +import org.bukkit.inventory.meta.Damageable import scala.collection.mutable.ArrayBuffer +import scala.jdk.CollectionConverters.CollectionHasAsScala import scala.util.control.Breaks class PlayerBlockBreakListener( @@ -84,7 +86,11 @@ class PlayerBlockBreakListener( ) // 耐久値がマイナスかつ耐久無限ツールでない時処理を終了 - if (tool.getDurability > tool.getType.getMaxDurability && !tool.getItemMeta.isUnbreakable) + if ( + tool.getItemMeta.asInstanceOf[Damageable].getDamage > tool + .getType + .getMaxDurability && !tool.getItemMeta.isUnbreakable + ) return // もしサバイバルでなければ、またはフライ中なら終了 @@ -140,7 +146,7 @@ class PlayerBlockBreakListener( // 壊される水ブロックの全てのリストデータ val multiWaterList = new ArrayBuffer[Set[Block]] // 全ての耐久消費量 - var toolDamageToSet = tool.getDurability.toInt + var toolDamageToSet = tool.getItemMeta.asInstanceOf[Damageable].getDamage // 消費が予約されたマナ val reservedMana = new ArrayBuffer[ManaAmount] @@ -272,12 +278,16 @@ class PlayerBlockBreakListener( // ツールの耐久値を減らす val adjustManaAndDurability = IO { - if (!tool.getItemMeta.isUnbreakable) tool.setDurability(toolDamageToSet.toShort) + if (!tool.getItemMeta.isUnbreakable) { + val meta = tool.getItemMeta + meta.asInstanceOf[Damageable].setDamage(toolDamageToSet) + tool.setItemMeta(meta) + } } effectEnvironment.unsafeRunEffectAsync( "複数破壊エフェクトを実行する", - effectPrograms.toList.sequence[IO, Fiber[IO, Unit]] + effectPrograms.sequence[IO, Fiber[IO, Unit]] ) effectEnvironment.unsafeRunEffectAsync( "複数破壊エフェクトの後処理を実行する", @@ -302,42 +312,28 @@ class PlayerBlockBreakListener( SeichiAssist.instance.breakCountSystem.api.incrementSeichiExp.of(player, amount).toIO ) - val tool: BreakTool = MaterialSets - .refineItemStack(player.getInventory.getItemInMainHand, MaterialSets.breakToolMaterials) - .getOrElse( - return - ) - - /** - * 手彫りで破壊したアイテムを直接MineStackに入れる - * 一つのBlockBreakEventから複数の種類のアイテムが出てくることはない。 - * チェスト等のインベントリスロットのあるブロック`b`を破壊したときは、 - * 破壊された`b`のみが`BlockBreakEvent`のドロップ対象となるため、 - * 中身のドロップがキャンセルされることはない。 - */ - val drops = BreakUtil - .dropItemOnTool(tool)((block.getLocation(), block.getType, block.getData)) - .getOrElse( - return - ) - - drops match { - case BlockBreakResult.ItemDrop(itemStack) => - val program = for { - currentAutoMineStackState <- mineStackAPI.autoMineStack(player) - isSucceedTryIntoMineStack <- whenAOrElse(currentAutoMineStackState)( + val program = for { + currentAutoMineStackState <- mineStackAPI.autoMineStack(player) + isSucceedTryIntoMineStack <- whenAOrElse(currentAutoMineStackState)( + event + .getBlock + .getDrops(player.getInventory.getItemInMainHand) + .asScala + .toList + .traverse { itemStack => mineStackAPI .mineStackRepository - .tryIntoMineStack(player, itemStack, itemStack.getAmount), - false - ) - } yield { - if (isSucceedTryIntoMineStack) event.setDropItems(false) - else () - } - program.unsafeRunSync() - case _ => () + .tryIntoMineStack(player, itemStack, itemStack.getAmount) + } + .map(_.forall(_ == true)), + false + ) + } yield { + if (isSucceedTryIntoMineStack) event.setDropItems(false) + else () } + program.unsafeRunSync() + } /** @@ -353,16 +349,15 @@ class PlayerBlockBreakListener( val b = event.getBlock val world = p.getWorld // そもそも自分の保護じゃなきゃ処理かけない - if (!ExternalPlugins.getWorldGuard.canBuild(p, b.getLocation)) return - if ((b.getType eq Material.DOUBLE_STEP) && b.getData == 0) { - b.setType(Material.STEP) - b.setData(0.toByte) + if (!WorldGuardWrapper.canBuild(p, b.getLocation)) return + if (b.isInstanceOf[Slab]) { + b.setType(Material.STONE_SLAB) val location = b.getLocation - world.dropItemNaturally(location, new ItemStack(Material.STEP)) + world.dropItemNaturally(location, new ItemStack(Material.STONE_SLAB)) } - if (b.getType ne Material.STEP) return + if (b.getType ne Material.STONE_SLAB) return if (b.getY > 5) return - if (b.getData != 0) return + if (b.asInstanceOf[Slab].getType != Slab.Type.BOTTOM) return if (!world.isSeichi) return event.setCancelled(true) p.sendMessage(s"${RED}Y5以下に敷かれたハーフブロックは破壊不可能です。") diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala index 6ddf552e27..b8521d7972 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerClickListener.scala @@ -116,7 +116,7 @@ class PlayerClickListener( val equipmentSlot = event.getHand val currentItem = player.getInventory.getItemInMainHand.getType - if (currentItem == Material.STICK || currentItem == Material.SKULL_ITEM) return + if (currentItem == Material.STICK || currentItem == Material.PLAYER_HEAD) return val playerData = playerMap(player.getUniqueId) val playerLevel = SeichiAssist @@ -242,7 +242,7 @@ class PlayerClickListener( val targetBlock = e.getClickedBlock // 頭じゃない場合無視 - if (targetBlock.getType != Material.SKULL) { + if (targetBlock.getType != Material.PLAYER_HEAD) { return } diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala index d320a98574..d92006a88f 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerInventoryListener.scala @@ -49,7 +49,7 @@ class PlayerInventoryListener( // インベントリサイズが36でない時終了 if (inventory.row != 4) return - if (inventory.getTitle != s"$LIGHT_PURPLE${BOLD}交換したい鉱石を入れてください") return + if (event.getView.getTitle != s"$LIGHT_PURPLE${BOLD}交換したい鉱石を入れてください") return /* * step1 for文でinventory内の対象商品の個数を計算 @@ -57,36 +57,34 @@ class PlayerInventoryListener( */ // 石炭とラピスラズリを適切に処理するため、typeとdurabilityを持つクラスを用意 - case class ExchangeableMaterial(materialType: Material, durability: Short) + case class ExchangeableMaterial(materialType: Material) val requiredAmountPerTicket = Map( - ExchangeableMaterial(Material.COAL_ORE, 0) -> 128, - ExchangeableMaterial(Material.IRON_ORE, 0) -> 64, - ExchangeableMaterial(Material.GOLD_ORE, 0) -> 8, - ExchangeableMaterial(Material.LAPIS_ORE, 0) -> 8, - ExchangeableMaterial(Material.DIAMOND_ORE, 0) -> 4, - ExchangeableMaterial(Material.REDSTONE_ORE, 0) -> 32, - ExchangeableMaterial(Material.EMERALD_ORE, 0) -> 4, - ExchangeableMaterial(Material.QUARTZ_ORE, 0) -> 16, - ExchangeableMaterial(Material.COAL, 0) -> 432, - ExchangeableMaterial(Material.REDSTONE, 0) -> 288, - ExchangeableMaterial(Material.INK_SACK, 4) -> 64, - ExchangeableMaterial(Material.DIAMOND, 0) -> 8 + ExchangeableMaterial(Material.COAL_ORE) -> 128, + ExchangeableMaterial(Material.IRON_ORE) -> 64, + ExchangeableMaterial(Material.GOLD_ORE) -> 8, + ExchangeableMaterial(Material.LAPIS_ORE) -> 8, + ExchangeableMaterial(Material.DIAMOND_ORE) -> 4, + ExchangeableMaterial(Material.REDSTONE_ORE) -> 32, + ExchangeableMaterial(Material.EMERALD_ORE) -> 4, + ExchangeableMaterial(Material.NETHER_QUARTZ_ORE) -> 16, + ExchangeableMaterial(Material.COAL) -> 432, + ExchangeableMaterial(Material.REDSTONE) -> 288, + ExchangeableMaterial(Material.INK_SAC) -> 64, + ExchangeableMaterial(Material.DIAMOND) -> 8 ) val inventoryContents = inventory.getContents.filter(_ != null) val (itemsToExchange, rejectedItems) = inventoryContents.partition { stack => - requiredAmountPerTicket.contains( - ExchangeableMaterial(stack.getType, stack.getDurability) - ) + requiredAmountPerTicket.contains(ExchangeableMaterial(stack.getType)) } - val exchangingAmount = itemsToExchange - .groupBy(stacks => ExchangeableMaterial(stacks.getType, stacks.getDurability)) - .toList - .map { case (key, stacks) => key -> stacks.map(_.getAmount).sum } + val exchangingAmount = + itemsToExchange.groupBy(stacks => ExchangeableMaterial(stacks.getType)).toList.map { + case (key, stacks) => key -> stacks.map(_.getAmount).sum + } val ticketAmount = exchangingAmount.map { case (exchangeableMaterial, amount) => @@ -139,13 +137,7 @@ class PlayerInventoryListener( case (exchangedMaterial, exchangedAmount) => val returningAmount = exchangedAmount % requiredAmountPerTicket(exchangedMaterial) if (returningAmount != 0) - Some( - new ItemStack( - exchangedMaterial.materialType, - returningAmount, - exchangedMaterial.durability - ) - ) + Some(new ItemStack(exchangedMaterial.materialType, returningAmount)) else None } @@ -186,15 +178,15 @@ class PlayerInventoryListener( val uuid = player.getUniqueId val playerdata = playerMap(uuid) - if (topinventory.getTitle == DARK_PURPLE.toString + "" + BOLD + "スキルを進化させますか?") { + if (view.getTitle == DARK_PURPLE.toString + "" + BOLD + "スキルを進化させますか?") { event.setCancelled(true) if (itemstackcurrent.getType == Material.NETHER_STAR) { playerdata.giganticBerserk = GiganticBerserk(0, 0, playerdata.giganticBerserk.stage + 1) player.playSound(player.getLocation, Sound.BLOCK_END_GATEWAY_SPAWN, 1f, 0.5f) - player.playSound(player.getLocation, Sound.ENTITY_ENDERDRAGON_AMBIENT, 1f, 0.8f) + player.playSound(player.getLocation, Sound.ENTITY_ENDER_DRAGON_AMBIENT, 1f, 0.8f) player.openInventory(MenuInventoryData.getGiganticBerserkAfterEvolutionMenu(player)) } - } else if (topinventory.getTitle == LIGHT_PURPLE.toString + "" + BOLD + "スキルを進化させました") { + } else if (view.getTitle == LIGHT_PURPLE.toString + "" + BOLD + "スキルを進化させました") { event.setCancelled(true) } diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerJoinListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerJoinListener.scala index ec48ff3911..112c24ad2b 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/PlayerJoinListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/PlayerJoinListener.scala @@ -13,7 +13,7 @@ import com.github.unchama.seichiassist.subsystems.mebius.domain.property.{ } import com.github.unchama.seichiassist.util.{SendMessageEffect, SendSoundEffect} import com.github.unchama.targetedeffect.player.FocusedSoundEffect -import net.coreprotect.model.Config +import net.coreprotect.config.ConfigHandler import org.bukkit.ChatColor._ import org.bukkit.enchantments.Enchantment import org.bukkit.entity.Player @@ -144,13 +144,13 @@ class PlayerJoinListener extends Listener { // 耐久Ⅲ .tap(_.addEnchantment(Enchantment.DURABILITY, 3)) inv.addItem(pickaxe) - inv.addItem(new ItemStack(Material.DIAMOND_SPADE)) + inv.addItem(new ItemStack(Material.DIAMOND_SHOVEL)) inv.addItem( - new ItemStack(Material.LOG, 64, 0.toShort), - new ItemStack(Material.LOG, 64, 0.toShort), - new ItemStack(Material.LOG, 64, 2.toShort), - new ItemStack(Material.LOG_2, 64, 1.toShort) + new ItemStack(Material.OAK_LOG, 64), + new ItemStack(Material.OAK_LOG, 64), + new ItemStack(Material.BIRCH_LOG, 64), + new ItemStack(Material.DARK_OAK_LOG, 64) ) inv.addItem(new ItemStack(Material.BAKED_POTATO, 64)) @@ -196,8 +196,7 @@ class PlayerJoinListener extends Listener { BukkitMebiusItemStackCodec.materialize( // **getDisplayNameは二つ名も含むのでMCIDにはgetNameが適切** MebiusProperty - .initialProperty(NormalMebius, player.getName, player.getUniqueId.toString), - damageValue = 0.toShort + .initialProperty(NormalMebius, player.getName, player.getUniqueId.toString) ) ) @@ -215,7 +214,7 @@ class PlayerJoinListener extends Listener { // 整地専用サーバーの場合は上級者向けのサーバーである旨を通知 if (SeichiAssist.seichiAssistConfig.getServerNum == 5) player.sendTitle( - s"${WHITE}ここは$BLUE${UNDERLINE}上級者向けのサーバー${WHITE}", + s"${WHITE}ここは$BLUE${UNDERLINE}上級者向けのサーバー$WHITE", s"${WHITE}始めたては他がおすすめ", 10, 70, @@ -226,14 +225,12 @@ class PlayerJoinListener extends Listener { // TODO: エデンサーバーの不具合が解消されたら削除すること if (SeichiAssist.seichiAssistConfig.getServerNum == 2) { player.sendMessage( - Array( - s"${RED}${BOLD}${UNDERLINE}【ご注意ください】${RESET}", - s"${YELLOW}${BOLD}エデンサーバーは現在、管理者の意図しないタイミングでシャットダウン(いわゆる「鯖落ち」)が起こることがあります。", - s"${YELLOW}${BOLD}もし鯖落ちによりアイテムの消失等が発生しても、補償はできかねます。", - s"${YELLOW}${BOLD}当サーバーは以上の内容をご理解の上ご利用ください。", - s"${YELLOW}${BOLD}不安な場合はアルカディアサーバーやヴァルハラサーバーのご利用をおすすめいたします。", - s"${YELLOW}${BOLD}ご迷惑をおかけいたしまして申し訳ございません。。" - ) + s"${RED}${BOLD}${UNDERLINE}【ご注意ください】${RESET}", + s"${YELLOW}${BOLD}エデンサーバーは現在、管理者の意図しないタイミングでシャットダウン(いわゆる「鯖落ち」)が起こることがあります。", + s"${YELLOW}${BOLD}もし鯖落ちによりアイテムの消失等が発生しても、補償はできかねます。", + s"${YELLOW}${BOLD}当サーバーは以上の内容をご理解の上ご利用ください。", + s"${YELLOW}${BOLD}不安な場合はアルカディアサーバーやヴァルハラサーバーのご利用をおすすめいたします。", + s"${YELLOW}${BOLD}ご迷惑をおかけいたしまして申し訳ございません。。" ) } } @@ -249,10 +246,10 @@ class PlayerJoinListener extends Listener { // coreprotectを切る // inspectマップにtrueで登録されている場合 - if (Config.inspecting.getOrDefault(p.getName, false)) { + if (ConfigHandler.inspecting.getOrDefault(p.getName, false)) { // falseに変更する p.sendMessage("§3CoreProtect §f- Inspector now disabled.") - Config.inspecting.put(p.getName, false) + ConfigHandler.inspecting.put(p.getName, false) } // アサルトスキルを切る diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/RegionInventoryListener.scala b/src/main/scala/com/github/unchama/seichiassist/listener/RegionInventoryListener.scala index 3609bd07e7..66117b653a 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/RegionInventoryListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/RegionInventoryListener.scala @@ -8,12 +8,12 @@ import com.github.unchama.seichiassist.util.{ RelativeDirection } import com.github.unchama.seichiassist.{Config, SeichiAssist} -import com.github.unchama.util.external.ExternalPlugins +import com.github.unchama.util.external.{ExternalPlugins, WorldGuardWrapper} import com.github.unchama.util.syntax.Nullability.NullabilityExtensionReceiver -import com.sk89q.worldedit.bukkit.WorldEditPlugin +import com.sk89q.worldedit.WorldEdit +import com.sk89q.worldedit.bukkit.{BukkitAdapter, WorldEditPlugin} import com.sk89q.worldguard.bukkit.WorldGuardPlugin -import com.sk89q.worldguard.bukkit.commands.AsyncCommandHelper -import com.sk89q.worldguard.bukkit.commands.task.RegionAdder +import com.sk89q.worldguard.commands.task.RegionAdder import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion import com.sk89q.worldguard.protection.util.DomainInputResolver import org.bukkit.ChatColor._ @@ -70,7 +70,7 @@ class RegionInventoryListener extends Listener { } // インベントリ名が以下の時処理 - if (topinventory.getTitle == LIGHT_PURPLE.toString + "グリッド式保護設定メニュー") { + if (view.getTitle == LIGHT_PURPLE.toString + "グリッド式保護設定メニュー") { event.setCancelled(true) // プレイヤーインベントリのクリックの場合終了 @@ -86,51 +86,25 @@ class RegionInventoryListener extends Listener { val playerData = playermap(uuid) // チャンク延長 - if ( - itemstackcurrent.getType == Material.STAINED_GLASS_PANE && itemstackcurrent - .getDurability - .toInt == 14 - ) { + if (itemstackcurrent.getType == Material.RED_STAINED_GLASS_PANE) { gridChangeFunction(player, RelativeDirection.AHEAD, event) - } else if ( - itemstackcurrent.getType == Material.STAINED_GLASS_PANE && itemstackcurrent - .getDurability - .toInt == 10 - ) { + } else if (itemstackcurrent.getType == Material.PURPLE_STAINED_GLASS_PANE) { gridChangeFunction(player, RelativeDirection.LEFT, event) - } else if ( - itemstackcurrent.getType == Material.STAINED_GLASS_PANE && itemstackcurrent - .getDurability - .toInt == 5 - ) { + } else if (itemstackcurrent.getType == Material.LIME_STAINED_GLASS_PANE) { gridChangeFunction(player, RelativeDirection.RIGHT, event) - } else if ( - itemstackcurrent.getType == Material.STAINED_GLASS_PANE && itemstackcurrent - .getDurability - .toInt == 13 - ) { + } else if (itemstackcurrent.getType == Material.GREEN_STAINED_GLASS_PANE) { gridChangeFunction(player, RelativeDirection.BEHIND, event) - } else if ( - itemstackcurrent.getType == Material.WOOL && itemstackcurrent.getDurability.toInt == 11 - ) { + } else if (itemstackcurrent.getType == Material.BLUE_WOOL) { player.chat("//expand vert") createRegion(player) playerData.regionCount = playerData.regionCount + 1 player.playSound(player.getLocation, Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, 1.0f) player.closeInventory() - } else if ( - itemstackcurrent.getType == Material.STAINED_GLASS_PANE && itemstackcurrent - .getDurability - .toInt == 4 - ) { + } else if (itemstackcurrent.getType == Material.YELLOW_STAINED_GLASS_PANE) { gridResetFunction(player) player.playSound(player.getLocation, Sound.BLOCK_ANVIL_DESTROY, 0.5f, 1.0f) player.openInventory(RegionMenuData.getGridWorldGuardMenu(player)) - } else if ( - itemstackcurrent.getType == Material.STAINED_GLASS_PANE && itemstackcurrent - .getDurability - .toInt == 0 - ) { + } else if (itemstackcurrent.getType == Material.WHITE_STAINED_GLASS_PANE) { playerData.toggleUnitPerGrid() player.playSound(player.getLocation, Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1.0f, 1.0f) player.openInventory(RegionMenuData.getGridWorldGuardMenu(player)) @@ -143,25 +117,32 @@ class RegionInventoryListener extends Listener { private def createRegion(player: Player): Unit = { val playerData = SeichiAssist.playermap(player.getUniqueId) - val selection = We.getSelection(player) + val world = player.getWorld + val selection = WorldEdit + .getInstance() + .getSessionManager + .get(BukkitAdapter.adapt(player)) + .getSelection(BukkitAdapter.adapt(world)) val region = new ProtectedCuboidRegion( player.getName + "_" + playerData.regionCount, - selection.getNativeMinimumPoint.toBlockVector, - selection.getNativeMaximumPoint.toBlockVector + selection.getMinimumPoint, + selection.getMaximumPoint ) - val manager = Wg.getRegionManager(player.getWorld) + val manager = WorldGuardWrapper.getRegionManager(world) - val task = new RegionAdder(Wg, manager, region) + val task = new RegionAdder(manager, region) task.setLocatorPolicy(DomainInputResolver.UserLocatorPolicy.UUID_ONLY) task.setOwnersInput(Array(player.getName)) - val future = Wg.getExecutorService.submit(task) - AsyncCommandHelper - .wrap(future, Wg, player) - .formatUsing(player.getName + "_" + playerData.regionCount) - .registerWithSupervisor("保護申請中") - .thenRespondWith("保護申請完了。保護名: '%s'", "保護作成失敗") + try { + player.sendMessage("保護申請中") + task.call() + player.sendMessage(s"保護申請完了。保護名: ${player.getName + "_" + playerData.regionCount}") + + } catch { + case _: Throwable => player.sendMessage("保護作成失敗") + } } @EventHandler @@ -182,13 +163,13 @@ class RegionInventoryListener extends Listener { if (he.getType != EntityType.PLAYER) { return } - val topinventory = view.getTopInventory.ifNull { + view.getTopInventory.ifNull { return } // インベントリが存在しない時終了 // インベントリ名が以下の時処理 - if (topinventory.getTitle == LIGHT_PURPLE.toString + "グリッド式保護・設定保存") { + if (view.getTitle == LIGHT_PURPLE.toString + "グリッド式保護・設定保存") { event.setCancelled(true) // プレイヤーインベントリのクリックの場合終了 @@ -421,9 +402,12 @@ object RegionInventoryListener { private def canCreateRegion(player: Player): Unit = { val playerData = SeichiAssist.playermap(player.getUniqueId) - val selection = We.getSelection(player) - val manager = Wg.getRegionManager(player.getWorld) - val wcfg = Wg.getGlobalStateManager.get(player.getWorld) + val world = player.getWorld + val selection = WorldEdit + .getInstance() + .getSessionManager + .get(BukkitAdapter.adapt(player)) + .getSelection(BukkitAdapter.adapt(world)) if (selection == null) { playerData.canCreateRegion = false @@ -431,21 +415,18 @@ object RegionInventoryListener { val region = new ProtectedCuboidRegion( player.getName + "_" + playerData.regionCount, - selection.getNativeMinimumPoint.toBlockVector, - selection.getNativeMaximumPoint.toBlockVector + selection.getMinimumPoint, + selection.getMaximumPoint ) - val regions = manager.getApplicableRegions(region) - if (regions.size() != 0) { + if (WorldGuardWrapper.isNotOverlapping(world, region)) { playerData.canCreateRegion = false return } - val maxRegionCount = wcfg.getMaxRegionCount(player) + val maxRegionCount = WorldGuardWrapper.getWorldMaxRegion(world) if ( - maxRegionCount >= 0 && manager.getRegionCountOfPlayer( - Wg.wrapPlayer(player) - ) >= maxRegionCount + maxRegionCount >= 0 && WorldGuardWrapper.getMaxRegion(player, world) >= maxRegionCount ) { playerData.canCreateRegion = false return diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/SpawnRegionProjectileInterceptor.scala b/src/main/scala/com/github/unchama/seichiassist/listener/SpawnRegionProjectileInterceptor.scala index 5f7cb471e8..294ad05168 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/SpawnRegionProjectileInterceptor.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/SpawnRegionProjectileInterceptor.scala @@ -1,6 +1,6 @@ package com.github.unchama.seichiassist.listener -import com.github.unchama.util.external.WorldGuardWrapper.getRegions +import com.github.unchama.util.external.WorldGuardWrapper.getRegion import org.bukkit.Material._ import org.bukkit.event.block.Action import org.bukkit.event.player.PlayerInteractEvent @@ -19,10 +19,10 @@ object SpawnRegionProjectileInterceptor extends Listener { BOW, EGG, ENDER_PEARL, - EXP_BOTTLE, - EYE_OF_ENDER, + EXPERIENCE_BOTTLE, + ENDER_EYE, LINGERING_POTION, - SNOW_BALL, + SNOWBALL, SPLASH_POTION ) @@ -34,7 +34,7 @@ object SpawnRegionProjectileInterceptor extends Listener { val isRightClickEvent = action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK val isInSpawnRegion = - getRegions(player.getLocation).map(_.getId).exists(spawnRegionNames.contains) + getRegion(player.getLocation).map(_.getId).exists(spawnRegionNames.contains) // Projectileを持った状態で右クリックし、playerがいる保護がspawn保護の中であった場合はイベントをキャンセルする if (hasProjectile && isRightClickEvent && isInSpawnRegion) { diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/WorldRegenListener.java b/src/main/scala/com/github/unchama/seichiassist/listener/WorldRegenListener.java index 93d27d1800..06e201cbd9 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/WorldRegenListener.java +++ b/src/main/scala/com/github/unchama/seichiassist/listener/WorldRegenListener.java @@ -2,15 +2,15 @@ import com.github.unchama.seichiassist.Config; import com.github.unchama.seichiassist.SeichiAssist; -import com.sk89q.worldedit.BlockVector; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.blocks.BaseBlock; +import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitWorld; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; +import com.sk89q.worldguard.WorldGuard; import com.sk89q.worldguard.bukkit.WorldGuardPlugin; -import com.sk89q.worldguard.protection.managers.RegionManager; import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.wimbli.WorldBorder.CoordXZ; @@ -20,10 +20,14 @@ import io.monchi.regenworld.event.RegenWorldEvent; import org.bukkit.Bukkit; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.World; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import java.util.Collection; +import java.util.Objects; + /** * @author Mon_chi */ @@ -33,8 +37,6 @@ public class WorldRegenListener implements Listener { private final int roadLength; private final int spaceHeight; private final int worldSize; - private final BaseBlock roadBlock; - private final BaseBlock spaceBlock; private final WorldEdit worldEdit; private final WorldGuardPlugin worldGuard; @@ -46,8 +48,6 @@ public WorldRegenListener() { this.roadLength = config.getRoadLength(); this.spaceHeight = config.getSpaceHeight(); this.worldSize = config.getWorldSize(); - this.roadBlock = new BaseBlock(config.getRoadBlockID(), config.getRoadBlockDamage()); - this.spaceBlock = new BaseBlock(0); this.worldEdit = WorldEdit.getInstance(); this.worldGuard = WorldGuardPlugin.inst(); @@ -73,20 +73,26 @@ public void onWorldRegen(RegenWorldEvent event) { com.wimbli.WorldBorder.Config.fillTask.setTaskID(task); } - RegionManager regionManager = worldGuard.getRegionManager(world); - regionManager.getRegions().keySet().stream() - .filter(region -> !region.equalsIgnoreCase("__global__")) - .forEach(regionManager::removeRegion); + Collection regions = Objects.requireNonNull(WorldGuard.getInstance().getPlatform() + .getRegionContainer() + .get(BukkitAdapter.adapt(world))) + .getRegions() + .values(); + + regions.forEach(region -> { + Objects.requireNonNull(WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(world))).removeRegion(region.getId()); + }); + EditSession session = worldEdit.getEditSessionFactory().getEditSession(bukkitWorld, 99999999); try { // spawnの地形造成 - setupRoadWithWorldGuard(session, world, "spawn", new BlockVector(0, roadY, 0), new BlockVector(15, roadY, 15)); + setupRoadWithWorldGuard(session, world, "spawn", BlockVector3.at(0, roadY, 0), BlockVector3.at(15, roadY, 15)); // 東西南北へ続くroadの地形造成 - setupRoad(session, world, new BlockVector(16, roadY, 0), new BlockVector(15 + 16 * roadLength, roadY, 15)); - setupRoad(session, world, new BlockVector(-1, roadY, 0), new BlockVector(-(16 * roadLength), roadY, 15)); - setupRoad(session, world, new BlockVector(0, roadY, 16), new BlockVector(15, roadY, 15 + 16 * roadLength)); - setupRoad(session, world, new BlockVector(0, roadY, -1), new BlockVector(15, roadY, -(16 * roadLength))); + setupRoad(session, world, BlockVector3.at(16, roadY, 0), BlockVector3.at(15 + 16 * roadLength, roadY, 15)); + setupRoad(session, world, BlockVector3.at(-1, roadY, 0), BlockVector3.at(-(16 * roadLength), roadY, 15)); + setupRoad(session, world, BlockVector3.at(0, roadY, 16), BlockVector3.at(15, roadY, 15 + 16 * roadLength)); + setupRoad(session, world, BlockVector3.at(0, roadY, -1), BlockVector3.at(15, roadY, -(16 * roadLength))); } catch (MaxChangedBlocksException e) { e.printStackTrace(); } @@ -95,33 +101,24 @@ public void onWorldRegen(RegenWorldEvent event) { /** * 地形造成を行う * - * @param session - * @param world - * @param pos1 - * @param pos2 * @throws MaxChangedBlocksException */ - private void setupRoad(EditSession session, World world, BlockVector pos1, BlockVector pos2) throws MaxChangedBlocksException { + private void setupRoad(EditSession session, World world, BlockVector3 pos1, BlockVector3 pos2) throws MaxChangedBlocksException { BukkitWorld bukkitWorld = new BukkitWorld(world); - session.setBlocks(new CuboidRegion(bukkitWorld, pos1, pos2), roadBlock); - session.setBlocks(new CuboidRegion(bukkitWorld, pos1.add(0, 1, 0), pos2.add(0, 1 + spaceHeight, 0)), spaceBlock); + session.setBlocks(new CuboidRegion(bukkitWorld, pos1, pos2), BukkitAdapter.adapt(Material.BEDROCK.createBlockData())); + session.setBlocks(new CuboidRegion(bukkitWorld, pos1.add(0, 1, 0), pos2.add(0, 1 + spaceHeight, 0)), BukkitAdapter.adapt(Material.AIR.createBlockData())); } /** * 地形造成と、地形造成を行った場所にWorldGuardRegionも設定する * - * @param session - * @param world - * @param protName - * @param pos1 - * @param pos2 * @throws MaxChangedBlocksException */ - private void setupRoadWithWorldGuard(EditSession session, World world, String protName, BlockVector pos1, BlockVector pos2) throws MaxChangedBlocksException { + private void setupRoadWithWorldGuard(EditSession session, World world, String protName, BlockVector3 pos1, BlockVector3 pos2) throws MaxChangedBlocksException { BukkitWorld bukkitWorld = new BukkitWorld(world); - session.setBlocks(new CuboidRegion(bukkitWorld, pos1, pos2), roadBlock); - session.setBlocks(new CuboidRegion(bukkitWorld, pos1.add(0, 1, 0), pos2.add(0, 1 + spaceHeight, 0)), spaceBlock); - ProtectedRegion region = new ProtectedCuboidRegion(protName, new BlockVector(pos1.getX(), 0, pos1.getZ()), new BlockVector(pos2.getX(), 255, pos2.getZ())); - WorldGuardPlugin.inst().getRegionManager(world).addRegion(region); + session.setBlocks(new CuboidRegion(bukkitWorld, pos1, pos2), BukkitAdapter.adapt(Material.BEDROCK.createBlockData())); + session.setBlocks(new CuboidRegion(bukkitWorld, pos1.add(0, 1, 0), pos2.add(0, 1 + spaceHeight, 0)), BukkitAdapter.adapt(Material.AIR.createBlockData())); + ProtectedRegion region = new ProtectedCuboidRegion(protName, BlockVector3.at(pos1.getX(), 0, pos1.getZ()), BlockVector3.at(pos2.getX(), 255, pos2.getZ())); + WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(world)).addRegion(region); } } diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/Y5DoubleSlabCanceller.scala b/src/main/scala/com/github/unchama/seichiassist/listener/Y5DoubleSlabCanceller.scala index fd84ecbdfa..dded3ccc37 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/Y5DoubleSlabCanceller.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/Y5DoubleSlabCanceller.scala @@ -2,6 +2,8 @@ package com.github.unchama.seichiassist.listener import com.github.unchama.seichiassist.ManagedWorld._ import org.bukkit.Material +import org.bukkit.block.Block +import org.bukkit.block.data.`type`.Slab import org.bukkit.event.block.BlockPlaceEvent import org.bukkit.event.{EventHandler, Listener} @@ -22,9 +24,12 @@ object Y5DoubleSlabCanceller extends Listener { @EventHandler def onPlaceDoubleSlabAtY5(event: BlockPlaceEvent): Unit = { if (!event.canBuild) return - if (event.getItemInHand.getType ne Material.STEP) return - if (event.getItemInHand.getDurability != 0) return - if (event.getBlockPlaced.getType ne Material.DOUBLE_STEP) return + if (event.getItemInHand.getType ne Material.STONE_SLAB) return + val placedBlockType = event.getBlockPlaced.getType + if ( + placedBlockType.isBlock && placedBlockType.asInstanceOf[Block].isInstanceOf[Slab] + && event.getBlockPlaced.getType.asInstanceOf[Slab].getType != Slab.Type.DOUBLE + ) return if (event.getBlockPlaced.getData != 0) return if (!event.getBlockPlaced.getWorld.isSeichi) return if (event.getBlockPlaced.getY != 5) return diff --git a/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala b/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala index 4122f4b310..c2df181fc7 100644 --- a/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/listener/invlistener/OnClickTitleMenu.scala @@ -57,7 +57,11 @@ object OnClickTitleMenu { if (topInventory.row != 4) { return } - val current = event.getCurrentItem + val current = event + .getCurrentItem + .ifNull( + return + ) val player = he.asInstanceOf[Player] val pd = SeichiAssist.playermap(player.getUniqueId) @@ -68,8 +72,8 @@ object OnClickTitleMenu { } val mat = current.getType - val isSkull = mat == Material.SKULL_ITEM - topInventory.getTitle match { + val isSkull = mat == Material.PLAYER_HEAD + view.getTitle match { case MenuType.HEAD.invName => event.setCancelled(true) mat match { diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/BuildMainMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/BuildMainMenu.scala index f655e40618..3ebd49d216 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/BuildMainMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/BuildMainMenu.scala @@ -207,7 +207,7 @@ private case class ButtonComputations(player: Player)( IO { val openerData = BuildAssist.instance.temporaryData(getUniqueId) - val iconItemStack = new IconItemStackBuilder(Material.WOOD) + val iconItemStack = new IconItemStackBuilder(Material.OAK_WOOD) .title(s"$YELLOW${EMPHASIZE}直列設置: ${BuildAssist.line_up_str(openerData.line_up_flg)}") .lore( s"$RESET${GRAY}オフハンドに木の棒、メインハンドに設置したいブロックを持って", @@ -279,7 +279,7 @@ private case class ButtonComputations(player: Player)( def computeButtonToOpenMenuToCraftItemsWhereMineStack( implicit canOpenMassCraftMenu: CanOpen[IO, MineStackMassCraftMenu] ): IO[Button] = IO { - val iconItemStackBuilder = new IconItemStackBuilder(Material.WORKBENCH) + val iconItemStackBuilder = new IconItemStackBuilder(Material.CRAFTING_TABLE) .title(s"$YELLOW${EMPHASIZE}MineStackブロック一括クラフト画面へ") .lore(s"$RESET$DARK_RED${UNDERLINE}クリックで移動") .build() diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/RegionMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/RegionMenu.scala index dac448bdda..b24aead0d9 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/RegionMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/RegionMenu.scala @@ -13,7 +13,8 @@ import com.github.unchama.seichiassist.SeichiAssist import com.github.unchama.seichiassist.data.RegionMenuData import com.github.unchama.targetedeffect.commandsender.MessageEffect import com.github.unchama.targetedeffect.player.{CommandEffect, FocusedSoundEffect} -import com.github.unchama.util.external.ExternalPlugins +import com.sk89q.worldedit.WorldEdit +import com.sk89q.worldedit.bukkit.BukkitAdapter import org.bukkit.ChatColor._ import org.bukkit.entity.Player import org.bukkit.event.inventory.InventoryType @@ -61,7 +62,11 @@ object RegionMenu extends Menu { val computeButtonToClaimRegion: IO[Button] = IO { val openerData = SeichiAssist.playermap(player.getUniqueId) - val selection = ExternalPlugins.getWorldEdit.getSelection(player) + val selection = WorldEdit + .getInstance() + .getSessionManager + .get(BukkitAdapter.adapt(player)) + .getSelection(BukkitAdapter.adapt(player.getWorld)) val playerHasPermission = player.hasPermission("worldguard.region.claim") val isSelectionNull = selection == null @@ -100,7 +105,7 @@ object RegionMenu extends Menu { } import scala.util.chaining._ - new IconItemStackBuilder(Material.GOLD_AXE) + new IconItemStackBuilder(Material.GOLDEN_AXE) .tap { b => if (canMakeRegion) b.enchanted() } .title(s"$YELLOW$UNDERLINE${BOLD}保護の作成") .lore(lore.toList) @@ -145,7 +150,7 @@ object RegionMenu extends Menu { s"$GREEN④メニューの${YELLOW}金の斧${GREEN}をクリック" ) - val iconItemStack = new IconItemStackBuilder(Material.WOOD_AXE) + val iconItemStack = new IconItemStackBuilder(Material.WOODEN_AXE) .title(s"$YELLOW$UNDERLINE${BOLD}保護設定用の木の斧を召喚") .lore( wandUsage ++ List( diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/ServerSwitchMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/ServerSwitchMenu.scala index f037604ab3..bf06a2b42b 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/ServerSwitchMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/ServerSwitchMenu.scala @@ -53,7 +53,7 @@ object ServerSwitchMenu extends Menu { ) case object EDEN - extends Server(s"$YELLOW${BOLD}エデン", "s2", ChestSlotRef(0, 1), Material.DIAMOND_SPADE) + extends Server(s"$YELLOW${BOLD}エデン", "s2", ChestSlotRef(0, 1), Material.DIAMOND_SHOVEL) case object VALHALLA extends Server(s"$YELLOW${BOLD}ヴァルハラ", "s3", ChestSlotRef(0, 2), Material.DIAMOND_AXE) diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala index b2c3668a55..a88db368b9 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala @@ -149,7 +149,7 @@ object VoteMenu extends Menu { } val showVoteURLButton: Button = Button( - new IconItemStackBuilder(Material.BOOK_AND_QUILL) + new IconItemStackBuilder(Material.WRITABLE_BOOK) .title(s"$YELLOW$UNDERLINE${BOLD}投票ページにアクセス") .lore( List( @@ -181,7 +181,7 @@ object VoteMenu extends Menu { fairySummonCost <- fairyAPI.fairySummonCost(player) } yield { Button( - new IconItemStackBuilder(Material.WATCH) + new IconItemStackBuilder(Material.CLOCK) .title(s"$AQUA$UNDERLINE${BOLD}マナ妖精 時間設定") .lore( List( @@ -383,7 +383,12 @@ object VoteMenu extends Menu { s"$RESET${DARK_GRAY}召喚されたらラッキーだよ!" ) val topFourRankingLore = - topFourRanking.flatMap { rankData => + List( + topFourRanking.headOption, + topFourRanking.lift(1), + topFourRanking.lift(2), + topFourRanking.lift(3) + ).flatMap(_.flatten).flatMap { rankData => List( s"${GRAY}たくさんくれたニンゲン第${rankData.rank}位!", s"${GRAY}なまえ:${rankData.playerName} りんご:${rankData.consumed.amount}個" diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementCategoryMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementCategoryMenu.scala index 587499d69b..82b9028da4 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementCategoryMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementCategoryMenu.scala @@ -37,12 +37,12 @@ object AchievementCategoryMenu { ChestSlotRef(1, 5) -> (BrokenBlockRanking, Material.DIAMOND_PICKAXE) ) case Building => - Map(ChestSlotRef(1, 4) -> (PlacedBlockAmount, Material.BIRCH_WOOD_STAIRS)) + Map(ChestSlotRef(1, 4) -> (PlacedBlockAmount, Material.BIRCH_STAIRS)) case Login => Map( ChestSlotRef(1, 1) -> (PlayTime, Material.COMPASS), ChestSlotRef(1, 3) -> (TotalLogins, Material.BOOK), - ChestSlotRef(1, 5) -> (ConsecutiveLogins, Material.BOOK_AND_QUILL), + ChestSlotRef(1, 5) -> (ConsecutiveLogins, Material.WRITABLE_BOOK), ChestSlotRef(1, 7) -> (Anniversaries, Material.NETHER_STAR) ) case Challenges => @@ -53,8 +53,8 @@ object AchievementCategoryMenu { case Specials => Map( ChestSlotRef(1, 2) -> (OfficialEvent, Material.BLAZE_POWDER), - ChestSlotRef(1, 4) -> (VoteCounts, Material.YELLOW_FLOWER), - ChestSlotRef(1, 6) -> (Secrets, Material.DIAMOND_BARDING) + ChestSlotRef(1, 4) -> (VoteCounts, Material.DANDELION), + ChestSlotRef(1, 6) -> (Secrets, Material.DIAMOND_HORSE_ARMOR) ) } diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementMenu.scala index fe318872ad..be837b5c4c 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/achievement/AchievementMenu.scala @@ -40,11 +40,11 @@ object AchievementMenu extends Menu { val categoryLayout: Map[Int, AchievementCategoryRepr] = Map( - ChestSlotRef(1, 1) -> (BrokenBlock, Material.GOLD_PICKAXE), + ChestSlotRef(1, 1) -> (BrokenBlock, Material.GOLDEN_PICKAXE), ChestSlotRef(1, 3) -> (Building, Material.GLASS), ChestSlotRef(1, 5) -> (Login, Material.COMPASS), ChestSlotRef(1, 7) -> (Challenges, Material.BLAZE_POWDER), - ChestSlotRef(2, 4) -> (Specials, Material.EYE_OF_ENDER) + ChestSlotRef(2, 4) -> (Specials, Material.ENDER_EYE) ) def buttonFor( @@ -88,7 +88,7 @@ object AchievementMenu extends Menu { categoryLayout.view.mapValues(category => buttonFor(category)).toMap val toggleTitleToPlayerLevelButton = Button( - new IconItemStackBuilder(Material.REDSTONE_TORCH_ON) + new IconItemStackBuilder(Material.REDSTONE_TORCH) .title(ColorScheme.navigation("整地Lvを表示")) .lore( List( diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/home/HomeMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/home/HomeMenu.scala index f899665d95..8f92a0279a 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/home/HomeMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/home/HomeMenu.scala @@ -200,7 +200,7 @@ case class HomeMenuButtonComputations(player: Player)( homeOpt <- homeReadAPI.get(player.getUniqueId, homeId) } yield { Button( - new IconItemStackBuilder(Material.BED) + new IconItemStackBuilder(Material.WHITE_BED) .title(s"$YELLOW$UNDERLINE${BOLD}ホームポイント${homeNumber}を設定") .lore( List( @@ -231,7 +231,7 @@ case class HomeMenuButtonComputations(player: Player)( homeOpt <- homeReadAPI.get(player.getUniqueId, homeId) } yield { Button( - new IconItemStackBuilder(Material.WOOL, 14) + new IconItemStackBuilder(Material.WHITE_WOOL) .title(s"$RED$UNDERLINE${BOLD}ホームポイント${homeNumber}を削除") .lore( List( @@ -242,7 +242,7 @@ case class HomeMenuButtonComputations(player: Player)( ) .build(), LeftClickButtonEffect { - FocusedSoundEffect(Sound.BLOCK_ENDERCHEST_CLOSE, 1f, 0.1f) + FocusedSoundEffect(Sound.BLOCK_ENDER_CHEST_CLOSE, 1f, 0.1f) SequentialEffect( environment .ioCanOpenHomeRemoveConfirmationMenu @@ -272,7 +272,7 @@ case class HomeChangeConfirmationMenu(changeHomeNumber: Int, homeName: String = val changeButton: Button = Button( - new IconItemStackBuilder(Material.WOOL, durability = 5).title(s"${GREEN}変更する").build(), + new IconItemStackBuilder(Material.LIME_WOOL).title(s"${GREEN}変更する").build(), LeftClickButtonEffect { SequentialEffect( FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f), @@ -284,7 +284,7 @@ case class HomeChangeConfirmationMenu(changeHomeNumber: Int, homeName: String = def cancelButton(implicit environment: Environment): Button = Button( - new IconItemStackBuilder(Material.WOOL, durability = 14).title(s"${RED}変更しない").build(), + new IconItemStackBuilder(Material.RED_WOOL).title(s"${RED}変更しない").build(), LeftClickButtonEffect { FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f) environment.ioCanOpenHomeMenu.open(new HomeMenu) @@ -324,7 +324,7 @@ case class HomeRemoveConfirmationMenu(removeHomeNumber: Int, homeName: String = val removeButton: Button = Button( - new IconItemStackBuilder(Material.WOOL, durability = 5).title(s"${GREEN}削除する").build(), + new IconItemStackBuilder(Material.LIME_WOOL).title(s"${GREEN}削除する").build(), LeftClickButtonEffect { SequentialEffect( FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f), @@ -336,7 +336,7 @@ case class HomeRemoveConfirmationMenu(removeHomeNumber: Int, homeName: String = def cancelButton(implicit environment: Environment): Button = Button( - new IconItemStackBuilder(Material.WOOL, durability = 14).title(s"${RED}変更しない").build(), + new IconItemStackBuilder(Material.RED_WOOL).title(s"${RED}変更しない").build(), LeftClickButtonEffect { FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f) environment.ioCanOpenHomeMenu.open(new HomeMenu) diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/minestack/MineStackMainMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/minestack/MineStackMainMenu.scala index dadbab3c2c..198f52f0bb 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/minestack/MineStackMainMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/minestack/MineStackMainMenu.scala @@ -39,8 +39,8 @@ object MineStackMainMenu extends Menu { def iconMaterialFor(category: MineStackObjectCategory): Material = category match { case ORES => Material.DIAMOND_ORE case MOB_DROP => Material.ENDER_PEARL - case AGRICULTURAL => Material.SEEDS - case BUILDING => Material.SMOOTH_BRICK + case AGRICULTURAL => Material.WHEAT_SEEDS + case BUILDING => Material.STONE_BRICKS case REDSTONE_AND_TRANSPORTATION => Material.REDSTONE case GACHA_PRIZES => Material.GOLDEN_APPLE } diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala index 7ad8f10c9b..d95ae0f50c 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/skill/ActiveSkillMenu.scala @@ -178,11 +178,11 @@ object ActiveSkillMenu extends Menu { case SeichiSkill.Thunderstorm => new IconItemStackBuilder(Material.MINECART) case SeichiSkill.StarlightBreaker => - new IconItemStackBuilder(Material.STORAGE_MINECART) + new IconItemStackBuilder(Material.CHEST_MINECART) case SeichiSkill.EarthDivide => - new IconItemStackBuilder(Material.POWERED_MINECART) + new IconItemStackBuilder(Material.FURNACE_MINECART) case SeichiSkill.HeavenGaeBolg => - new IconItemStackBuilder(Material.EXPLOSIVE_MINECART) + new IconItemStackBuilder(Material.TNT_MINECART) case SeichiSkill.Decision => new IconItemStackBuilder(Material.HOPPER_MINECART) @@ -212,7 +212,7 @@ object ActiveSkillMenu extends Menu { case SeichiSkill.MoerakiBoulders => new IconItemStackBuilder(Material.NETHER_BRICK) case SeichiSkill.Eldfell => - new IconItemStackBuilder(Material.MAGMA) + new IconItemStackBuilder(Material.MAGMA_BLOCK) case SeichiSkill.VenderBlizzard => new IconItemStackBuilder(Material.NETHER_STAR) case SeichiSkill.AssaultArmor => @@ -385,7 +385,7 @@ object ActiveSkillMenu extends Menu { s"$GOLD$BOLD$notificationMessage" ) }), - BroadcastSoundEffect(Sound.ENTITY_ENDERDRAGON_DEATH, 1.0f, 1.2f) + BroadcastSoundEffect(Sound.ENTITY_ENDER_DRAGON_DEATH, 1.0f, 1.2f) ) ) } else (unlockedState, emptyEffect) diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/FirstPage.scala b/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/FirstPage.scala index 02262db2d1..860a540859 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/FirstPage.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/FirstPage.scala @@ -279,14 +279,13 @@ object FirstPage extends Menu { val computeRegionMenuButton: IO[Button] = IO { val (buttonLore, effect) = { val world = getWorld - val regionManager = WorldGuardWrapper.getRegionManager(world) - if (regionManager.isEmpty) { + if (WorldGuardWrapper.canProtectionWorld(world)) { (List(s"${GRAY}このワールドでは土地の保護は行なえません"), LeftClickButtonEffect(emptyEffect)) } else { - val maxRegionCount = WorldGuardWrapper.getMaxRegionCount(player, world) + val maxRegionCount = WorldGuardWrapper.getWorldMaxRegion(world) val currentPlayerRegionCount = - WorldGuardWrapper.getRegionCountOfPlayer(player, world) + WorldGuardWrapper.getMaxRegion(player, world) ( List( @@ -370,7 +369,7 @@ object FirstPage extends Menu { s"$RESET$DARK_GREEN${UNDERLINE}クリックで開く" ) - new IconItemStackBuilder(Material.ENDER_PORTAL_FRAME) + new IconItemStackBuilder(Material.END_PORTAL_FRAME) .title(s"$YELLOW$UNDERLINE${BOLD}4次元ポケットを開く") .lore(loreHeading ++ loreAnnotation) .build() @@ -408,7 +407,7 @@ object FirstPage extends Menu { FocusedSoundEffect(Sound.BLOCK_GRASS_PLACE, 1.0f, 0.1f) case Left(_) => // 開くのに失敗した場合の音 - FocusedSoundEffect(Sound.BLOCK_ENDERCHEST_OPEN, 1.0f, 1.0f) + FocusedSoundEffect(Sound.BLOCK_ENDER_CHEST_OPEN, 1.0f, 1.0f) } ) ) @@ -657,7 +656,7 @@ object FirstPage extends Menu { def homePointMenuButton(implicit ioCanOpenHomeMenu: IO CanOpen HomeMenu): Button = { val iconItemStack = - new IconItemStackBuilder(Material.BED) + new IconItemStackBuilder(Material.WHITE_BED) .title(s"$YELLOW$UNDERLINE${BOLD}ホームメニューを開く") .lore(List(s"$RESET${GRAY}ホームポイントに関するメニュー", s"$RESET$DARK_RED${UNDERLINE}クリックで開く")) .build() @@ -673,7 +672,7 @@ object FirstPage extends Menu { val fastCraftButton: Button = { val iconItemStack = - new IconItemStackBuilder(Material.WORKBENCH) + new IconItemStackBuilder(Material.CRAFTING_TABLE) .title(s"$YELLOW$UNDERLINE${BOLD}FastCraft機能") .lore( List( diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala b/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala index 0912f93cfc..7b65b9f0f5 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/stickmenu/SecondPage.scala @@ -489,17 +489,18 @@ object SecondPage extends Menu { } val JMSNavigationButton: Button = { - val iconItemStack = new IconItemStackBuilder(Material.SIGN) - .title(s"$YELLOW$UNDERLINE${BOLD}JapanMinecraftServerリンク") - .lore( - List( - s"$RESET${DARK_GRAY}クリックするとチャット欄に", - s"$RESET${DARK_GRAY}URLが表示されますので", - s"$RESET${DARK_GRAY}Tキーを押してから", - s"$RESET${DARK_GRAY}そのURLをクリックしてください" + val iconItemStack = + new IconItemStackBuilder(Material.OAK_SIGN) // 1.16からSIGNが素材ごとに別れたので、オークに決めうちしておく + .title(s"$YELLOW$UNDERLINE${BOLD}JapanMinecraftServerリンク") + .lore( + List( + s"$RESET${DARK_GRAY}クリックするとチャット欄に", + s"$RESET${DARK_GRAY}URLが表示されますので", + s"$RESET${DARK_GRAY}Tキーを押してから", + s"$RESET${DARK_GRAY}そのURLをクリックしてください" + ) ) - ) - .build() + .build() Button( iconItemStack, @@ -514,7 +515,7 @@ object SecondPage extends Menu { } val appleConversionButton: Button = { - val iconItemStack = new IconItemStackBuilder(Material.GOLDEN_APPLE, durability = 1) + val iconItemStack = new IconItemStackBuilder(Material.GOLDEN_APPLE) .title(s"$YELLOW$UNDERLINE${BOLD}GT景品→椎名林檎変換システム") .lore( List( diff --git a/src/main/scala/com/github/unchama/seichiassist/seichiskill/BlockSearching.scala b/src/main/scala/com/github/unchama/seichiassist/seichiskill/BlockSearching.scala index 9f97c27841..44b4a50511 100644 --- a/src/main/scala/com/github/unchama/seichiassist/seichiskill/BlockSearching.scala +++ b/src/main/scala/com/github/unchama/seichiassist/seichiskill/BlockSearching.scala @@ -40,9 +40,9 @@ object BlockSearching { if (BreakUtil.canBreakWithSkill(player, targetBlock, lockedBlocks)) targetBlock.getType match { - case Material.STATIONARY_LAVA | Material.LAVA => + case Material.LAVA => lavaBlocks.add(targetBlock) - case Material.STATIONARY_WATER | Material.WATER => + case Material.WATER => waterBlocks.add(targetBlock) case _ => MaterialSets @@ -63,10 +63,7 @@ object BlockSearching { targetBlock => val blockMaterials = Set(referenceBlock.getType, targetBlock.getType) - val identifications = List( - Set(Material.DIRT, Material.GRASS), - Set(Material.REDSTONE_ORE, Material.GLOWING_REDSTONE_ORE) - ) + val identifications = List(Set(Material.DIRT, Material.GRASS), Set(Material.REDSTONE_ORE)) // マテリアルが同一視により等しくなるかどうか blockMaterials.size == 1 || identifications.exists(blockMaterials.subsetOf) diff --git a/src/main/scala/com/github/unchama/seichiassist/seichiskill/SkillRange.scala b/src/main/scala/com/github/unchama/seichiassist/seichiskill/SkillRange.scala index d5731b0b78..c96a2f96f4 100644 --- a/src/main/scala/com/github/unchama/seichiassist/seichiskill/SkillRange.scala +++ b/src/main/scala/com/github/unchama/seichiassist/seichiskill/SkillRange.scala @@ -49,7 +49,7 @@ object AssaultSkillRange { case class Lava(effectChunkSize: XYZTuple) extends AssaultSkillRange { override val blockMaterialConversion: Material => Material = { - case Material.LAVA => Material.MAGMA + case Material.LAVA => Material.MAGMA_BLOCK case x => x } } @@ -57,7 +57,7 @@ object AssaultSkillRange { case class Liquid(effectChunkSize: XYZTuple) extends AssaultSkillRange { override val blockMaterialConversion: Material => Material = { case Material.WATER => Material.ICE - case Material.LAVA => Material.MAGMA + case Material.LAVA => Material.MAGMA_BLOCK case x => x } } diff --git a/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala b/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala index 190aee7bab..e3a8ac2324 100644 --- a/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala +++ b/src/main/scala/com/github/unchama/seichiassist/seichiskill/assault/AssaultRoutine.scala @@ -18,6 +18,7 @@ import com.github.unchama.seichiassist.{DefaultEffectEnvironment, MaterialSets, import org.bukkit.ChatColor._ import org.bukkit.enchantments.Enchantment import org.bukkit.entity.Player +import org.bukkit.inventory.meta.Damageable import org.bukkit.{GameMode, Location, Material, Sound} object AssaultRoutine { @@ -141,7 +142,7 @@ object AssaultRoutine { // 減る耐久値の計算 val durability = - (toolToBeUsed.getDurability + + (toolToBeUsed.getItemMeta.asInstanceOf[Damageable].getDamage + BreakUtil.calcDurability( toolToBeUsed.getEnchantmentLevel(Enchantment.DURABILITY), breakTargets @@ -161,7 +162,11 @@ object AssaultRoutine { } // 耐久値を減らす - if (!toolToBeUsed.getItemMeta.isUnbreakable) toolToBeUsed.setDurability(durability) + if (!toolToBeUsed.getItemMeta.isUnbreakable) { + val meta = toolToBeUsed.getItemMeta + meta.asInstanceOf[Damageable].setDamage(durability) + toolToBeUsed.setItemMeta(meta) + } // ブロックを書き換える if (shouldBreakAllBlocks) { @@ -178,7 +183,7 @@ object AssaultRoutine { ) } else { if (shouldRemoveOrCondenseWater) foundWaters.foreach(_.setType(Material.PACKED_ICE)) - if (shouldRemoveOrCondenseLava) foundLavas.foreach(_.setType(Material.MAGMA)) + if (shouldRemoveOrCondenseLava) foundLavas.foreach(_.setType(Material.MAGMA_BLOCK)) } Some(newState) diff --git a/src/main/scala/com/github/unchama/seichiassist/seichiskill/effect/ActiveSkillEffect.scala b/src/main/scala/com/github/unchama/seichiassist/seichiskill/effect/ActiveSkillEffect.scala index b8b8775ab8..34234c588d 100644 --- a/src/main/scala/com/github/unchama/seichiassist/seichiskill/effect/ActiveSkillEffect.scala +++ b/src/main/scala/com/github/unchama/seichiassist/seichiskill/effect/ActiveSkillEffect.scala @@ -248,7 +248,7 @@ object ActiveSkillNormalEffect extends Enum[ActiveSkillNormalEffect] { s"${DARK_RED}メテオ", "隕石を落とす", 100, - Material.FIREBALL + Material.FIRE_CHARGE ) } @@ -290,7 +290,7 @@ sealed abstract class ActiveSkillPremiumEffect( standard, tool, shouldPlayBreakSound = false, - Material.WOOL + Material.WHITE_WOOL ) _ <- IO { breakBlocks.foreach { b => @@ -351,7 +351,7 @@ case object ActiveSkillPremiumEffect extends Enum[ActiveSkillPremiumEffect] { s"$RED$UNDERLINE${BOLD}マジック", "鶏が出る手品", 10, - Material.RED_ROSE + Material.POPPY ) } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/breakcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/breakcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala index b8337299bd..ce23ac609b 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/breakcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/breakcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala @@ -54,7 +54,7 @@ object BukkitNotifyLevelUp { .sendPlainText(notificationMessage) .toIO .unsafeRunAsyncAndForget() - SendSoundEffect.sendEverySound(Sound.ENTITY_ENDERDRAGON_DEATH, 1.0f, 1.2f) + SendSoundEffect.sendEverySound(Sound.ENTITY_ENDER_DRAGON_DEATH, 1.0f, 1.2f) }) } else Applicative[F].unit } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/application/application/RateLimiterRepositoryDefinitions.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/application/application/RateLimiterRepositoryDefinitions.scala index a6c5b3311c..2418f1873a 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/application/application/RateLimiterRepositoryDefinitions.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/application/application/RateLimiterRepositoryDefinitions.scala @@ -59,8 +59,7 @@ object RateLimiterRepositoryDefinitions { } def finalization[F[_]: Sync: JavaTime, Player: HasUuid]( - implicit config: Configuration, - persistence: BuildAmountRateLimitPersistence[F] + implicit persistence: BuildAmountRateLimitPersistence[F] ): RepositoryFinalization[F, Player, RateLimiter[F, BuildExpAmount]] = RepositoryFinalization.withoutAnyFinalization { case (p, rateLimiter) => diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/infrastructure/JdbcBuildAmountRateLimitPersistence.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/infrastructure/JdbcBuildAmountRateLimitPersistence.scala index 3f7f1d8046..b4b1a9fa75 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/infrastructure/JdbcBuildAmountRateLimitPersistence.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/infrastructure/JdbcBuildAmountRateLimitPersistence.scala @@ -1,7 +1,6 @@ package com.github.unchama.seichiassist.subsystems.buildcount.infrastructure import cats.effect.Sync -import com.github.unchama.seichiassist.subsystems.buildcount.application.Configuration import com.github.unchama.seichiassist.subsystems.buildcount.domain.BuildAmountRateLimiterSnapshot import com.github.unchama.seichiassist.subsystems.buildcount.domain.explevel.BuildExpAmount import com.github.unchama.seichiassist.subsystems.buildcount.domain.playerdata.BuildAmountRateLimitPersistence @@ -10,8 +9,7 @@ import scalikejdbc._ import java.util.UUID class JdbcBuildAmountRateLimitPersistence[SyncContext[_]]( - implicit SyncContext: Sync[SyncContext], - config: Configuration + implicit SyncContext: Sync[SyncContext] ) extends BuildAmountRateLimitPersistence[SyncContext] { override def read(key: UUID): SyncContext[Option[BuildAmountRateLimiterSnapshot]] = diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyBuildAmountThreshold.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyBuildAmountThreshold.scala index a2c53c7a15..948d5d9698 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyBuildAmountThreshold.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyBuildAmountThreshold.scala @@ -50,7 +50,7 @@ object BukkitNotifyBuildAmountThreshold { SendMessageEffect.sendMessageToEveryoneIgnoringPreference( s"$GOLD$BOLD$notificationMessage" )(forString[IO]) - SendSoundEffect.sendEverySound(Sound.ENTITY_ENDERDRAGON_DEATH, 1.0f, 1.2f) + SendSoundEffect.sendEverySound(Sound.ENTITY_ENDER_DRAGON_DEATH, 1.0f, 1.2f) } >> DiscordNotificationAPI[F].sendPlainText(notificationMessage) } else Sync[F].unit } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala index 69d165e8ee..0adf8a2168 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/buildcount/subsystems/notification/bukkit/actions/BukkitNotifyLevelUp.scala @@ -35,7 +35,7 @@ object BukkitNotifyLevelUp { Sync[F].delay { sendMessageToEveryoneIgnoringPreference(messageLevelMaxGlobal)(forString[IO]) player.sendMessage(messageLevelMaxPlayer) - sendEverySound(Sound.ENTITY_ENDERDRAGON_DEATH, 1.0f, 1.2f) + sendEverySound(Sound.ENTITY_ENDER_DRAGON_DEATH, 1.0f, 1.2f) } >> LaunchFireWorksEffect.launchFireWorks[F]( player.getLocation ) >> DiscordNotificationAPI[F].sendPlainText(messageLevelMaxDiscord) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/discordnotification/infrastructure/WebhookDiscordNotificationSender.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/discordnotification/infrastructure/WebhookDiscordNotificationSender.scala index cbe745cf0e..3d2fc8c7ae 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/discordnotification/infrastructure/WebhookDiscordNotificationSender.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/discordnotification/infrastructure/WebhookDiscordNotificationSender.scala @@ -24,14 +24,14 @@ class WebhookDiscordNotificationSender[F[_]: Sync: ContextShift] private (webhoo import io.circe.generic.auto._ import io.circe.syntax._ val markdownSafeMessage = message - .replaceAllLiterally("\\", "\\\\") - .replaceAllLiterally("_", "\\_") - .replaceAllLiterally("*", "\\*") - .replaceAllLiterally("`", "\\`") - .replaceAllLiterally("|", "\\|") - .replaceAllLiterally("@", "\\@") - .replaceAllLiterally("~", "\\~") - .replaceAllLiterally(":", "\\:") + .replace("\\", "\\\\") + .replace("_", "\\_") + .replace("*", "\\*") + .replace("`", "\\`") + .replace("|", "\\|") + .replace("@", "\\@") + .replace("~", "\\~") + .replace(":", "\\:") val json = WebhookDiscordNotificationSender.PlainMessage(markdownSafeMessage).asJson.noSpaces diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/donate/infrastructure/JdbcDonatePersistence.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/donate/infrastructure/JdbcDonatePersistence.scala index 01fa757d4e..f5a0d27e9a 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/donate/infrastructure/JdbcDonatePersistence.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/donate/infrastructure/JdbcDonatePersistence.scala @@ -65,7 +65,7 @@ class JdbcDonatePersistence[F[_]: Sync] extends DonatePersistence[F] { .map(rs => Obtained(DonatePremiumEffectPoint(rs.int("get_points")), rs.localDate("timestamp")) ) - .list + .list() .apply() .toVector } @@ -83,7 +83,7 @@ class JdbcDonatePersistence[F[_]: Sync] extends DonatePersistence[F] { ActiveSkillPremiumEffect.withName(rs.string("effect_name")) ) ) - .list + .list() .apply() .toVector } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala index 5cce9248f3..1776eee635 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/expbottlestack/bukkit/listeners/ExpBottleStackUsageController.scala @@ -46,7 +46,7 @@ class ExpBottleStackUsageController[F[_]: Effect, G[_]: SyncEffect]( if ( player.isSneaking && playerInventory.getItemInMainHand != null - && playerInventory.getItemInMainHand.getType == Material.EXP_BOTTLE + && playerInventory.getItemInMainHand.getType == Material.EXPERIENCE_BOTTLE && (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) ) { diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/System.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/System.scala index 7de4971007..47216e0e1f 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/System.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/System.scala @@ -76,7 +76,7 @@ object System { override val openPocketInventory: Kleisli[F, Player, Unit] = Kleisli { player => Sync[F].delay { // 開く音を再生 - player.playSound(player.getLocation, Sound.BLOCK_ENDERCHEST_OPEN, 1f, 0.1f) + player.playSound(player.getLocation, Sound.BLOCK_ENDER_CHEST_OPEN, 1f, 0.1f) } >> ContextCoercion { pocketInventoryRepositoryHandles.repository(player)._1.readLatest }.flatMap(inventory => interactInventory.open(inventory)(player)) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala index 94dd36e456..137752e861 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/fourdimensionalpocket/bukkit/listeners/OpenPocketInventoryOnPlacingEnderPortalFrame.scala @@ -22,7 +22,7 @@ class OpenPocketInventoryOnPlacingEnderPortalFrame[F[_]: Effect]( val action = event.getAction val hand = event.getHand - if (event.getMaterial != Material.ENDER_PORTAL_FRAME) { + if (event.getMaterial != Material.END_PORTAL_FRAME) { return } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/actions/BukkitDrawGacha.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/actions/BukkitDrawGacha.scala index 2d2f30ce14..4c96697757 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/actions/BukkitDrawGacha.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/bukkit/actions/BukkitDrawGacha.scala @@ -12,6 +12,7 @@ import com.github.unchama.seichiassist.subsystems.gachaprize.domain.GachaRarity. import com.github.unchama.seichiassist.subsystems.gachaprize.domain.gachaprize.GachaPrize import com.github.unchama.seichiassist.util.SendMessageEffect.sendMessageToEveryone import com.github.unchama.seichiassist.util._ +import net.md_5.bungee.api.chat.hover.content.Text import net.md_5.bungee.api.chat.{HoverEvent, TextComponent} import org.bukkit.ChatColor._ import org.bukkit.Sound @@ -55,7 +56,7 @@ class BukkitDrawGacha[F[_]: Sync: OnMinecraftServerThread]( val localizedEnchantmentList = prizeItem.getItemMeta.getEnchants.asScala.toSeq.map { case (enchantment, level) => - s"$GRAY${EnchantNameToJapanese.getEnchantName(enchantment.getName, level)}" + s"$GRAY${EnchantNameToJapanese.getEnchantName(enchantment.getKey.toString, level)}" } import scala.util.chaining._ @@ -68,13 +69,11 @@ class BukkitDrawGacha[F[_]: Sync: OnMinecraftServerThread]( setHoverEvent { new HoverEvent( HoverEvent.Action.SHOW_TEXT, - Array( - new TextComponent( - s" ${prizeItem.getItemMeta.getDisplayName}\n" + - ListFormatters.getDescFormat(localizedEnchantmentList.toList) + - ListFormatters - .getDescFormat(prizeItem.getItemMeta.getLore.asScala.toList) - ) + new Text( + s" ${prizeItem.getItemMeta.getDisplayName}\n" + + ListFormatters.getDescFormat(localizedEnchantmentList.toList) + + ListFormatters + .getDescFormat(prizeItem.getItemMeta.getLore.asScala.toList) ) ) } @@ -87,7 +86,7 @@ class BukkitDrawGacha[F[_]: Sync: OnMinecraftServerThread]( ) sendMessageToEveryone(message)(forTextComponent[IO]) SendSoundEffect.sendEverySoundWithoutIgnore( - Sound.ENTITY_ENDERDRAGON_DEATH, + Sound.ENTITY_ENDER_DRAGON_DEATH, 0.5f, 2f ) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/subsystems/gachaticket/infrastructure/JdbcGachaTicketFromAdminTeamRepository.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/subsystems/gachaticket/infrastructure/JdbcGachaTicketFromAdminTeamRepository.scala index c5a181a819..225eb30ec7 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/subsystems/gachaticket/infrastructure/JdbcGachaTicketFromAdminTeamRepository.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/gacha/subsystems/gachaticket/infrastructure/JdbcGachaTicketFromAdminTeamRepository.scala @@ -42,7 +42,7 @@ class JdbcGachaTicketFromAdminTeamRepository[F[_]: Sync: NonServerThreadContextS DB.localTx { implicit session => val affectedRows = sql"UPDATE playerdata SET numofsorryforbug = numofsorryforbug + ${amount.value} WHERE name = ${playerName.name}" - .update + .update() .apply() getReceiptResult(affectedRows) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/System.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/System.scala index d55099b213..5954366eb4 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/System.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/System.scala @@ -57,7 +57,7 @@ object System { val system: F[System[F]] = for { persistedGachaPrizes <- _gachaPersistence.list expBottle = GachaPrize( - new ItemStack(Material.EXP_BOTTLE, 20), + new ItemStack(Material.EXPERIENCE_BOTTLE, 20), GachaProbability(0.1), signOwner = false, GachaPrizeId(2), diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitGachaSkullData.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitGachaSkullData.scala index 816a4acda3..7537d2b7e5 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitGachaSkullData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitGachaSkullData.scala @@ -1,5 +1,7 @@ package com.github.unchama.seichiassist.subsystems.gachaprize.bukkit.factories +import com.github.unchama.itemstackbuilder.SkullItemStackBuilder +import com.github.unchama.seichiassist.SkullOwners import com.github.unchama.seichiassist.util.ItemMetaFactory import org.bukkit.ChatColor._ import org.bukkit.Material @@ -7,27 +9,22 @@ import org.bukkit.inventory.ItemStack object BukkitGachaSkullData { - import scala.jdk.CollectionConverters._ import scala.util.chaining._ /** * ノーマルガチャ券 */ val gachaSkull: ItemStack = - new ItemStack(Material.SKULL_ITEM, 1).tap { skull => + new ItemStack(Material.PLAYER_HEAD, 1).tap { skull => import skull._ setDurability(3) setItemMeta { - ItemMetaFactory.SKULL.getValue.tap { meta => - import meta._ - setDisplayName(s"$YELLOW${BOLD}ガチャ券") - setLore { - List(s"$RESET${GREEN}右クリックで使えます").asJava - } - - // 参加したことのないプレーヤーはgetOfflinePlayerでデータが取れないのでこうするしか無い - setOwner("unchama") - } + val meta = ItemMetaFactory.SKULL.getValue + new SkullItemStackBuilder(SkullOwners.unchama) + .title(s"$YELLOW${BOLD}ガチャ券") + .lore(List(s"$RESET${GREEN}右クリックで使えます")) + .transformItemMetaOnBuild(meta) + meta } } @@ -35,20 +32,16 @@ object BukkitGachaSkullData { * 投票報酬のガチャ券 */ val gachaForVoting: ItemStack = - new ItemStack(Material.SKULL_ITEM, 1).tap { itemStack => + new ItemStack(Material.PLAYER_HEAD, 1).tap { itemStack => import itemStack._ setDurability(3) setItemMeta { - ItemMetaFactory.SKULL.getValue.tap { meta => - import meta._ - setDisplayName(s"$YELLOW${BOLD}ガチャ券") - setLore { - List(s"$RESET${GREEN}右クリックで使えます", s"$RESET${LIGHT_PURPLE}投票ありがとナス♡").asJava - } - - // 参加したことのないプレーヤーはgetOfflinePlayerでデータが取れないのでこうするしか無い - setOwner("unchama") - } + val meta = ItemMetaFactory.SKULL.getValue + new SkullItemStackBuilder(SkullOwners.unchama) + .title(s"$YELLOW${BOLD}ガチャ券") + .lore(List(s"$RESET${GREEN}右クリックで使えます", s"$RESET${LIGHT_PURPLE}投票ありがとナス♡")) + .transformItemMetaOnBuild(meta) + meta } } @@ -56,20 +49,16 @@ object BukkitGachaSkullData { * ガチャ景品(当たり・大当たり)とガチャ券の交換システムで手に入るガチャ券 */ val gachaForExchanging: ItemStack = { - new ItemStack(Material.SKULL_ITEM, 1).tap { itemStack => + new ItemStack(Material.PLAYER_HEAD, 1).tap { itemStack => import itemStack._ setDurability(3) setItemMeta { - ItemMetaFactory.SKULL.getValue.tap { meta => - import meta._ - setDisplayName(s"$YELLOW${BOLD}ガチャ券") - setLore { - List(s"$RESET${GREEN}右クリックで使えます", s"$RESET${GRAY}ガチャ景品と交換しました。").asJava - } - - // 参加したことのないプレーヤーはgetOfflinePlayerでデータが取れないのでこうするしか無い - setOwner("unchama") - } + val meta = ItemMetaFactory.SKULL.getValue + new SkullItemStackBuilder(SkullOwners.unchama) + .title(s"$YELLOW${BOLD}ガチャ券") + .lore(List(s"$RESET${GREEN}右クリックで使えます", s"$RESET${GRAY}ガチャ景品と交換しました。")) + .transformItemMetaOnBuild(meta) + meta } } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitStaticGachaPrizeFactory.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitStaticGachaPrizeFactory.scala index c3cfb743ac..1ff80ddd69 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitStaticGachaPrizeFactory.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/gachaprize/bukkit/factories/BukkitStaticGachaPrizeFactory.scala @@ -29,7 +29,7 @@ object BukkitStaticGachaPrizeFactory extends StaticGachaPrizeFactory[ItemStack] } override val mineHeadItem: ItemStack = - new ItemStack(Material.CARROT_STICK, 1, 1.toShort).tap { itemStack => + new ItemStack(Material.CARROT_ON_A_STICK, 1, 1.toShort).tap { itemStack => import itemStack._ val meta = getItemMeta meta.setDisplayName(s"${DARK_RED}死神の鎌") diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/System.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/System.scala index 257ef27139..c9d19f80bb 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/System.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/System.scala @@ -4,7 +4,6 @@ import cats.effect.{ConcurrentEffect, ContextShift, IO, Sync, SyncEffect, SyncIO import com.github.unchama.datarepository.bukkit.player.BukkitRepositoryControls import com.github.unchama.datarepository.template.RepositoryDefinition import com.github.unchama.generic.ContextCoercion -import com.github.unchama.generic.effect.unsafe.EffectEnvironment import com.github.unchama.itemmigration.application.ItemMigrationStateRepositoryDefinitions import com.github.unchama.itemmigration.bukkit.controllers.player.PlayerItemMigrationController import com.github.unchama.itemmigration.service.ItemMigrationService @@ -33,8 +32,7 @@ object System { import cats.implicits._ def wired[F[_]: ConcurrentEffect: ContextShift, G[_]: SyncEffect: ContextCoercion[*[_], F]]( - implicit effectEnvironment: EffectEnvironment, - logger: Logger + implicit logger: Logger ): G[System[F]] = for { migrations <- Sync[G].delay { implicit val syncIOUuidRepository: UuidRepository[SyncIO] = diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/controllers/DatabaseMigrationController.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/controllers/DatabaseMigrationController.scala index db43855190..cc797a51fa 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/controllers/DatabaseMigrationController.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/controllers/DatabaseMigrationController.scala @@ -1,7 +1,6 @@ package com.github.unchama.seichiassist.subsystems.itemmigration.controllers import cats.effect.{Sync, SyncEffect, SyncIO} -import com.github.unchama.generic.effect.unsafe.EffectEnvironment import com.github.unchama.itemmigration.domain.ItemMigrations import com.github.unchama.itemmigration.service.ItemMigrationService import com.github.unchama.seichiassist.subsystems.itemmigration.infrastructure.loggers.PersistedItemsMigrationSlf4jLogger @@ -11,8 +10,7 @@ import org.slf4j.Logger import scalikejdbc.DB case class DatabaseMigrationController[F[_]: SyncEffect](migrations: ItemMigrations)( - implicit effectEnvironment: EffectEnvironment, - logger: Logger + implicit logger: Logger ) { lazy val runDatabaseMigration: F[Unit] = Sync[F].delay { diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/minecraft/JdbcBackedUuidRepository.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/minecraft/JdbcBackedUuidRepository.scala index fc00e4b536..5b37ca639d 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/minecraft/JdbcBackedUuidRepository.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/minecraft/JdbcBackedUuidRepository.scala @@ -3,7 +3,6 @@ package com.github.unchama.seichiassist.subsystems.itemmigration.infrastructure. import cats.Applicative import cats.effect.Sync import com.github.unchama.seichiassist.subsystems.itemmigration.domain.minecraft.UuidRepository -import org.slf4j.Logger import java.util.UUID @@ -44,9 +43,7 @@ object JdbcBackedUuidRepository { } } - def initializeInstanceIn[F[_]: Sync, G[_]: Applicative]( - implicit logger: Logger - ): F[UuidRepository[G]] = { + def initializeInstanceIn[F[_]: Sync, G[_]: Applicative]: F[UuidRepository[G]] = { import cats.implicits._ for { @@ -56,6 +53,6 @@ object JdbcBackedUuidRepository { } } - def initializeInstance[F[_]: Sync](implicit logger: Logger): F[UuidRepository[F]] = + def initializeInstance[F[_]: Sync](): F[UuidRepository[F]] = initializeInstanceIn[F, F] } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PersistedItemsMigrationVersionRepository.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PersistedItemsMigrationVersionRepository.scala index 70907fb507..fc5ad8f745 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PersistedItemsMigrationVersionRepository.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PersistedItemsMigrationVersionRepository.scala @@ -52,7 +52,7 @@ class PersistedItemsMigrationVersionRepository[F[_]](implicit dbSession: DBSessi sql""" select version_string from seichiassist.item_migration_on_database """.map { rs => rs.string("version_string") } - .list + .list() .apply() .flatMap(ItemMigrationVersionNumber.fromString) .toSet diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PlayerItemsMigrationVersionRepository.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PlayerItemsMigrationVersionRepository.scala index 4c1e273b18..6a1cd103ba 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PlayerItemsMigrationVersionRepository.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/PlayerItemsMigrationVersionRepository.scala @@ -33,7 +33,7 @@ class PlayerItemsMigrationVersionRepository[F[_]](serverId: String)(implicit F: select version_string from seichiassist.player_in_server_item_migration where server_id = $serverId and player_uuid = ${target.player.getUniqueId.toString} """.map { rs => rs.string("version_string") } - .list + .list() .apply() .flatMap(ItemMigrationVersionNumber.fromString) .toSet diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/WorldLevelItemsMigrationVersionRepository.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/WorldLevelItemsMigrationVersionRepository.scala index d925e4c87a..37fcdbdd77 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/WorldLevelItemsMigrationVersionRepository.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/infrastructure/repositories/WorldLevelItemsMigrationVersionRepository.scala @@ -32,7 +32,7 @@ class WorldLevelItemsMigrationVersionRepository[F[_]](serverId: String)(implicit sql""" select version_string from seichiassist.item_migration_in_server_world_levels where server_id = $serverId """.map { rs => rs.string("version_string") } - .list + .list() .apply() .flatMap(ItemMigrationVersionNumber.fromString) .toSet diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/migrations/V1_0_0_MigrateMebiusToNewCodec.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/migrations/V1_0_0_MigrateMebiusToNewCodec.scala index c58bcd791a..38b3b37b9c 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/migrations/V1_0_0_MigrateMebiusToNewCodec.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/itemmigration/migrations/V1_0_0_MigrateMebiusToNewCodec.scala @@ -6,7 +6,7 @@ import com.github.unchama.itemmigration.domain.{ItemMigration, ItemMigrationVers import com.github.unchama.seichiassist.subsystems.itemmigration.domain.minecraft.UuidRepository import com.github.unchama.seichiassist.subsystems.itemmigration.migrations.V1_0_0_MigrateMebiusToNewCodec.OldBukkitMebiusItemStackCodec.OldMebiusRawProperty import com.github.unchama.seichiassist.subsystems.mebius.bukkit.codec.BukkitMebiusItemStackCodec.NBTTagConstants -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.Material import org.bukkit.inventory.ItemStack @@ -24,7 +24,6 @@ object V1_0_0_MigrateMebiusToNewCodec { // noinspection DuplicatedCode object OldBukkitMebiusItemStackCodec { - import de.tr7zw.itemnbtapi.NBTItem import org.bukkit.inventory.ItemStack private val mebiusLoreHead = diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/managedfly/bukkit/BukkitPlayerFlyStatusManipulation.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/managedfly/bukkit/BukkitPlayerFlyStatusManipulation.scala index 83a5187dd1..ad0e267909 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/managedfly/bukkit/BukkitPlayerFlyStatusManipulation.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/managedfly/bukkit/BukkitPlayerFlyStatusManipulation.scala @@ -92,7 +92,7 @@ class BukkitPlayerFlyStatusManipulation[AsyncContext[ private val sendMessages: List[String] => Kleisli[AsyncContext, Player, Unit] = { messages => Kleisli { player => Sync[AsyncContext].delay { - player.sendMessage(messages.toArray) + player.sendMessage(messages.mkString("\n")) } } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusAppearanceMaterialCodec.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusAppearanceMaterialCodec.scala index 937eb6606a..69e71cfff5 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusAppearanceMaterialCodec.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusAppearanceMaterialCodec.scala @@ -7,7 +7,7 @@ object BukkitMebiusAppearanceMaterialCodec { private val appearanceThresholds = List( 1 -> Material.LEATHER_HELMET, - 5 -> Material.GOLD_HELMET, + 5 -> Material.GOLDEN_HELMET, 10 -> Material.CHAINMAIL_HELMET, 20 -> Material.IRON_HELMET, 25 -> Material.DIAMOND_HELMET diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusItemStackCodec.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusItemStackCodec.scala index 226a5afa8e..e0295419e8 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusItemStackCodec.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/codec/BukkitMebiusItemStackCodec.scala @@ -3,7 +3,7 @@ package com.github.unchama.seichiassist.subsystems.mebius.bukkit.codec import com.github.unchama.seichiassist.subsystems.mebius.domain.property._ import com.github.unchama.seichiassist.subsystems.mebius.domain.resources.MebiusTalks import com.github.unchama.seichiassist.subsystems.seasonalevents.christmas.ChristmasItemData -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.Material import org.bukkit.entity.Player @@ -119,19 +119,19 @@ object BukkitMebiusItemStackCodec { * * を満足する。 */ - def materialize(property: MebiusProperty, damageValue: Short): ItemStack = { + def materialize(property: MebiusProperty): ItemStack = { val material = property.forcedMaterial match { case MebiusForcedMaterial.None => BukkitMebiusAppearanceMaterialCodec.appearanceMaterialAt(property.level) case MebiusForcedMaterial.Leather => Material.LEATHER_HELMET // 革のヘルメット case MebiusForcedMaterial.Iron => Material.IRON_HELMET // 鉄のヘルメット case MebiusForcedMaterial.Chain => Material.CHAINMAIL_HELMET // チェーンのヘルメット - case MebiusForcedMaterial.Gold => Material.GOLD_HELMET // 金のヘルメット + case MebiusForcedMaterial.Gold => Material.GOLDEN_HELMET // 金のヘルメット } import scala.util.chaining._ - val item = new ItemStack(material, 1, damageValue) + val item = new ItemStack(material, 1) item.setItemMeta { item.getItemMeta.tap { meta => diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/command/MebiusCommandExecutorProvider.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/command/MebiusCommandExecutorProvider.scala index 9fad985635..577b35e006 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/command/MebiusCommandExecutorProvider.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/command/MebiusCommandExecutorProvider.scala @@ -63,8 +63,7 @@ class MebiusCommandExecutorProvider( SequentialEffect( UnfocusedEffect { player.getInventory.setHelmet { - BukkitMebiusItemStackCodec - .materialize(newProperty, damageValue = helmet.getDurability) + BukkitMebiusItemStackCodec.materialize(newProperty) } }, additionalEffectsOnModification(newProperty) @@ -121,7 +120,7 @@ class MebiusCommandExecutorProvider( if (property.level.isMaximum) { val newProperty = property.toggleForcedMaterial val newItem = - BukkitMebiusItemStackCodec.materialize(newProperty, mainHand.getDurability) + BukkitMebiusItemStackCodec.materialize(newProperty) val newMaterialName = newProperty.forcedMaterial match { case MebiusForcedMaterial.None => "ダイヤモンド" diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/gateway/BukkitMebiusSpeechGateway.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/gateway/BukkitMebiusSpeechGateway.scala index 8298ce99c5..778a3562d8 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/gateway/BukkitMebiusSpeechGateway.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/gateway/BukkitMebiusSpeechGateway.scala @@ -44,13 +44,13 @@ class BukkitMebiusSpeechGateway(player: Player)(implicit timer: Timer[IO]) val effect = strength match { case MebiusSpeechStrength.Medium => playSoundsInSequence( - RepeatedEffect(3)(FocusedSoundEffect(Sound.BLOCK_NOTE_HARP, 2.0f, 1.0f)), - RepeatedEffect(3)(FocusedSoundEffect(Sound.BLOCK_NOTE_HARP, 2.0f, 1.5f)) + RepeatedEffect(3)(FocusedSoundEffect(Sound.BLOCK_NOTE_BLOCK_HARP, 2.0f, 1.0f)), + RepeatedEffect(3)(FocusedSoundEffect(Sound.BLOCK_NOTE_BLOCK_HARP, 2.0f, 1.5f)) ) case MebiusSpeechStrength.Loud => playSoundsInSequence( - RepeatedEffect(5)(FocusedSoundEffect(Sound.BLOCK_NOTE_HARP, 2.0f, 1.5f)), - RepeatedEffect(5)(FocusedSoundEffect(Sound.BLOCK_NOTE_HARP, 2.0f, 2.0f)) + RepeatedEffect(5)(FocusedSoundEffect(Sound.BLOCK_NOTE_BLOCK_HARP, 2.0f, 1.5f)), + RepeatedEffect(5)(FocusedSoundEffect(Sound.BLOCK_NOTE_BLOCK_HARP, 2.0f, 2.0f)) ) } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala index 37b7facbca..6faf7eccae 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusDropTrialListener.scala @@ -51,7 +51,7 @@ class MebiusDropTrialListener[G[_]: ChristmasEventsAPI: RandomEffect: SyncEffect ) val mebius = - BukkitMebiusItemStackCodec.materialize(droppedMebiusProperty, damageValue = 0.toShort) + BukkitMebiusItemStackCodec.materialize(droppedMebiusProperty) player.sendMessage(s"$RESET$YELLOW${BOLD}おめでとうございます。採掘中にMEBIUSを発見しました。") player.sendMessage(s"$RESET$YELLOW${BOLD}MEBIUSはプレイヤーと共に成長するヘルメットです。") diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala index 1fdff31a1e..5bb0ad78db 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusInteractionResponder.scala @@ -21,6 +21,7 @@ import org.bukkit.event.block.BlockBreakEvent import org.bukkit.event.entity.{EntityDamageByEntityEvent, EntityDeathEvent} import org.bukkit.event.player.PlayerItemBreakEvent import org.bukkit.event.{EventHandler, EventPriority, Listener} +import org.bukkit.inventory.meta.Damageable class MebiusInteractionResponder( implicit serviceRepository: PlayerDataRepository[MebiusSpeechService[SyncIO]], @@ -40,32 +41,37 @@ class MebiusInteractionResponder( val speechService = serviceRepository(player) - val messageProgram = if (helmet.getDurability >= helmet.getType.getMaxDurability - 10) { - MebiusMessages.onDamageBreaking.pickOne[SyncIO].flatMap { message => - // 耐久閾値を超えていたら破損警告 - speechService.tryMakingSpeech( - mebiusProperty, - MebiusSpeech( - message.interpolate(mebiusProperty.ownerNickname), - MebiusSpeechStrength.Medium + val messageProgram = + if ( + helmet.getItemMeta.asInstanceOf[Damageable].getDamage >= helmet + .getType + .getMaxDurability - 10 + ) { + MebiusMessages.onDamageBreaking.pickOne[SyncIO].flatMap { message => + // 耐久閾値を超えていたら破損警告 + speechService.tryMakingSpeech( + mebiusProperty, + MebiusSpeech( + message.interpolate(mebiusProperty.ownerNickname), + MebiusSpeechStrength.Medium + ) ) - ) - } - } else - event.getDamager match { - case monster: Monster => - // モンスターからダメージを受けた場合の対モンスターメッセージ - MebiusMessages.onDamageWarnEnemy.pickOne[SyncIO].flatMap { message => - speechService.tryMakingSpeech( - mebiusProperty, - MebiusSpeech( - message.interpolate(mebiusProperty.ownerNickname, monster.getName), - MebiusSpeechStrength.Medium + } + } else + event.getDamager match { + case monster: Monster => + // モンスターからダメージを受けた場合の対モンスターメッセージ + MebiusMessages.onDamageWarnEnemy.pickOne[SyncIO].flatMap { message => + speechService.tryMakingSpeech( + mebiusProperty, + MebiusSpeech( + message.interpolate(mebiusProperty.ownerNickname, monster.getName), + MebiusSpeechStrength.Medium + ) ) - ) - } - case _ => SyncIO.unit - } + } + case _ => SyncIO.unit + } messageProgram.unsafeRunSync() case _ => @@ -98,7 +104,7 @@ class MebiusInteractionResponder( MessageEffect( s"${BukkitMebiusItemStackCodec.displayNameOfMaterializedItem(property)}${RESET}が旅立ちました。" ), - FocusedSoundEffect(Sound.ENTITY_ENDERDRAGON_DEATH, 1.0f, 0.1f) + FocusedSoundEffect(Sound.ENTITY_ENDER_DRAGON_DEATH, 1.0f, 0.1f) ).run(player) } ) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala index 1505585cb9..3dd1de4d2f 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/mebius/bukkit/listeners/MebiusLevelUpTrialListener.scala @@ -39,7 +39,7 @@ class MebiusLevelUpTrialListener( if (newMebiusProperty != oldMebiusProperty) { player.getInventory.setHelmet { - BukkitMebiusItemStackCodec.materialize(newMebiusProperty, damageValue = 0) + BukkitMebiusItemStackCodec.materialize(newMebiusProperty) } import cats.implicits._ diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/BukkitMineStackObjectList.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/BukkitMineStackObjectList.scala index 7350665717..0ba0870723 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/BukkitMineStackObjectList.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/BukkitMineStackObjectList.scala @@ -38,14 +38,14 @@ class BukkitMineStackObjectList[F[_]: Sync]( MineStackObjectByMaterial(ORES, "iron_ore", "鉄鉱石", Material.IRON_ORE, 0), MineStackObjectByMaterial(ORES, "iron_ingot", "鉄インゴット", Material.IRON_INGOT, 0), MineStackObjectByMaterial(ORES, "iron_block", "鉄ブロック", Material.IRON_BLOCK, 0), - MineStackObjectByMaterial(ORES, "quartz_ore", "ネザー水晶鉱石", Material.QUARTZ_ORE, 0), + MineStackObjectByMaterial(ORES, "quartz_ore", "ネザー水晶鉱石", Material.NETHER_QUARTZ_ORE, 0), MineStackObjectByMaterial(ORES, "quartz", "ネザー水晶", Material.QUARTZ, 0), MineStackObjectByMaterial(ORES, "gold_ore", "金鉱石", Material.GOLD_ORE, 0), MineStackObjectByMaterial(ORES, "gold_ingot", "金インゴット", Material.GOLD_INGOT, 0), MineStackObjectByMaterial(ORES, "gold_block", "金ブロック", Material.GOLD_BLOCK, 0), MineStackObjectByMaterial(ORES, "redstone_ore", "レッドストーン鉱石", Material.REDSTONE_ORE, 0), MineStackObjectByMaterial(ORES, "lapis_ore", "ラピスラズリ鉱石", Material.LAPIS_ORE, 0), - MineStackObjectByMaterial(ORES, "lapis_lazuli", "ラピスラズリ", Material.INK_SACK, 4), + MineStackObjectByMaterial(ORES, "lapis_lazuli", "ラピスラズリ", Material.LAPIS_LAZULI, 4), MineStackObjectByMaterial(ORES, "lapis_block", "ラピスラズリブロック", Material.LAPIS_BLOCK, 0), MineStackObjectByMaterial(ORES, "diamond_ore", "ダイヤモンド鉱石", Material.DIAMOND_ORE, 0), MineStackObjectByMaterial(ORES, "diamond", "ダイヤモンド", Material.DIAMOND, 0), @@ -56,20 +56,20 @@ class BukkitMineStackObjectList[F[_]: Sync]( ) // モンスター+動物ドロップ - private val minestacklistdrop: List[Either[MineStackObject[ItemStack], MineStackObjectWithColorVariants[ItemStack]]] = leftElems( + private val minestacklistdrop: List[MineStackObjectGroup[ItemStack]] = leftElems( MineStackObjectByMaterial(MOB_DROP, "ender_pearl", "エンダーパール", Material.ENDER_PEARL, 0), - MineStackObjectByMaterial(MOB_DROP, "ender_eye", "エンダーアイ", Material.EYE_OF_ENDER, 0), + MineStackObjectByMaterial(MOB_DROP, "ender_eye", "エンダーアイ", Material.ENDER_EYE, 0), MineStackObjectByMaterial(MOB_DROP, "slime_ball", "スライムボール", Material.SLIME_BALL, 0), MineStackObjectByMaterial(MOB_DROP, "slime", "スライムブロック", Material.SLIME_BLOCK, 0), MineStackObjectByMaterial(MOB_DROP, "rotten_flesh", "腐った肉", Material.ROTTEN_FLESH, 0), MineStackObjectByMaterial(MOB_DROP, "bone", "骨", Material.BONE, 0), - MineStackObjectByMaterial(MOB_DROP, "sulphur", "火薬", Material.SULPHUR, 0), + MineStackObjectByMaterial(MOB_DROP, "sulphur", "火薬", Material.GUNPOWDER, 0), MineStackObjectByMaterial(MOB_DROP, "arrow", "矢", Material.ARROW, 0), MineStackObjectByMaterial(MOB_DROP, "tipped_arrow", "鈍化の矢", Material.TIPPED_ARROW, 0), MineStackObjectByMaterial(MOB_DROP, "spider_eye", "蜘蛛の目", Material.SPIDER_EYE, 0), MineStackObjectByMaterial(MOB_DROP, "string", "糸", Material.STRING, 0), MineStackObjectByMaterial(MOB_DROP, "name_tag", "名札", Material.NAME_TAG, 0), - MineStackObjectByMaterial(MOB_DROP, "lead", "リード", Material.LEASH, 0), + MineStackObjectByMaterial(MOB_DROP, "lead", "リード", Material.LEAD, 0), MineStackObjectByMaterial(MOB_DROP, "glass_bottle", "ガラス瓶", Material.GLASS_BOTTLE, 0), MineStackObjectByMaterial(MOB_DROP, "gold_nugget", "金塊", Material.GOLD_NUGGET, 0), MineStackObjectByMaterial(MOB_DROP, "blaze_rod", "ブレイズロッド", Material.BLAZE_ROD, 0), @@ -84,93 +84,93 @@ class BukkitMineStackObjectList[F[_]: Sync]( MineStackObjectByMaterial(MOB_DROP, "rabbit_foot", "ウサギの足", Material.RABBIT_FOOT, 0), MineStackObjectByMaterial(MOB_DROP, "dragon_egg", "エンドラの卵", Material.DRAGON_EGG, 0), MineStackObjectByMaterial(MOB_DROP, "shulker_shell", "シュルカーの殻", Material.SHULKER_SHELL, 0), - MineStackObjectByMaterial(MOB_DROP, "totem_of_undying", "不死のトーテム", Material.TOTEM, 0), - MineStackObjectByMaterial(MOB_DROP, "dragon_head", "エンダードラゴンの頭", Material.SKULL_ITEM, 5), - MineStackObjectByMaterial(MOB_DROP, "wither_skeleton_skull", "ウィザースケルトンの頭", Material.SKULL_ITEM, 1), + MineStackObjectByMaterial(MOB_DROP, "totem_of_undying", "不死のトーテム", Material.TOTEM_OF_UNDYING, 0), + MineStackObjectByMaterial(MOB_DROP, "dragon_head", "エンダードラゴンの頭", Material.DRAGON_HEAD, 5), + MineStackObjectByMaterial(MOB_DROP, "wither_skeleton_skull", "ウィザースケルトンの頭", Material.WITHER_SKELETON_SKULL, 1), MineStackObjectByMaterial(MOB_DROP, "stick", "棒", Material.STICK, 0) ) // 採掘で入手可能な農業系ブロック private val minestacklistfarm: List[MineStackObjectGroup[ItemStack]] = leftElems( - MineStackObjectByMaterial(AGRICULTURAL, "seeds", "種", Material.SEEDS, 0), + MineStackObjectByMaterial(AGRICULTURAL, "seeds", "種", Material.WHEAT_SEEDS, 0), MineStackObjectByMaterial(AGRICULTURAL, "apple", "リンゴ", Material.APPLE, 0), - MineStackObjectByMaterial(AGRICULTURAL, "long_grass1", "草", Material.LONG_GRASS, 1), - MineStackObjectByMaterial(AGRICULTURAL, "long_grass2", "シダ", Material.LONG_GRASS, 2), + MineStackObjectByMaterial(AGRICULTURAL, "long_grass1", "草", Material.GRASS, 1), + MineStackObjectByMaterial(AGRICULTURAL, "long_grass2", "シダ", Material.FERN, 2), MineStackObjectByMaterial(AGRICULTURAL, "dead_bush", "枯れ木", Material.DEAD_BUSH, 0), MineStackObjectByMaterial(AGRICULTURAL, "cactus", "サボテン", Material.CACTUS, 0), MineStackObjectByMaterial(AGRICULTURAL, "vine", "ツタ", Material.VINE, 0), - MineStackObjectByMaterial(AGRICULTURAL, "water_lily", "スイレンの葉", Material.WATER_LILY, 0), - MineStackObjectByMaterial(AGRICULTURAL, "yellow_flower", "タンポポ", Material.YELLOW_FLOWER, 0), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose0", "ポピー", Material.RED_ROSE, 0), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose1", "ヒスイラン", Material.RED_ROSE, 1), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose2", "アリウム", Material.RED_ROSE, 2), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose3", "ヒナソウ", Material.RED_ROSE, 3), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose4", "赤色のチューリップ", Material.RED_ROSE, 4), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose5", "橙色のチューリップ", Material.RED_ROSE, 5), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose6", "白色のチューリップ", Material.RED_ROSE, 6), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose7", "桃色のチューリップ", Material.RED_ROSE, 7), - MineStackObjectByMaterial(AGRICULTURAL, "red_rose8", "フランスギク", Material.RED_ROSE, 8), - MineStackObjectByMaterial(AGRICULTURAL, "leaves", "オークの葉", Material.LEAVES, 0), - MineStackObjectByMaterial(AGRICULTURAL, "leaves1", "マツの葉", Material.LEAVES, 1), - MineStackObjectByMaterial(AGRICULTURAL, "leaves2", "シラカバの葉", Material.LEAVES, 2), - MineStackObjectByMaterial(AGRICULTURAL, "leaves3", "ジャングルの葉", Material.LEAVES, 3), - MineStackObjectByMaterial(AGRICULTURAL, "leaves_2", "アカシアの葉", Material.LEAVES_2, 0), - MineStackObjectByMaterial(AGRICULTURAL, "leaves_21", "ダークオークの葉", Material.LEAVES_2, 1), - MineStackObjectByMaterial(AGRICULTURAL, "double_plant0", "ヒマワリ", Material.DOUBLE_PLANT, 0), - MineStackObjectByMaterial(AGRICULTURAL, "double_plant1", "ライラック", Material.DOUBLE_PLANT, 1), - MineStackObjectByMaterial(AGRICULTURAL, "double_plant2", "高い草", Material.DOUBLE_PLANT, 2), - MineStackObjectByMaterial(AGRICULTURAL, "double_plant3", "大きなシダ", Material.DOUBLE_PLANT, 3), - MineStackObjectByMaterial(AGRICULTURAL, "double_plant4", "バラの低木", Material.DOUBLE_PLANT, 4), - MineStackObjectByMaterial(AGRICULTURAL, "double_plant5", "ボタン", Material.DOUBLE_PLANT, 5), + MineStackObjectByMaterial(AGRICULTURAL, "water_lily", "スイレンの葉", Material.LILY_PAD, 0), + MineStackObjectByMaterial(AGRICULTURAL, "yellow_flower", "タンポポ", Material.DANDELION, 0), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose0", "ポピー", Material.POPPY, 0), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose1", "ヒスイラン", Material.BLUE_ORCHID, 1), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose2", "アリウム", Material.ALLIUM, 2), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose3", "ヒナソウ", Material.AZURE_BLUET, 3), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose4", "赤色のチューリップ", Material.RED_TULIP, 4), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose5", "橙色のチューリップ", Material.ORANGE_TULIP, 5), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose6", "白色のチューリップ", Material.WHITE_TULIP, 6), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose7", "桃色のチューリップ", Material.PINK_TULIP, 7), + MineStackObjectByMaterial(AGRICULTURAL, "red_rose8", "フランスギク", Material.OXEYE_DAISY, 8), + MineStackObjectByMaterial(AGRICULTURAL, "leaves", "オークの葉", Material.OAK_LEAVES, 0), + MineStackObjectByMaterial(AGRICULTURAL, "leaves1", "マツの葉", Material.SPRUCE_LEAVES, 1), + MineStackObjectByMaterial(AGRICULTURAL, "leaves2", "シラカバの葉", Material.BIRCH_LEAVES, 2), + MineStackObjectByMaterial(AGRICULTURAL, "leaves3", "ジャングルの葉", Material.JUNGLE_LEAVES, 3), + MineStackObjectByMaterial(AGRICULTURAL, "leaves_2", "アカシアの葉", Material.ACACIA_LEAVES, 0), + MineStackObjectByMaterial(AGRICULTURAL, "leaves_21", "ダークオークの葉", Material.DARK_OAK_LEAVES, 1), + MineStackObjectByMaterial(AGRICULTURAL, "double_plant0", "ヒマワリ", Material.SUNFLOWER, 0), + MineStackObjectByMaterial(AGRICULTURAL, "double_plant1", "ライラック", Material.LILAC, 1), + MineStackObjectByMaterial(AGRICULTURAL, "double_plant2", "高い草", Material.TALL_GRASS, 2), + MineStackObjectByMaterial(AGRICULTURAL, "double_plant3", "大きなシダ", Material.LARGE_FERN, 3), + MineStackObjectByMaterial(AGRICULTURAL, "double_plant4", "バラの低木", Material.ROSE_BUSH, 4), + MineStackObjectByMaterial(AGRICULTURAL, "double_plant5", "ボタン", Material.PEONY, 5), MineStackObjectByMaterial(AGRICULTURAL, "sugar_cane", "サトウキビ", Material.SUGAR_CANE, 0), MineStackObjectByMaterial(AGRICULTURAL, "pumpkin", "カボチャ", Material.PUMPKIN, 0), - MineStackObjectByMaterial(AGRICULTURAL, "ink_sack3", "カカオ豆", Material.INK_SACK, 3), - MineStackObjectByMaterial(AGRICULTURAL, "huge_mushroom_1", "キノコ", Material.HUGE_MUSHROOM_1, 0), - MineStackObjectByMaterial(AGRICULTURAL, "huge_mushroom_2", "キノコ", Material.HUGE_MUSHROOM_2, 0), + MineStackObjectByMaterial(AGRICULTURAL, "ink_sack3", "カカオ豆", Material.COCOA_BEANS, 3), + MineStackObjectByMaterial(AGRICULTURAL, "huge_mushroom_1", "キノコ", Material.BROWN_MUSHROOM, 0), + MineStackObjectByMaterial(AGRICULTURAL, "huge_mushroom_2", "キノコ", Material.RED_MUSHROOM, 0), MineStackObjectByMaterial(AGRICULTURAL, "melon", "スイカ", Material.MELON, 0), - MineStackObjectByMaterial(AGRICULTURAL, "melon_block", "スイカ", Material.MELON_BLOCK, 0), + MineStackObjectByMaterial(AGRICULTURAL, "melon_block", "スイカ", Material.MELON, 0), MineStackObjectByMaterial(AGRICULTURAL, "brown_mushroom", "キノコ", Material.BROWN_MUSHROOM, 0), MineStackObjectByMaterial(AGRICULTURAL, "red_mushroom", "キノコ", Material.RED_MUSHROOM, 0), - MineStackObjectByMaterial(AGRICULTURAL, "sapling", "オークの苗木", Material.SAPLING, 0), - MineStackObjectByMaterial(AGRICULTURAL, "sapling1", "マツの苗木", Material.SAPLING, 1), - MineStackObjectByMaterial(AGRICULTURAL, "sapling2", "シラカバの苗木", Material.SAPLING, 2), - MineStackObjectByMaterial(AGRICULTURAL, "sapling3", "ジャングルの苗木", Material.SAPLING, 3), - MineStackObjectByMaterial(AGRICULTURAL, "sapling4", "アカシアの苗木", Material.SAPLING, 4), - MineStackObjectByMaterial(AGRICULTURAL, "sapling5", "ダークオークの苗木", Material.SAPLING, 5), + MineStackObjectByMaterial(AGRICULTURAL, "sapling", "オークの苗木", Material.OAK_SAPLING, 0), + MineStackObjectByMaterial(AGRICULTURAL, "sapling1", "マツの苗木", Material.SPRUCE_SAPLING, 1), + MineStackObjectByMaterial(AGRICULTURAL, "sapling2", "シラカバの苗木", Material.BIRCH_SAPLING, 2), + MineStackObjectByMaterial(AGRICULTURAL, "sapling3", "ジャングルの苗木", Material.JUNGLE_SAPLING, 3), + MineStackObjectByMaterial(AGRICULTURAL, "sapling4", "アカシアの苗木", Material.ACACIA_SAPLING, 4), + MineStackObjectByMaterial(AGRICULTURAL, "sapling5", "ダークオークの苗木", Material.DARK_OAK_SAPLING, 5), MineStackObjectByMaterial(AGRICULTURAL, "beetroot", "ビートルート", Material.BEETROOT, 0), MineStackObjectByMaterial(AGRICULTURAL, "beetroot_seeds", "ビートルートの種", Material.BEETROOT_SEEDS, 0), - MineStackObjectByMaterial(AGRICULTURAL, "carrot_item", "ニンジン", Material.CARROT_ITEM, 0), - MineStackObjectByMaterial(AGRICULTURAL, "potato_item", "ジャガイモ", Material.POTATO_ITEM, 0), + MineStackObjectByMaterial(AGRICULTURAL, "carrot_item", "ニンジン", Material.CARROT, 0), + MineStackObjectByMaterial(AGRICULTURAL, "potato_item", "ジャガイモ", Material.POTATO, 0), MineStackObjectByMaterial(AGRICULTURAL, "poisonous_potato", "青くなったジャガイモ", Material.POISONOUS_POTATO, 0), MineStackObjectByMaterial(AGRICULTURAL, "wheat", "小麦", Material.WHEAT, 0), MineStackObjectByMaterial(AGRICULTURAL, "pumpkin_seeds", "カボチャの種", Material.PUMPKIN_SEEDS, 0), MineStackObjectByMaterial(AGRICULTURAL, "melon_seeds", "スイカの種", Material.MELON_SEEDS, 0), - MineStackObjectByMaterial(AGRICULTURAL, "nether_stalk", "ネザーウォート", Material.NETHER_STALK, 0), + MineStackObjectByMaterial(AGRICULTURAL, "nether_stalk", "ネザーウォート", Material.NETHER_WART, 0), MineStackObjectByMaterial(AGRICULTURAL, "chorus_fruit", "コーラスフルーツ", Material.CHORUS_FRUIT, 0), MineStackObjectByMaterial(AGRICULTURAL, "chorus_flower", "コーラスフラワー", Material.CHORUS_FLOWER, 0), - MineStackObjectByMaterial(AGRICULTURAL, "popped_chorus_fruit", "焼いたコーラスフルーツ", Material.CHORUS_FRUIT_POPPED, 0), + MineStackObjectByMaterial(AGRICULTURAL, "popped_chorus_fruit", "焼いたコーラスフルーツ", Material.POPPED_CHORUS_FRUIT, 0), MineStackObjectByMaterial(AGRICULTURAL, "egg", "卵", Material.EGG, 0), - MineStackObjectByMaterial(AGRICULTURAL, "pork", "生の豚肉", Material.PORK, 0), - MineStackObjectByMaterial(AGRICULTURAL, "cooked_porkchop", "焼き豚", Material.GRILLED_PORK, 0), - MineStackObjectByMaterial(AGRICULTURAL, "raw_chicken", "生の鶏肉", Material.RAW_CHICKEN, 0), + MineStackObjectByMaterial(AGRICULTURAL, "pork", "生の豚肉", Material.PORKCHOP, 0), + MineStackObjectByMaterial(AGRICULTURAL, "cooked_porkchop", "焼き豚", Material.COOKED_PORKCHOP, 0), + MineStackObjectByMaterial(AGRICULTURAL, "raw_chicken", "生の鶏肉", Material.CHICKEN, 0), MineStackObjectByMaterial(AGRICULTURAL, "cooked_chicken", "焼き鳥", Material.COOKED_CHICKEN, 0), MineStackObjectByMaterial(AGRICULTURAL, "mutton", "生の羊肉", Material.MUTTON, 0), MineStackObjectByMaterial(AGRICULTURAL, "cooked_mutton", "焼いた羊肉", Material.COOKED_MUTTON, 0), - MineStackObjectByMaterial(AGRICULTURAL, "raw_beef", "生の牛肉", Material.RAW_BEEF, 0), + MineStackObjectByMaterial(AGRICULTURAL, "raw_beef", "生の牛肉", Material.BEEF, 0), MineStackObjectByMaterial(AGRICULTURAL, "cooked_beaf", "ステーキ", Material.COOKED_BEEF, 0), MineStackObjectByMaterial(AGRICULTURAL, "rabbit", "生の兎肉", Material.RABBIT, 0), MineStackObjectByMaterial(AGRICULTURAL, "cooked_rabbit", "焼き兎肉", Material.COOKED_RABBIT, 0), - MineStackObjectByMaterial(AGRICULTURAL, "raw_fish0", "生魚", Material.RAW_FISH, 0), - MineStackObjectByMaterial(AGRICULTURAL, "cooked_fish0", "焼き魚", Material.COOKED_FISH, 0), - MineStackObjectByMaterial(AGRICULTURAL, "raw_fish1", "生鮭", Material.RAW_FISH, 1), - MineStackObjectByMaterial(AGRICULTURAL, "cooked_fish1", "焼き鮭", Material.COOKED_FISH, 1), - MineStackObjectByMaterial(AGRICULTURAL, "raw_fish2", "クマノミ", Material.RAW_FISH, 2), - MineStackObjectByMaterial(AGRICULTURAL, "raw_fish3", "フグ", Material.RAW_FISH, 3), + MineStackObjectByMaterial(AGRICULTURAL, "raw_fish0", "生魚", Material.COD, 0), + MineStackObjectByMaterial(AGRICULTURAL, "cooked_fish0", "焼き魚", Material.COOKED_COD, 0), + MineStackObjectByMaterial(AGRICULTURAL, "raw_fish1", "生鮭", Material.SALMON, 1), + MineStackObjectByMaterial(AGRICULTURAL, "cooked_fish1", "焼き鮭", Material.COOKED_SALMON, 1), + MineStackObjectByMaterial(AGRICULTURAL, "raw_fish2", "クマノミ", Material.TROPICAL_FISH, 2), + MineStackObjectByMaterial(AGRICULTURAL, "raw_fish3", "フグ", Material.PUFFERFISH, 3), MineStackObjectByMaterial(AGRICULTURAL, "bread", "パン", Material.BREAD, 0), MineStackObjectByMaterial(AGRICULTURAL, "sugar", "砂糖", Material.SUGAR, 0), MineStackObjectByMaterial(AGRICULTURAL, "baked_potato", "ベイクドポテト", Material.BAKED_POTATO, 0), MineStackObjectByMaterial(AGRICULTURAL, "cake", "ケーキ", Material.CAKE, 0), - MineStackObjectByMaterial(AGRICULTURAL, "mushroom_stew", "キノコシチュー", Material.MUSHROOM_SOUP, 0), + MineStackObjectByMaterial(AGRICULTURAL, "mushroom_stew", "キノコシチュー", Material.MUSHROOM_STEW, 0), MineStackObjectByMaterial(AGRICULTURAL, "rabbit_stew", "ウサギシチュー", Material.RABBIT_STEW, 0), MineStackObjectByMaterial(AGRICULTURAL, "beetroot_soup", "ビートルートスープ", Material.BEETROOT_SOUP, 0), MineStackObjectByMaterial(AGRICULTURAL, "bowl", "ボウル", Material.BOWL, 0), @@ -179,115 +179,115 @@ class BukkitMineStackObjectList[F[_]: Sync]( // 建築系ブロック private val minestacklistbuild: List[MineStackObjectGroup[ItemStack]] = leftElems( - MineStackObjectByMaterial(BUILDING, "log", "オークの原木", Material.LOG, 0), - MineStackObjectByMaterial(BUILDING, "wood", "オークの木材", Material.WOOD, 0), - MineStackObjectByMaterial(BUILDING, "wood_step0", "オークの木材ハーフブロック", Material.WOOD_STEP, 0), - MineStackObjectByMaterial(BUILDING, "oak_stairs", "オークの木の階段", Material.WOOD_STAIRS, 0), - MineStackObjectByMaterial(BUILDING, "fence", "オークのフェンス", Material.FENCE, 0), - MineStackObjectByMaterial(BUILDING, "log1", "マツの原木", Material.LOG, 1), - MineStackObjectByMaterial(BUILDING, "wood_1", "マツの木材", Material.WOOD, 1), - MineStackObjectByMaterial(BUILDING, "wood_step1", "マツの木材ハーフブロック", Material.WOOD_STEP, 1), - MineStackObjectByMaterial(BUILDING, "spruce_stairs", "マツの木の階段", Material.SPRUCE_WOOD_STAIRS, 0), + MineStackObjectByMaterial(BUILDING, "log", "オークの原木", Material.OAK_LOG, 0), + MineStackObjectByMaterial(BUILDING, "wood", "オークの木材", Material.OAK_WOOD, 0), + MineStackObjectByMaterial(BUILDING, "wood_step0", "オークの木材ハーフブロック", Material.OAK_SLAB, 0), + MineStackObjectByMaterial(BUILDING, "oak_stairs", "オークの木の階段", Material.OAK_STAIRS, 0), + MineStackObjectByMaterial(BUILDING, "fence", "オークのフェンス", Material.OAK_FENCE, 0), + MineStackObjectByMaterial(BUILDING, "log1", "マツの原木", Material.SPRUCE_LOG, 1), + MineStackObjectByMaterial(BUILDING, "wood_1", "マツの木材", Material.SPRUCE_WOOD, 1), + MineStackObjectByMaterial(BUILDING, "wood_step1", "マツの木材ハーフブロック", Material.SPRUCE_SLAB, 1), + MineStackObjectByMaterial(BUILDING, "spruce_stairs", "マツの木の階段", Material.SPRUCE_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "spruce_fence", "マツのフェンス", Material.SPRUCE_FENCE, 0), - MineStackObjectByMaterial(BUILDING, "log2", "シラカバの原木", Material.LOG, 2), - MineStackObjectByMaterial(BUILDING, "wood_2", "シラカバの木材", Material.WOOD, 2), - MineStackObjectByMaterial(BUILDING, "wood_step2", "シラカバの木材ハーフブロック", Material.WOOD_STEP, 2), - MineStackObjectByMaterial(BUILDING, "birch_stairs", "シラカバの木の階段", Material.BIRCH_WOOD_STAIRS, 0), + MineStackObjectByMaterial(BUILDING, "log2", "シラカバの原木", Material.BIRCH_LOG, 2), + MineStackObjectByMaterial(BUILDING, "wood_2", "シラカバの木材", Material.BIRCH_WOOD, 2), + MineStackObjectByMaterial(BUILDING, "wood_step2", "シラカバの木材ハーフブロック", Material.BIRCH_SLAB, 2), + MineStackObjectByMaterial(BUILDING, "birch_stairs", "シラカバの木の階段", Material.BIRCH_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "birch_fence", "シラカバのフェンス", Material.BIRCH_FENCE, 0), - MineStackObjectByMaterial(BUILDING, "log3", "ジャングルの原木", Material.LOG, 3), - MineStackObjectByMaterial(BUILDING, "wood_3", "ジャングルの木材", Material.WOOD, 3), - MineStackObjectByMaterial(BUILDING, "wood_step3", "ジャングルの木材ハーフブロック", Material.WOOD_STEP, 3), - MineStackObjectByMaterial(BUILDING, "jungle_stairs", "ジャングルの木の階段", Material.JUNGLE_WOOD_STAIRS, 0), + MineStackObjectByMaterial(BUILDING, "log3", "ジャングルの原木", Material.JUNGLE_LOG, 3), + MineStackObjectByMaterial(BUILDING, "wood_3", "ジャングルの木材", Material.JUNGLE_WOOD, 3), + MineStackObjectByMaterial(BUILDING, "wood_step3", "ジャングルの木材ハーフブロック", Material.JUNGLE_SLAB, 3), + MineStackObjectByMaterial(BUILDING, "jungle_stairs", "ジャングルの木の階段", Material.JUNGLE_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "jungle_fence", "ジャングルのフェンス", Material.JUNGLE_FENCE, 0), - MineStackObjectByMaterial(BUILDING, "log_2", "アカシアの原木", Material.LOG_2, 0), - MineStackObjectByMaterial(BUILDING, "wood_4", "アカシアの木材", Material.WOOD, 4), - MineStackObjectByMaterial(BUILDING, "wood_step4", "アカシアの木材ハーフブロック", Material.WOOD_STEP, 4), + MineStackObjectByMaterial(BUILDING, "log_2", "アカシアの原木", Material.ACACIA_LOG, 0), + MineStackObjectByMaterial(BUILDING, "wood_4", "アカシアの木材", Material.ACACIA_WOOD, 4), + MineStackObjectByMaterial(BUILDING, "wood_step4", "アカシアの木材ハーフブロック", Material.ACACIA_SLAB, 4), MineStackObjectByMaterial(BUILDING, "acacia_stairs", "アカシアの木の階段", Material.ACACIA_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "acacia_fence", "アカシアのフェンス", Material.ACACIA_FENCE, 0), - MineStackObjectByMaterial(BUILDING, "log_21", "ダークオークの原木", Material.LOG_2, 1), - MineStackObjectByMaterial(BUILDING, "wood_5", "ダークオークの木材", Material.WOOD, 5), - MineStackObjectByMaterial(BUILDING, "wood_step5", "ダークオークの木材ハーフブロック", Material.WOOD_STEP, 5), + MineStackObjectByMaterial(BUILDING, "log_21", "ダークオークの原木", Material.DARK_OAK_LOG, 1), + MineStackObjectByMaterial(BUILDING, "wood_5", "ダークオークの木材", Material.DARK_OAK_WOOD, 5), + MineStackObjectByMaterial(BUILDING, "wood_step5", "ダークオークの木材ハーフブロック", Material.DARK_OAK_SLAB, 5), MineStackObjectByMaterial(BUILDING, "dark_oak_stairs", "ダークオークの木の階段", Material.DARK_OAK_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "dark_oak_fence", "ダークオークのフェンス", Material.DARK_OAK_FENCE, 0), MineStackObjectByMaterial(BUILDING, "cobblestone", "丸石", Material.COBBLESTONE, 0), - MineStackObjectByMaterial(BUILDING, "step3", "丸石ハーフブロック", Material.STEP, 3), + MineStackObjectByMaterial(BUILDING, "step3", "丸石ハーフブロック", Material.COBBLESTONE_SLAB, 3), MineStackObjectByMaterial(BUILDING, "stone_stairs", "丸石の階段", Material.COBBLESTONE_STAIRS, 0), - MineStackObjectByMaterial(BUILDING, "cobblestone_wall_0", "丸石の壁", Material.COBBLE_WALL, 0), + MineStackObjectByMaterial(BUILDING, "cobblestone_wall_0", "丸石の壁", Material.COBBLESTONE_WALL, 0), MineStackObjectByMaterial(BUILDING, "mossy_cobblestone", "苔石", Material.MOSSY_COBBLESTONE, 0), - MineStackObjectByMaterial(BUILDING, "cobblestone_wall_1", "苔石の壁", Material.COBBLE_WALL, 1), + MineStackObjectByMaterial(BUILDING, "cobblestone_wall_1", "苔石の壁", Material.MOSSY_COBBLESTONE_WALL, 1), MineStackObjectByMaterial(BUILDING, "stone", "石", Material.STONE, 0), - MineStackObjectByMaterial(BUILDING, "step0", "石ハーフブロック", Material.STEP, 0), - MineStackObjectByMaterial(BUILDING, "smooth_brick0", "石レンガ", Material.SMOOTH_BRICK, 0), - MineStackObjectByMaterial(BUILDING, "step5", "石レンガハーフブロック", Material.STEP, 5), - MineStackObjectByMaterial(BUILDING, "smooth_stairs", "石レンガの階段", Material.SMOOTH_STAIRS, 0), - MineStackObjectByMaterial(BUILDING, "smooth_brick3", "模様入り石レンガ", Material.SMOOTH_BRICK, 3), - MineStackObjectByMaterial(BUILDING, "smooth_brick1", "苔石レンガ", Material.SMOOTH_BRICK, 1), - MineStackObjectByMaterial(BUILDING, "smooth_brick2", "ひびの入った石レンガ", Material.SMOOTH_BRICK, 2), + MineStackObjectByMaterial(BUILDING, "step0", "石ハーフブロック", Material.STONE_SLAB, 0), + MineStackObjectByMaterial(BUILDING, "smooth_brick0", "石レンガ", Material.STONE_BRICKS, 0), + MineStackObjectByMaterial(BUILDING, "step5", "石レンガハーフブロック", Material.STONE_BRICK_SLAB, 5), + MineStackObjectByMaterial(BUILDING, "smooth_stairs", "石レンガの階段", Material.STONE_BRICK_STAIRS, 0), + MineStackObjectByMaterial(BUILDING, "smooth_brick3", "模様入り石レンガ", Material.CHISELED_STONE_BRICKS, 3), + MineStackObjectByMaterial(BUILDING, "smooth_brick1", "苔石レンガ", Material.MOSSY_STONE_BRICKS, 1), + MineStackObjectByMaterial(BUILDING, "smooth_brick2", "ひびの入った石レンガ", Material.CRACKED_STONE_BRICKS, 2), MineStackObjectByMaterial(BUILDING, "sand", "砂", Material.SAND, 0), MineStackObjectByMaterial(BUILDING, "sandstone", "砂岩", Material.SANDSTONE, 0), - MineStackObjectByMaterial(BUILDING, "step1", "砂岩ハーフブロック", Material.STEP, 1), + MineStackObjectByMaterial(BUILDING, "step1", "砂岩ハーフブロック", Material.SANDSTONE_SLAB, 1), MineStackObjectByMaterial(BUILDING, "standstone_stairs", "砂岩の階段", Material.SANDSTONE_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "sandstone1", "模様入りの砂岩", Material.SANDSTONE, 1), MineStackObjectByMaterial(BUILDING, "sandstone2", "なめらかな砂岩", Material.SANDSTONE, 2), MineStackObjectByMaterial(BUILDING, "red_sand", "赤い砂", Material.SAND, 1), MineStackObjectByMaterial(BUILDING, "red_sandstone", "赤い砂岩", Material.RED_SANDSTONE, 0), - MineStackObjectByMaterial(BUILDING, "stone_slab20", "赤い砂岩ハーフブロック", Material.STONE_SLAB2, 0), + MineStackObjectByMaterial(BUILDING, "stone_slab20", "赤い砂岩ハーフブロック", Material.RED_SANDSTONE_SLAB, 0), MineStackObjectByMaterial(BUILDING, "red_sandstone_stairs", "赤い砂岩の階段", Material.RED_SANDSTONE_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "red_sandstone1", "模様入りの赤い砂岩", Material.RED_SANDSTONE, 1), MineStackObjectByMaterial(BUILDING, "red_sandstone2", "なめらかな赤い砂岩", Material.RED_SANDSTONE, 2), MineStackObjectByMaterial(BUILDING, "clay_ball", "粘土", Material.CLAY_BALL, 0), MineStackObjectByMaterial(BUILDING, "clay", "粘土(ブロック)", Material.CLAY, 0), - MineStackObjectByMaterial(BUILDING, "brick_item", "レンガ", Material.CLAY_BRICK, 0), - MineStackObjectByMaterial(BUILDING, "brick", "レンガ(ブロック)", Material.BRICK, 0), - MineStackObjectByMaterial(BUILDING, "step4", "レンガハーフブロック", Material.STEP, 4), + MineStackObjectByMaterial(BUILDING, "brick_item", "レンガ", Material.BRICK, 0), + MineStackObjectByMaterial(BUILDING, "brick", "レンガ(ブロック)", Material.BRICKS, 0), + MineStackObjectByMaterial(BUILDING, "step4", "レンガハーフブロック", Material.BRICK_SLAB, 4), MineStackObjectByMaterial(BUILDING, "brick_stairs", "レンガの階段", Material.BRICK_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "quartz_block", "ネザー水晶ブロック", Material.QUARTZ_BLOCK, 0), - MineStackObjectByMaterial(BUILDING, "step7", "ネザー水晶ハーフブロック", Material.STEP, 7), + MineStackObjectByMaterial(BUILDING, "step7", "ネザー水晶ハーフブロック", Material.QUARTZ_SLAB, 7), MineStackObjectByMaterial(BUILDING, "quartz_stairs", "ネザー水晶の階段", Material.QUARTZ_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "quartz_block1", "模様入りネザー水晶ブロック", Material.QUARTZ_BLOCK, 1), MineStackObjectByMaterial(BUILDING, "quartz_block2", "柱状ネザー水晶ブロック", Material.QUARTZ_BLOCK, 2), MineStackObjectByMaterial(BUILDING, "netherrack", "ネザーラック", Material.NETHERRACK, 0), - MineStackObjectByMaterial(BUILDING, "nether_brick_item", "ネザーレンガ", Material.NETHER_BRICK_ITEM, 0), - MineStackObjectByMaterial(BUILDING, "nether_brick", "ネザーレンガ(ブロック)", Material.NETHER_BRICK, 0), - MineStackObjectByMaterial(BUILDING, "step6", "ネザーレンガハーフブロック", Material.STEP, 6), + MineStackObjectByMaterial(BUILDING, "nether_brick_item", "ネザーレンガ", Material.NETHER_BRICK, 0), + MineStackObjectByMaterial(BUILDING, "nether_brick", "ネザーレンガ(ブロック)", Material.NETHER_BRICKS, 0), + MineStackObjectByMaterial(BUILDING, "step6", "ネザーレンガハーフブロック", Material.NETHER_BRICK_SLAB, 6), MineStackObjectByMaterial(BUILDING, "nether_brick_stairs", "ネザーレンガの階段", Material.NETHER_BRICK_STAIRS, 0), - MineStackObjectByMaterial(BUILDING, "nether_brick_fence", "ネザーレンガのフェンス", Material.NETHER_FENCE, 0), - MineStackObjectByMaterial(BUILDING, "red_nether_brick", "赤いネザーレンガ", Material.RED_NETHER_BRICK, 0), + MineStackObjectByMaterial(BUILDING, "nether_brick_fence", "ネザーレンガのフェンス", Material.NETHER_BRICK_FENCE, 0), + MineStackObjectByMaterial(BUILDING, "red_nether_brick", "赤いネザーレンガ", Material.RED_NETHER_BRICKS, 0), MineStackObjectByMaterial(BUILDING, "nether_wart_block", "ネザ-ウォートブロック", Material.NETHER_WART_BLOCK, 0), - MineStackObjectByMaterial(BUILDING, "ender_stone", "エンドストーン", Material.ENDER_STONE, 0), - MineStackObjectByMaterial(BUILDING, "end_bricks", "エンドストーンレンガ", Material.END_BRICKS, 0), + MineStackObjectByMaterial(BUILDING, "ender_stone", "エンドストーン", Material.END_STONE, 0), + MineStackObjectByMaterial(BUILDING, "end_bricks", "エンドストーンレンガ", Material.END_STONE_BRICKS, 0), MineStackObjectByMaterial(BUILDING, "purpur_block", "プルプァブロック", Material.PURPUR_BLOCK, 0), MineStackObjectByMaterial(BUILDING, "purpur_pillar", "柱状プルプァブロック", Material.PURPUR_PILLAR, 0), MineStackObjectByMaterial(BUILDING, "purpur_slab", "プルプァハーフブロック", Material.PURPUR_SLAB, 0), MineStackObjectByMaterial(BUILDING, "purpur_stairs", "プルプァの階段", Material.PURPUR_STAIRS, 0), MineStackObjectByMaterial(BUILDING, "prismarine0", "プリズマリン", Material.PRISMARINE, 0), - MineStackObjectByMaterial(BUILDING, "prismarine1", "プリズマリンレンガ", Material.PRISMARINE, 1), - MineStackObjectByMaterial(BUILDING, "prismarine2", "ダークプリズマリン", Material.PRISMARINE, 2), + MineStackObjectByMaterial(BUILDING, "prismarine1", "プリズマリンレンガ", Material.PRISMARINE_BRICKS, 1), + MineStackObjectByMaterial(BUILDING, "prismarine2", "ダークプリズマリン", Material.DARK_PRISMARINE, 2), MineStackObjectByMaterial(BUILDING, "sea_lantern", "シーランタン", Material.SEA_LANTERN, 0), - MineStackObjectByMaterial(BUILDING, "granite", "花崗岩", Material.STONE, 1), - MineStackObjectByMaterial(BUILDING, "polished_granite", "磨かれた花崗岩", Material.STONE, 2), - MineStackObjectByMaterial(BUILDING, "diorite", "閃緑岩", Material.STONE, 3), - MineStackObjectByMaterial(BUILDING, "polished_diorite", "磨かれた閃緑岩", Material.STONE, 4), - MineStackObjectByMaterial(BUILDING, "andesite", "安山岩", Material.STONE, 5), - MineStackObjectByMaterial(BUILDING, "polished_andesite", "磨かれた安山岩", Material.STONE, 6), + MineStackObjectByMaterial(BUILDING, "granite", "花崗岩", Material.GRANITE, 1), + MineStackObjectByMaterial(BUILDING, "polished_granite", "磨かれた花崗岩", Material.POLISHED_GRANITE, 2), + MineStackObjectByMaterial(BUILDING, "diorite", "閃緑岩", Material.DIORITE, 3), + MineStackObjectByMaterial(BUILDING, "polished_diorite", "磨かれた閃緑岩", Material.POLISHED_DIORITE, 4), + MineStackObjectByMaterial(BUILDING, "andesite", "安山岩", Material.ANDESITE, 5), + MineStackObjectByMaterial(BUILDING, "polished_andesite", "磨かれた安山岩", Material.POLISHED_ANDESITE, 6), MineStackObjectByMaterial(BUILDING, "dirt", "土", Material.DIRT, 0), MineStackObjectByMaterial(BUILDING, "grass", "草ブロック", Material.GRASS, 0), MineStackObjectByMaterial(BUILDING, "gravel", "砂利", Material.GRAVEL, 0), MineStackObjectByMaterial(BUILDING, "flint", "火打石", Material.FLINT, 0), MineStackObjectByMaterial(BUILDING, "flint_and_steel", "火打石と打ち金", Material.FLINT_AND_STEEL, 0), - MineStackObjectByMaterial(BUILDING, "dirt1", "粗い土", Material.DIRT, 1), - MineStackObjectByMaterial(BUILDING, "dirt2", "ポドゾル", Material.DIRT, 2), + MineStackObjectByMaterial(BUILDING, "dirt1", "粗い土", Material.COARSE_DIRT, 1), + MineStackObjectByMaterial(BUILDING, "dirt2", "ポドゾル", Material.PODZOL, 2), MineStackObjectByMaterial(BUILDING, "snow_block", "雪", Material.SNOW_BLOCK, 0), MineStackObjectByMaterial(BUILDING, "snow_layer", "雪タイル", Material.SNOW, 0), - MineStackObjectByMaterial(BUILDING, "snow_ball", "雪玉", Material.SNOW_BALL, 0), + MineStackObjectByMaterial(BUILDING, "snow_ball", "雪玉", Material.SNOWBALL, 0), MineStackObjectByMaterial(BUILDING, "ice", "氷", Material.ICE, 0), MineStackObjectByMaterial(BUILDING, "packed_ice", "氷塊", Material.PACKED_ICE, 0), - MineStackObjectByMaterial(BUILDING, "mycel", "菌糸", Material.MYCEL, 0), + MineStackObjectByMaterial(BUILDING, "mycel", "菌糸", Material.MYCELIUM, 0), MineStackObjectByMaterial(BUILDING, "bone_block", "骨ブロック", Material.BONE_BLOCK, 0), MineStackObjectByMaterial(BUILDING, "sponge", "スポンジ", Material.SPONGE, 0), MineStackObjectByMaterial(BUILDING, "wet_sponge", "濡れたスポンジ", Material.SPONGE, 1), MineStackObjectByMaterial(BUILDING, "soul_sand", "ソウルサンド", Material.SOUL_SAND, 0), - MineStackObjectByMaterial(BUILDING, "magma", "マグマブロック", Material.MAGMA, 0), + MineStackObjectByMaterial(BUILDING, "magma", "マグマブロック", Material.MAGMA_BLOCK, 0), MineStackObjectByMaterial(BUILDING, "obsidian", "黒曜石", Material.OBSIDIAN, 0), MineStackObjectByMaterial(BUILDING, "glowstone_dust", "グロウストーンダスト", Material.GLOWSTONE_DUST, 0), MineStackObjectByMaterial(BUILDING, "glowstone", "グロウストーン", Material.GLOWSTONE, 0), @@ -297,301 +297,302 @@ class BukkitMineStackObjectList[F[_]: Sync]( MineStackObjectByMaterial(BUILDING, "bucket", "バケツ", Material.BUCKET, 0), MineStackObjectByMaterial(BUILDING, "water_bucket", "水入りバケツ", Material.WATER_BUCKET, 0), MineStackObjectByMaterial(BUILDING, "lava_bucket", "溶岩入りバケツ", Material.LAVA_BUCKET, 0), - MineStackObjectByMaterial(BUILDING, "web", "クモの巣", Material.WEB, 0), - MineStackObjectByMaterial(BUILDING, "rails", "レール", Material.RAILS, 0), + MineStackObjectByMaterial(BUILDING, "web", "クモの巣", Material.COBWEB, 0), + MineStackObjectByMaterial(BUILDING, "rails", "レール", Material.RAIL, 0), MineStackObjectByMaterial(BUILDING, "furnace", "かまど", Material.FURNACE, 0), MineStackObjectByMaterial(BUILDING, "chest", "チェスト", Material.CHEST, 0), MineStackObjectByMaterial(BUILDING, "book", "本", Material.BOOK, 0), MineStackObjectByMaterial(BUILDING, "bookshelf", "本棚", Material.BOOKSHELF, 0), - MineStackObjectByMaterial(BUILDING, "iron_bars", "鉄格子", Material.IRON_FENCE, 0), + MineStackObjectByMaterial(BUILDING, "iron_bars", "鉄格子", Material.IRON_BARS, 0), MineStackObjectByMaterial(BUILDING, "anvil", "金床", Material.ANVIL, 0), - MineStackObjectByMaterial(BUILDING, "cauldron", "大釜", Material.CAULDRON_ITEM, 0), - MineStackObjectByMaterial(BUILDING, "brewing_stand", "醸造台", Material.BREWING_STAND_ITEM, 0), - MineStackObjectByMaterial(BUILDING, "flower_pot", "植木鉢", Material.FLOWER_POT_ITEM, 0), + MineStackObjectByMaterial(BUILDING, "cauldron", "大釜", Material.CAULDRON, 0), + MineStackObjectByMaterial(BUILDING, "brewing_stand", "醸造台", Material.BREWING_STAND, 0), + MineStackObjectByMaterial(BUILDING, "flower_pot", "植木鉢", Material.FLOWER_POT, 0), MineStackObjectByMaterial(BUILDING, "hay_block", "干し草の俵", Material.HAY_BLOCK, 0), MineStackObjectByMaterial(BUILDING, "ladder", "はしご", Material.LADDER, 0), - MineStackObjectByMaterial(BUILDING, "sign", "看板", Material.SIGN, 0), + MineStackObjectByMaterial(BUILDING, "sign", "看板", Material.OAK_SIGN, 0), // 1.16からSIGNが素材ごとに別れたので、オークに決めうちしておく MineStackObjectByMaterial(BUILDING, "item_frame", "額縁", Material.ITEM_FRAME, 0), MineStackObjectByMaterial(BUILDING, "painting", "絵画", Material.PAINTING, 0), MineStackObjectByMaterial(BUILDING, "beacon", "ビーコン", Material.BEACON, 0), MineStackObjectByMaterial(BUILDING, "armor_stand", "アーマースタンド", Material.ARMOR_STAND, 0), MineStackObjectByMaterial(BUILDING, "end_crystal", "エンドクリスタル", Material.END_CRYSTAL, 0), - MineStackObjectByMaterial(BUILDING, "enchanting_table", "エンチャントテーブル", Material.ENCHANTMENT_TABLE, 0), + MineStackObjectByMaterial(BUILDING, "enchanting_table", "エンチャントテーブル", Material.ENCHANTING_TABLE, 0), MineStackObjectByMaterial(BUILDING, "jukebox", "ジュークボックス", Material.JUKEBOX, 0), - MineStackObjectByMaterial(BUILDING, "hard_clay", "テラコッタ", Material.HARD_CLAY, 0), - MineStackObjectByMaterial(BUILDING, "workbench", "作業台", Material.WORKBENCH, 0) + MineStackObjectByMaterial(BUILDING, "hard_clay", "テラコッタ", Material.TERRACOTTA, 0), + MineStackObjectByMaterial(BUILDING, "workbench", "作業台", Material.CRAFTING_TABLE, 0) ) ++ rightElems( MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "bed", "白色のベッド", Material.BED, 0), + MineStackObjectByMaterial(BUILDING, "bed", "白色のベッド", Material.WHITE_BED, 0), List( - MineStackObjectByMaterial(BUILDING, "bed_1", "橙色のベッド", Material.BED, 1), - MineStackObjectByMaterial(BUILDING, "bed_2", "赤紫色のベッド", Material.BED, 2), - MineStackObjectByMaterial(BUILDING, "bed_3", "空色のベッド", Material.BED, 3), - MineStackObjectByMaterial(BUILDING, "bed_4", "黄色のベッド", Material.BED, 4), - MineStackObjectByMaterial(BUILDING, "bed_5", "黄緑色のベッド", Material.BED, 5), - MineStackObjectByMaterial(BUILDING, "bed_6", "桃色のベッド", Material.BED, 6), - MineStackObjectByMaterial(BUILDING, "bed_7", "灰色のベッド", Material.BED, 7), - MineStackObjectByMaterial(BUILDING, "bed_8", "薄灰色のベッド", Material.BED, 8), - MineStackObjectByMaterial(BUILDING, "bed_9", "青緑色のベッド", Material.BED, 9), - MineStackObjectByMaterial(BUILDING, "bed_10", "紫色のベッド", Material.BED, 10), - MineStackObjectByMaterial(BUILDING, "bed_11", "青色のベッド", Material.BED, 11), - MineStackObjectByMaterial(BUILDING, "bed_12", "茶色のベッド", Material.BED, 12), - MineStackObjectByMaterial(BUILDING, "bed_13", "緑色のベッド", Material.BED, 13), - MineStackObjectByMaterial(BUILDING, "bed_14", "赤色のベッド", Material.BED, 14), - MineStackObjectByMaterial(BUILDING, "bed_15", "黒色のベッド", Material.BED, 15) + MineStackObjectByMaterial(BUILDING, "bed_1", "橙色のベッド", Material.ORANGE_BED, 1), + MineStackObjectByMaterial(BUILDING, "bed_2", "赤紫色のベッド", Material.MAGENTA_BED, 2), + MineStackObjectByMaterial(BUILDING, "bed_3", "空色のベッド", Material.LIGHT_BLUE_BED, 3), + MineStackObjectByMaterial(BUILDING, "bed_4", "黄色のベッド", Material.YELLOW_BED, 4), + MineStackObjectByMaterial(BUILDING, "bed_5", "黄緑色のベッド", Material.LIME_BED, 5), + MineStackObjectByMaterial(BUILDING, "bed_6", "桃色のベッド", Material.PINK_BED, 6), + MineStackObjectByMaterial(BUILDING, "bed_7", "灰色のベッド", Material.GRAY_BED, 7), + MineStackObjectByMaterial(BUILDING, "bed_8", "薄灰色のベッド", Material.LIGHT_GRAY_BED, 8), + MineStackObjectByMaterial(BUILDING, "bed_9", "青緑色のベッド", Material.CYAN_BED, 9), + MineStackObjectByMaterial(BUILDING, "bed_10", "紫色のベッド", Material.PURPLE_BED, 10), + MineStackObjectByMaterial(BUILDING, "bed_11", "青色のベッド", Material.BLUE_BED, 11), + MineStackObjectByMaterial(BUILDING, "bed_12", "茶色のベッド", Material.BROWN_BED, 12), + MineStackObjectByMaterial(BUILDING, "bed_13", "緑色のベッド", Material.GREEN_BED, 13), + MineStackObjectByMaterial(BUILDING, "bed_14", "赤色のベッド", Material.RED_BED, 14), + MineStackObjectByMaterial(BUILDING, "bed_15", "黒色のベッド", Material.BLACK_BED, 15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "stained_clay", "白色のテラコッタ", Material.STAINED_CLAY, 0), + MineStackObjectByMaterial(BUILDING, "stained_clay", "白色のテラコッタ", Material.WHITE_TERRACOTTA, 0), List( - MineStackObjectByMaterial(BUILDING, "stained_clay1", "橙色のテラコッタ", Material.STAINED_CLAY, 1), - MineStackObjectByMaterial(BUILDING, "stained_clay2", "赤紫色のテラコッタ", Material.STAINED_CLAY, 2), - MineStackObjectByMaterial(BUILDING, "stained_clay3", "空色のテラコッタ", Material.STAINED_CLAY, 3), - MineStackObjectByMaterial(BUILDING, "stained_clay4", "黄色のテラコッタ", Material.STAINED_CLAY, 4), - MineStackObjectByMaterial(BUILDING, "stained_clay5", "黄緑色のテラコッタ", Material.STAINED_CLAY, 5), - MineStackObjectByMaterial(BUILDING, "stained_clay6", "桃色のテラコッタ", Material.STAINED_CLAY, 6), - MineStackObjectByMaterial(BUILDING, "stained_clay7", "灰色のテラコッタ", Material.STAINED_CLAY, 7), - MineStackObjectByMaterial(BUILDING, "stained_clay8", "薄灰色のテラコッタ", Material.STAINED_CLAY, 8), - MineStackObjectByMaterial(BUILDING, "stained_clay9", "青緑色のテラコッタ", Material.STAINED_CLAY, 9), - MineStackObjectByMaterial(BUILDING, "stained_clay10", "紫色のテラコッタ", Material.STAINED_CLAY, 10), - MineStackObjectByMaterial(BUILDING, "stained_clay11", "青色のテラコッタ", Material.STAINED_CLAY, 11), - MineStackObjectByMaterial(BUILDING, "stained_clay12", "茶色のテラコッタ", Material.STAINED_CLAY, 12), - MineStackObjectByMaterial(BUILDING, "stained_clay13", "緑色のテラコッタ", Material.STAINED_CLAY, 13), - MineStackObjectByMaterial(BUILDING, "stained_clay14", "赤色のテラコッタ", Material.STAINED_CLAY, 14), - MineStackObjectByMaterial(BUILDING, "stained_clay15", "黒色のテラコッタ", Material.STAINED_CLAY, 15) + MineStackObjectByMaterial(BUILDING, "stained_clay1", "橙色のテラコッタ", Material.ORANGE_TERRACOTTA, 1), + MineStackObjectByMaterial(BUILDING, "stained_clay2", "赤紫色のテラコッタ", Material.MAGENTA_TERRACOTTA, 2), + MineStackObjectByMaterial(BUILDING, "stained_clay3", "空色のテラコッタ", Material.LIGHT_BLUE_TERRACOTTA, 3), + MineStackObjectByMaterial(BUILDING, "stained_clay4", "黄色のテラコッタ", Material.YELLOW_TERRACOTTA, 4), + MineStackObjectByMaterial(BUILDING, "stained_clay5", "黄緑色のテラコッタ", Material.LIME_TERRACOTTA, 5), + MineStackObjectByMaterial(BUILDING, "stained_clay6", "桃色のテラコッタ", Material.PINK_TERRACOTTA, 6), + MineStackObjectByMaterial(BUILDING, "stained_clay7", "灰色のテラコッタ", Material.GRAY_TERRACOTTA, 7), + MineStackObjectByMaterial(BUILDING, "stained_clay8", "薄灰色のテラコッタ", Material.LIGHT_GRAY_TERRACOTTA, 8), + MineStackObjectByMaterial(BUILDING, "stained_clay9", "青緑色のテラコッタ", Material.CYAN_TERRACOTTA, 9), + MineStackObjectByMaterial(BUILDING, "stained_clay10", "紫色のテラコッタ", Material.PURPLE_TERRACOTTA, 10), + MineStackObjectByMaterial(BUILDING, "stained_clay11", "青色のテラコッタ", Material.BLUE_TERRACOTTA, 11), + MineStackObjectByMaterial(BUILDING, "stained_clay12", "茶色のテラコッタ", Material.BROWN_TERRACOTTA, 12), + MineStackObjectByMaterial(BUILDING, "stained_clay13", "緑色のテラコッタ", Material.GREEN_TERRACOTTA, 13), + MineStackObjectByMaterial(BUILDING, "stained_clay14", "赤色のテラコッタ", Material.RED_TERRACOTTA, 14), + MineStackObjectByMaterial(BUILDING, "stained_clay15", "黒色のテラコッタ", Material.BLACK_TERRACOTTA, 15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "concrete", "白色のコンクリート", Material.CONCRETE, 0), + MineStackObjectByMaterial(BUILDING, "concrete", "白色のコンクリート", Material.WHITE_CONCRETE, 0), List( - MineStackObjectByMaterial(BUILDING, "concrete1", "橙色のコンクリート", Material.CONCRETE, 1), - MineStackObjectByMaterial(BUILDING, "concrete2", "赤紫色のコンクリート", Material.CONCRETE, 2), - MineStackObjectByMaterial(BUILDING, "concrete3", "空色のコンクリート", Material.CONCRETE, 3), - MineStackObjectByMaterial(BUILDING, "concrete4", "黄色のコンクリート", Material.CONCRETE, 4), - MineStackObjectByMaterial(BUILDING, "concrete5", "黄緑色のコンクリート", Material.CONCRETE, 5), - MineStackObjectByMaterial(BUILDING, "concrete6", "桃色のコンクリート", Material.CONCRETE, 6), - MineStackObjectByMaterial(BUILDING, "concrete7", "灰色のコンクリート", Material.CONCRETE, 7), - MineStackObjectByMaterial(BUILDING, "concrete8", "薄灰色のコンクリート", Material.CONCRETE, 8), - MineStackObjectByMaterial(BUILDING, "concrete9", "青緑色のコンクリート", Material.CONCRETE, 9), - MineStackObjectByMaterial(BUILDING, "concrete10", "紫色のコンクリート", Material.CONCRETE, 10), - MineStackObjectByMaterial(BUILDING, "concrete11", "青色のコンクリート", Material.CONCRETE, 11), - MineStackObjectByMaterial(BUILDING, "concrete12", "茶色のコンクリート", Material.CONCRETE, 12), - MineStackObjectByMaterial(BUILDING, "concrete13", "緑色のコンクリート", Material.CONCRETE, 13), - MineStackObjectByMaterial(BUILDING, "concrete14", "赤色のコンクリート", Material.CONCRETE, 14), - MineStackObjectByMaterial(BUILDING, "concrete15", "黒色のコンクリート", Material.CONCRETE, 15) + MineStackObjectByMaterial(BUILDING, "concrete15", "黒色のコンクリート", Material.BLACK_CONCRETE, 15), + MineStackObjectByMaterial(BUILDING, "concrete1", "橙色のコンクリート", Material.ORANGE_CONCRETE, 1), + MineStackObjectByMaterial(BUILDING, "concrete2", "赤紫色のコンクリート", Material.MAGENTA_CONCRETE, 2), + MineStackObjectByMaterial(BUILDING, "concrete3", "空色のコンクリート", Material.LIGHT_BLUE_CONCRETE, 3), + MineStackObjectByMaterial(BUILDING, "concrete4", "黄色のコンクリート", Material.YELLOW_CONCRETE, 4), + MineStackObjectByMaterial(BUILDING, "concrete5", "黄緑色のコンクリート", Material.LIME_CONCRETE, 5), + MineStackObjectByMaterial(BUILDING, "concrete6", "桃色のコンクリート", Material.PINK_CONCRETE, 6), + MineStackObjectByMaterial(BUILDING, "concrete7", "灰色のコンクリート", Material.GRAY_CONCRETE, 7), + MineStackObjectByMaterial(BUILDING, "concrete8", "薄灰色のコンクリート", Material.LIGHT_GRAY_CONCRETE, 8), + MineStackObjectByMaterial(BUILDING, "concrete9", "青緑色のコンクリート", Material.CYAN_CONCRETE, 9), + MineStackObjectByMaterial(BUILDING, "concrete10", "紫色のコンクリート", Material.PURPLE_CONCRETE, 10), + MineStackObjectByMaterial(BUILDING, "concrete11", "青色のコンクリート", Material.BLUE_CONCRETE, 11), + MineStackObjectByMaterial(BUILDING, "concrete12", "茶色のコンクリート", Material.BROWN_CONCRETE, 12), + MineStackObjectByMaterial(BUILDING, "concrete13", "緑色のコンクリート", Material.GREEN_CONCRETE, 13), + MineStackObjectByMaterial(BUILDING, "concrete14", "赤色のコンクリート", Material.RED_CONCRETE, 14), + MineStackObjectByMaterial(BUILDING, "concrete15", "黒色のコンクリート", Material.BLACK_CONCRETE, 15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "concrete_powder", "白色のコンクリートパウダー", Material.CONCRETE_POWDER, 0), + MineStackObjectByMaterial(BUILDING, "concrete_powder", "白色のコンクリートパウダー", Material.WHITE_CONCRETE_POWDER, 0), List( - MineStackObjectByMaterial(BUILDING, "concrete_powder1", "橙色のコンクリートパウダー", Material.CONCRETE_POWDER, 1), - MineStackObjectByMaterial(BUILDING, "concrete_powder2", "赤紫色のコンクリートパウダー", Material.CONCRETE_POWDER, 2), - MineStackObjectByMaterial(BUILDING, "concrete_powder3", "空色のコンクリートパウダー", Material.CONCRETE_POWDER, 3), - MineStackObjectByMaterial(BUILDING, "concrete_powder4", "黄色のコンクリートパウダー", Material.CONCRETE_POWDER, 4), - MineStackObjectByMaterial(BUILDING, "concrete_powder5", "黄緑色のコンクリートパウダー", Material.CONCRETE_POWDER, 5), - MineStackObjectByMaterial(BUILDING, "concrete_powder6", "桃色のコンクリートパウダー", Material.CONCRETE_POWDER, 6), - MineStackObjectByMaterial(BUILDING, "concrete_powder7", "灰色のコンクリートパウダー", Material.CONCRETE_POWDER, 7), - MineStackObjectByMaterial(BUILDING, "concrete_powder8", "薄灰色のコンクリートパウダー", Material.CONCRETE_POWDER, 8), - MineStackObjectByMaterial(BUILDING, "concrete_powder9", "青緑色のコンクリートパウダー", Material.CONCRETE_POWDER, 9), - MineStackObjectByMaterial(BUILDING, "concrete_powder10", "紫色のコンクリートパウダー", Material.CONCRETE_POWDER, 10), - MineStackObjectByMaterial(BUILDING, "concrete_powder11", "青色のコンクリートパウダー", Material.CONCRETE_POWDER, 11), - MineStackObjectByMaterial(BUILDING, "concrete_powder12", "茶色のコンクリートパウダー", Material.CONCRETE_POWDER, 12), - MineStackObjectByMaterial(BUILDING, "concrete_powder13", "緑色のコンクリートパウダー", Material.CONCRETE_POWDER, 13), - MineStackObjectByMaterial(BUILDING, "concrete_powder14", "赤色のコンクリートパウダー", Material.CONCRETE_POWDER, 14), - MineStackObjectByMaterial(BUILDING, "concrete_powder15", "黒色のコンクリートパウダー", Material.CONCRETE_POWDER, 15) + MineStackObjectByMaterial(BUILDING, "concrete_powder1", "橙色のコンクリートパウダー", Material.ORANGE_CONCRETE_POWDER, 1), + MineStackObjectByMaterial(BUILDING, "concrete_powder2", "赤紫色のコンクリートパウダー", Material.MAGENTA_CONCRETE_POWDER, 2), + MineStackObjectByMaterial(BUILDING, "concrete_powder3", "空色のコンクリートパウダー", Material.LIGHT_BLUE_CONCRETE_POWDER, 3), + MineStackObjectByMaterial(BUILDING, "concrete_powder4", "黄色のコンクリートパウダー", Material.YELLOW_CONCRETE_POWDER, 4), + MineStackObjectByMaterial(BUILDING, "concrete_powder5", "黄緑色のコンクリートパウダー", Material.LIME_CONCRETE_POWDER, 5), + MineStackObjectByMaterial(BUILDING,"concrete_powder6","桃色のコンクリートパウダー",Material.PINK_CONCRETE_POWDER,6), + MineStackObjectByMaterial(BUILDING,"concrete_powder7","灰色のコンクリートパウダー",Material.GRAY_CONCRETE_POWDER,7), + MineStackObjectByMaterial(BUILDING,"concrete_powder8","薄灰色のコンクリートパウダー",Material.LIGHT_GRAY_CONCRETE_POWDER,8), + MineStackObjectByMaterial(BUILDING,"concrete_powder9","青緑色のコンクリートパウダー",Material.CYAN_CONCRETE_POWDER,9), + MineStackObjectByMaterial(BUILDING,"concrete_powder10","紫色のコンクリートパウダー",Material.PURPLE_CONCRETE_POWDER,10), + MineStackObjectByMaterial(BUILDING,"concrete_powder11","青色のコンクリートパウダー",Material.BLUE_CONCRETE_POWDER,11), + MineStackObjectByMaterial(BUILDING,"concrete_powder12","茶色のコンクリートパウダー",Material.BROWN_CONCRETE_POWDER,12), + MineStackObjectByMaterial(BUILDING,"concrete_powder13","緑色のコンクリートパウダー",Material.GREEN_CONCRETE_POWDER,13), + MineStackObjectByMaterial(BUILDING,"concrete_powder14","赤色のコンクリートパウダー",Material.RED_CONCRETE_POWDER,14), + MineStackObjectByMaterial(BUILDING,"concrete_powder15","黒色のコンクリートパウダー",Material.BLACK_CONCRETE_POWDER,15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "white_glazed_terracotta", "白色の彩釉テラコッタ", Material.WHITE_GLAZED_TERRACOTTA, 0), + MineStackObjectByMaterial(BUILDING,"white_glazed_terracotta","白色の彩釉テラコッタ",Material.WHITE_GLAZED_TERRACOTTA,0), List( - MineStackObjectByMaterial(BUILDING, "orange_glazed_terracotta", "橙色の彩釉テラコッタ", Material.ORANGE_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "magenta_glazed_terracotta", "赤紫色の彩釉テラコッタ", Material.MAGENTA_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "light_blue_glazed_terracotta", "空色の彩釉テラコッタ", Material.LIGHT_BLUE_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "yellow_glazed_terracotta", "黄色の彩釉テラコッタ", Material.YELLOW_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "lime_glazed_terracotta", "黄緑色の彩釉テラコッタ", Material.LIME_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "pink_glazed_terracotta", "桃色の彩釉テラコッタ", Material.PINK_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "gray_glazed_terracotta", "灰色の彩釉テラコッタ", Material.GRAY_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "silver_glazed_terracotta", "薄灰色の彩釉テラコッタ", Material.SILVER_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "cyan_glazed_terracotta", "青緑色の彩釉テラコッタ", Material.CYAN_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "purple_glazed_terracotta", "紫色の彩釉テラコッタ", Material.PURPLE_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "blue_glazed_terracotta", "青色の彩釉テラコッタ", Material.BLUE_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "brown_glazed_terracotta", "茶色の彩釉テラコッタ", Material.BROWN_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "green_glazed_terracotta", "緑色の彩釉テラコッタ", Material.GREEN_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "red_glazed_terracotta", "赤色の彩釉テラコッタ", Material.RED_GLAZED_TERRACOTTA, 0), - MineStackObjectByMaterial(BUILDING, "black_glazed_terracotta", "黒色の彩釉テラコッタ", Material.BLACK_GLAZED_TERRACOTTA, 0) + MineStackObjectByMaterial(BUILDING,"orange_glazed_terracotta","橙色の彩釉テラコッタ",Material.ORANGE_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"magenta_glazed_terracotta","赤紫色の彩釉テラコッタ",Material.MAGENTA_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"light_blue_glazed_terracotta","空色の彩釉テラコッタ",Material.LIGHT_BLUE_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"yellow_glazed_terracotta","黄色の彩釉テラコッタ",Material.YELLOW_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"lime_glazed_terracotta","黄緑色の彩釉テラコッタ",Material.LIME_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"pink_glazed_terracotta","桃色の彩釉テラコッタ",Material.PINK_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"gray_glazed_terracotta","灰色の彩釉テラコッタ",Material.GRAY_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"silver_glazed_terracotta","薄灰色の彩釉テラコッタ",Material.LIGHT_GRAY_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"cyan_glazed_terracotta","青緑色の彩釉テラコッタ",Material.CYAN_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"purple_glazed_terracotta","紫色の彩釉テラコッタ",Material.PURPLE_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"blue_glazed_terracotta","青色の彩釉テラコッタ",Material.BLUE_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"brown_glazed_terracotta","茶色の彩釉テラコッタ",Material.BROWN_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"green_glazed_terracotta","緑色の彩釉テラコッタ",Material.GREEN_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"red_glazed_terracotta","赤色の彩釉テラコッタ",Material.RED_GLAZED_TERRACOTTA,0), + MineStackObjectByMaterial(BUILDING,"black_glazed_terracotta","黒色の彩釉テラコッタ",Material.BLACK_GLAZED_TERRACOTTA,0) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "wool_0", "白色の羊毛", Material.WOOL, 0), + MineStackObjectByMaterial(BUILDING, "wool_0", "白色の羊毛", Material.WHITE_WOOL, 0), List( - MineStackObjectByMaterial(BUILDING, "wool_1", "橙色の羊毛", Material.WOOL, 1), - MineStackObjectByMaterial(BUILDING, "wool_2", "赤紫色の羊毛", Material.WOOL, 2), - MineStackObjectByMaterial(BUILDING, "wool_3", "空色の羊毛", Material.WOOL, 3), - MineStackObjectByMaterial(BUILDING, "wool_4", "黄色の羊毛", Material.WOOL, 4), - MineStackObjectByMaterial(BUILDING, "wool_5", "黄緑色の羊毛", Material.WOOL, 5), - MineStackObjectByMaterial(BUILDING, "wool_6", "桃色の羊毛", Material.WOOL, 6), - MineStackObjectByMaterial(BUILDING, "wool_7", "灰色の羊毛", Material.WOOL, 7), - MineStackObjectByMaterial(BUILDING, "wool_8", "薄灰色の羊毛", Material.WOOL, 8), - MineStackObjectByMaterial(BUILDING, "wool_9", "青緑色の羊毛", Material.WOOL, 9), - MineStackObjectByMaterial(BUILDING, "wool_10", "紫色の羊毛", Material.WOOL, 10), - MineStackObjectByMaterial(BUILDING, "wool_11", "青色の羊毛", Material.WOOL, 11), - MineStackObjectByMaterial(BUILDING, "wool_12", "茶色の羊毛", Material.WOOL, 12), - MineStackObjectByMaterial(BUILDING, "wool_13", "緑色の羊毛", Material.WOOL, 13), - MineStackObjectByMaterial(BUILDING, "wool_14", "赤色の羊毛", Material.WOOL, 14), - MineStackObjectByMaterial(BUILDING, "wool_15", "黒色の羊毛", Material.WOOL, 15) + MineStackObjectByMaterial(BUILDING, "wool_1", "橙色の羊毛", Material.ORANGE_WOOL, 1), + MineStackObjectByMaterial(BUILDING, "wool_2", "赤紫色の羊毛", Material.MAGENTA_WOOL, 2), + MineStackObjectByMaterial(BUILDING, "wool_3", "空色の羊毛", Material.LIGHT_BLUE_WOOL, 3), + MineStackObjectByMaterial(BUILDING, "wool_4", "黄色の羊毛", Material.YELLOW_WOOL, 4), + MineStackObjectByMaterial(BUILDING, "wool_5", "黄緑色の羊毛", Material.LIME_WOOL, 5), + MineStackObjectByMaterial(BUILDING, "wool_6", "桃色の羊毛", Material.PINK_WOOL, 6), + MineStackObjectByMaterial(BUILDING, "wool_7", "灰色の羊毛", Material.GRAY_WOOL, 7), + MineStackObjectByMaterial(BUILDING, "wool_8", "薄灰色の羊毛", Material.LIGHT_GRAY_WOOL, 8), + MineStackObjectByMaterial(BUILDING, "wool_9", "青緑色の羊毛", Material.CYAN_WOOL, 9), + MineStackObjectByMaterial(BUILDING, "wool_10", "紫色の羊毛", Material.PURPLE_WOOL, 10), + MineStackObjectByMaterial(BUILDING, "wool_11", "青色の羊毛", Material.BLUE_WOOL, 11), + MineStackObjectByMaterial(BUILDING, "wool_12", "茶色の羊毛", Material.BROWN_WOOL, 12), + MineStackObjectByMaterial(BUILDING, "wool_13", "緑色の羊毛", Material.GREEN_WOOL, 13), + MineStackObjectByMaterial(BUILDING, "wool_14", "赤色の羊毛", Material.RED_WOOL, 14), + MineStackObjectByMaterial(BUILDING, "wool_15", "黒色の羊毛", Material.BLACK_WOOL, 15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "carpet_0", "白色のカーペット", Material.CARPET, 0), + MineStackObjectByMaterial(BUILDING, "carpet_0", "白色のカーペット", Material.WHITE_CARPET, 0), List( - MineStackObjectByMaterial(BUILDING, "carpet_1", "橙色のカーペット", Material.CARPET, 1), - MineStackObjectByMaterial(BUILDING, "carpet_2", "赤紫色のカーペット", Material.CARPET, 2), - MineStackObjectByMaterial(BUILDING, "carpet_3", "空色のカーペット", Material.CARPET, 3), - MineStackObjectByMaterial(BUILDING, "carpet_4", "黄色のカーペット", Material.CARPET, 4), - MineStackObjectByMaterial(BUILDING, "carpet_5", "黄緑色のカーペット", Material.CARPET, 5), - MineStackObjectByMaterial(BUILDING, "carpet_6", "桃色のカーペット", Material.CARPET, 6), - MineStackObjectByMaterial(BUILDING, "carpet_7", "灰色のカーペット", Material.CARPET, 7), - MineStackObjectByMaterial(BUILDING, "carpet_8", "薄灰色のカーペット", Material.CARPET, 8), - MineStackObjectByMaterial(BUILDING, "carpet_9", "青緑色のカーペット", Material.CARPET, 9), - MineStackObjectByMaterial(BUILDING, "carpet_10", "紫色のカーペット", Material.CARPET, 10), - MineStackObjectByMaterial(BUILDING, "carpet_11", "青色のカーペット", Material.CARPET, 11), - MineStackObjectByMaterial(BUILDING, "carpet_12", "茶色のカーペット", Material.CARPET, 12), - MineStackObjectByMaterial(BUILDING, "carpet_13", "緑色のカーペット", Material.CARPET, 13), - MineStackObjectByMaterial(BUILDING, "carpet_14", "赤色のカーペット", Material.CARPET, 14), - MineStackObjectByMaterial(BUILDING, "carpet_15", "黒色のカーペット", Material.CARPET, 15) + MineStackObjectByMaterial(BUILDING, "carpet_1", "橙色のカーペット", Material.ORANGE_CARPET, 1), + MineStackObjectByMaterial(BUILDING, "carpet_2", "赤紫色のカーペット", Material.MAGENTA_CARPET, 2), + MineStackObjectByMaterial(BUILDING, "carpet_3", "空色のカーペット", Material.LIGHT_BLUE_CARPET, 3), + MineStackObjectByMaterial(BUILDING, "carpet_4", "黄色のカーペット", Material.YELLOW_CARPET, 4), + MineStackObjectByMaterial(BUILDING, "carpet_5", "黄緑色のカーペット", Material.LIME_CARPET, 5), + MineStackObjectByMaterial(BUILDING, "carpet_6", "桃色のカーペット", Material.PINK_CARPET, 6), + MineStackObjectByMaterial(BUILDING, "carpet_7", "灰色のカーペット", Material.GRAY_CARPET, 7), + MineStackObjectByMaterial(BUILDING, "carpet_8", "薄灰色のカーペット", Material.LIGHT_GRAY_CARPET, 8), + MineStackObjectByMaterial(BUILDING, "carpet_9", "青緑色のカーペット", Material.CYAN_CARPET, 9), + MineStackObjectByMaterial(BUILDING, "carpet_10", "紫色のカーペット", Material.PURPLE_CARPET, 10), + MineStackObjectByMaterial(BUILDING, "carpet_11", "青色のカーペット", Material.BLUE_CARPET, 11), + MineStackObjectByMaterial(BUILDING, "carpet_12", "茶色のカーペット", Material.BROWN_CARPET, 12), + MineStackObjectByMaterial(BUILDING, "carpet_13", "緑色のカーペット", Material.GREEN_CARPET, 13), + MineStackObjectByMaterial(BUILDING, "carpet_14", "赤色のカーペット", Material.RED_CARPET, 14), + MineStackObjectByMaterial(BUILDING, "carpet_15", "黒色のカーペット", Material.BLACK_CARPET, 15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "glass", "ガラス", Material.GLASS, 0), + MineStackObjectByMaterial(BUILDING, "glass", "ガラス",Material.GLASS, 0), List( - MineStackObjectByMaterial(BUILDING, "stained_glass_0", "白色の色付きガラス", Material.STAINED_GLASS, 0), - MineStackObjectByMaterial(BUILDING, "stained_glass_1", "橙色の色付きガラス", Material.STAINED_GLASS, 1), - MineStackObjectByMaterial(BUILDING, "stained_glass_2", "赤紫色の色付きガラス", Material.STAINED_GLASS, 2), - MineStackObjectByMaterial(BUILDING, "stained_glass_3", "空色の色付きガラス", Material.STAINED_GLASS, 3), - MineStackObjectByMaterial(BUILDING, "stained_glass_4", "黄色の色付きガラス", Material.STAINED_GLASS, 4), - MineStackObjectByMaterial(BUILDING, "stained_glass_5", "黄緑色の色付きガラス", Material.STAINED_GLASS, 5), - MineStackObjectByMaterial(BUILDING, "stained_glass_6", "桃色の色付きガラス", Material.STAINED_GLASS, 6), - MineStackObjectByMaterial(BUILDING, "stained_glass_7", "灰色の色付きガラス", Material.STAINED_GLASS, 7), - MineStackObjectByMaterial(BUILDING, "stained_glass_8", "薄灰色の色付きガラス", Material.STAINED_GLASS, 8), - MineStackObjectByMaterial(BUILDING, "stained_glass_9", "青緑色の色付きガラス", Material.STAINED_GLASS, 9), - MineStackObjectByMaterial(BUILDING, "stained_glass_10", "紫色の色付きガラス", Material.STAINED_GLASS, 10), - MineStackObjectByMaterial(BUILDING, "stained_glass_11", "青色の色付きガラス", Material.STAINED_GLASS, 11), - MineStackObjectByMaterial(BUILDING, "stained_glass_12", "茶色の色付きガラス", Material.STAINED_GLASS, 12), - MineStackObjectByMaterial(BUILDING, "stained_glass_13", "緑色の色付きガラス", Material.STAINED_GLASS, 13), - MineStackObjectByMaterial(BUILDING, "stained_glass_14", "赤色の色付きガラス", Material.STAINED_GLASS, 14), - MineStackObjectByMaterial(BUILDING, "stained_glass_15", "黒色の色付きガラス", Material.STAINED_GLASS, 15) + MineStackObjectByMaterial(BUILDING, "stained_glass_0", "白色の色付きガラス", Material.WHITE_STAINED_GLASS, 0), + MineStackObjectByMaterial(BUILDING, "stained_glass_1", "橙色の色付きガラス", Material.ORANGE_STAINED_GLASS, 1), + MineStackObjectByMaterial(BUILDING, "stained_glass_2", "赤紫色の色付きガラス", Material.MAGENTA_STAINED_GLASS, 2), + MineStackObjectByMaterial(BUILDING, "stained_glass_3", "空色の色付きガラス", Material.LIGHT_BLUE_STAINED_GLASS, 3), + MineStackObjectByMaterial(BUILDING, "stained_glass_4", "黄色の色付きガラス", Material.YELLOW_STAINED_GLASS, 4), + MineStackObjectByMaterial(BUILDING, "stained_glass_5", "黄緑色の色付きガラス", Material.LIME_STAINED_GLASS, 5), + MineStackObjectByMaterial(BUILDING, "stained_glass_6", "桃色の色付きガラス", Material.PINK_STAINED_GLASS, 6), + MineStackObjectByMaterial(BUILDING, "stained_glass_7", "灰色の色付きガラス", Material.GRAY_STAINED_GLASS, 7), + MineStackObjectByMaterial(BUILDING, "stained_glass_8", "薄灰色の色付きガラス", Material.LIGHT_GRAY_STAINED_GLASS, 8), + MineStackObjectByMaterial(BUILDING, "stained_glass_9", "青緑色の色付きガラス", Material.CYAN_STAINED_GLASS, 9), + MineStackObjectByMaterial(BUILDING, "stained_glass_10", "紫色の色付きガラス", Material.PURPLE_STAINED_GLASS, 10), + MineStackObjectByMaterial(BUILDING, "stained_glass_11", "青色の色付きガラス", Material.BLUE_STAINED_GLASS, 11), + MineStackObjectByMaterial(BUILDING, "stained_glass_12", "茶色の色付きガラス", Material.BROWN_STAINED_GLASS, 12), + MineStackObjectByMaterial(BUILDING, "stained_glass_13", "緑色の色付きガラス", Material.GREEN_STAINED_GLASS, 13), + MineStackObjectByMaterial(BUILDING, "stained_glass_14", "赤色の色付きガラス", Material.RED_STAINED_GLASS, 14), + MineStackObjectByMaterial(BUILDING, "stained_glass_15", "黒色の色付きガラス", Material.BLACK_STAINED_GLASS, 15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "glass_panel", "板ガラス", Material.THIN_GLASS, 0), + MineStackObjectByMaterial(BUILDING, "glass_panel", "板ガラス", Material.GLASS_PANE, 0), List( - MineStackObjectByMaterial(BUILDING, "glass_panel_0", "白色の色付きガラス板", Material.STAINED_GLASS_PANE, 0), - MineStackObjectByMaterial(BUILDING, "glass_panel_1", "橙色の色付きガラス板", Material.STAINED_GLASS_PANE, 1), - MineStackObjectByMaterial(BUILDING, "glass_panel_2", "赤紫色の色付きガラス板", Material.STAINED_GLASS_PANE, 2), - MineStackObjectByMaterial(BUILDING, "glass_panel_3", "空色の色付きガラス板", Material.STAINED_GLASS_PANE, 3), - MineStackObjectByMaterial(BUILDING, "glass_panel_4", "黄色の色付きガラス板", Material.STAINED_GLASS_PANE, 4), - MineStackObjectByMaterial(BUILDING, "glass_panel_5", "黄緑色の色付きガラス板", Material.STAINED_GLASS_PANE, 5), - MineStackObjectByMaterial(BUILDING, "glass_panel_6", "桃色の色付きガラス板", Material.STAINED_GLASS_PANE, 6), - MineStackObjectByMaterial(BUILDING, "glass_panel_7", "灰色の色付きガラス板", Material.STAINED_GLASS_PANE, 7), - MineStackObjectByMaterial(BUILDING, "glass_panel_8", "薄灰色の色付きガラス板", Material.STAINED_GLASS_PANE, 8), - MineStackObjectByMaterial(BUILDING, "glass_panel_9", "青緑色の色付きガラス板", Material.STAINED_GLASS_PANE, 9), - MineStackObjectByMaterial(BUILDING, "glass_panel_10", "紫色の色付きガラス板", Material.STAINED_GLASS_PANE, 10), - MineStackObjectByMaterial(BUILDING, "glass_panel_11", "青色の色付きガラス板", Material.STAINED_GLASS_PANE, 11), - MineStackObjectByMaterial(BUILDING, "glass_panel_12", "茶色の色付きガラス板", Material.STAINED_GLASS_PANE, 12), - MineStackObjectByMaterial(BUILDING, "glass_panel_13", "緑色の色付きガラス板", Material.STAINED_GLASS_PANE, 13), - MineStackObjectByMaterial(BUILDING, "glass_panel_14", "赤色の色付きガラス板", Material.STAINED_GLASS_PANE, 14), - MineStackObjectByMaterial(BUILDING, "glass_panel_15", "黒色の色付きガラス板", Material.STAINED_GLASS_PANE, 15) + MineStackObjectByMaterial(BUILDING,"glass_panel_0","白色の色付きガラス板",Material.WHITE_STAINED_GLASS_PANE,0), + MineStackObjectByMaterial(BUILDING,"glass_panel_1","橙色の色付きガラス板",Material.ORANGE_STAINED_GLASS_PANE,1), + MineStackObjectByMaterial(BUILDING,"glass_panel_2","赤紫色の色付きガラス板",Material.MAGENTA_STAINED_GLASS_PANE,2), + MineStackObjectByMaterial(BUILDING,"glass_panel_3","空色の色付きガラス板",Material.LIGHT_BLUE_STAINED_GLASS_PANE,3), + MineStackObjectByMaterial(BUILDING,"glass_panel_4","黄色の色付きガラス板",Material.YELLOW_STAINED_GLASS_PANE,4), + MineStackObjectByMaterial(BUILDING,"glass_panel_5","黄緑色の色付きガラス板",Material.LIME_STAINED_GLASS_PANE,5), + MineStackObjectByMaterial(BUILDING,"glass_panel_6","桃色の色付きガラス板",Material.PINK_STAINED_GLASS_PANE,6), + MineStackObjectByMaterial(BUILDING,"glass_panel_7","灰色の色付きガラス板",Material.GRAY_STAINED_GLASS_PANE,7), + MineStackObjectByMaterial(BUILDING,"glass_panel_8","薄灰色の色付きガラス板",Material.LIGHT_GRAY_STAINED_GLASS_PANE,8), + MineStackObjectByMaterial(BUILDING,"glass_panel_9","青緑色の色付きガラス板",Material.CYAN_STAINED_GLASS_PANE,9), + MineStackObjectByMaterial(BUILDING,"glass_panel_10","紫色の色付きガラス板",Material.PURPLE_STAINED_GLASS_PANE,10), + MineStackObjectByMaterial(BUILDING,"glass_panel_11","青色の色付きガラス板",Material.BLUE_STAINED_GLASS_PANE,11), + MineStackObjectByMaterial(BUILDING,"glass_panel_12","茶色の色付きガラス板",Material.BROWN_STAINED_GLASS_PANE,12), + MineStackObjectByMaterial(BUILDING,"glass_panel_13","緑色の色付きガラス板",Material.GREEN_STAINED_GLASS_PANE,13), + MineStackObjectByMaterial(BUILDING,"glass_panel_14","赤色の色付きガラス板",Material.RED_STAINED_GLASS_PANE,14), + MineStackObjectByMaterial(BUILDING,"glass_panel_15","黒色の色付きガラス板",Material.BLACK_STAINED_GLASS_PANE,15) ) ), MineStackObjectWithColorVariants( - MineStackObjectByMaterial(BUILDING, "dye_1", "赤色の染料", Material.INK_SACK, 1), + MineStackObjectByMaterial(BUILDING, "dye_1", "赤色の染料", Material.RED_DYE, 1), List( - MineStackObjectByMaterial(BUILDING, "dye_2", "緑色の染料", Material.INK_SACK, 2), - MineStackObjectByMaterial(BUILDING, "dye_5", "紫色の染料", Material.INK_SACK, 5), - MineStackObjectByMaterial(BUILDING, "dye_6", "青緑色の染料", Material.INK_SACK, 6), - MineStackObjectByMaterial(BUILDING, "dye_7", "薄灰色の染料", Material.INK_SACK, 7), - MineStackObjectByMaterial(BUILDING, "dye_8", "灰色の染料", Material.INK_SACK, 8), - MineStackObjectByMaterial(BUILDING, "dye_9", "桃色の染料", Material.INK_SACK, 9), - MineStackObjectByMaterial(BUILDING, "dye_10", "黄緑色の染料", Material.INK_SACK, 10), - MineStackObjectByMaterial(BUILDING, "dye_11", "黄色の染料", Material.INK_SACK, 11), - MineStackObjectByMaterial(BUILDING, "dye_12", "空色の染料", Material.INK_SACK, 12), - MineStackObjectByMaterial(BUILDING, "dye_13", "赤紫色の染料", Material.INK_SACK, 13), - MineStackObjectByMaterial(BUILDING, "dye_14", "橙色の染料", Material.INK_SACK, 14), - MineStackObjectByMaterial(BUILDING, "dye_15", "骨粉", Material.INK_SACK, 15), - MineStackObjectByMaterial(BUILDING, "ink_sack0", "イカスミ", Material.INK_SACK, 0) + MineStackObjectByMaterial(BUILDING, "dye_2", "緑色の染料", Material.GREEN_DYE, 2), + MineStackObjectByMaterial(BUILDING, "dye_5", "紫色の染料", Material.PURPLE_DYE, 5), + MineStackObjectByMaterial(BUILDING, "dye_6", "青緑色の染料", Material.CYAN_DYE, 6), + MineStackObjectByMaterial(BUILDING, "dye_7", "薄灰色の染料", Material.LIGHT_GRAY_DYE, 7), + MineStackObjectByMaterial(BUILDING, "dye_8", "灰色の染料", Material.GRAY_DYE, 8), + MineStackObjectByMaterial(BUILDING, "dye_9", "桃色の染料", Material.PINK_DYE, 9), + MineStackObjectByMaterial(BUILDING, "dye_10", "黄緑色の染料", Material.LIME_DYE, 10), + MineStackObjectByMaterial(BUILDING, "dye_11", "黄色の染料", Material.YELLOW_DYE, 11), + MineStackObjectByMaterial(BUILDING, "dye_12", "空色の染料", Material.LIGHT_BLUE_DYE, 12), + MineStackObjectByMaterial(BUILDING, "dye_13", "赤紫色の染料", Material.MAGENTA_DYE, 13), + MineStackObjectByMaterial(BUILDING, "dye_14", "橙色の染料", Material.ORANGE_DYE, 14), + MineStackObjectByMaterial(BUILDING, "dye_15", "骨粉", Material.BONE_MEAL, 15), + MineStackObjectByMaterial(BUILDING, "ink_sack0", "イカスミ", Material.INK_SAC, 0) ) ) ) // レッドストーン系ブロック private val minestacklistrs: List[MineStackObjectGroup[ItemStack]] = leftElems( - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "redstone", "レッドストーン", Material.REDSTONE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "stone_button", "石のボタン", Material.STONE_BUTTON, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "wood_button", "木のボタン", Material.WOOD_BUTTON, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "stone_plate", "石の感圧版", Material.STONE_PLATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "wood_plate", "木の感圧版", Material.WOOD_PLATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "fence_gate", "オークのフェンスゲート", Material.FENCE_GATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "spruce_fence_gate", "マツのフェンスゲート", Material.SPRUCE_FENCE_GATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "birch_fence_gate", "シラカバのフェンスゲート", Material.BIRCH_FENCE_GATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "jungle_fence_gate", "ジャングルのフェンスゲート", Material.JUNGLE_FENCE_GATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "dark_oak_fence_gate", "ダークオークのフェンスゲート", Material.DARK_OAK_FENCE_GATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "acacia_fence_gate", "アカシアのフェンスゲート", Material.ACACIA_FENCE_GATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "redstone_block", "レッドストーンブロック", Material.REDSTONE_BLOCK, 0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"redstone","レッドストーン",Material.REDSTONE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"stone_button","石のボタン",Material.STONE_BUTTON,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"wood_button","木のボタン",Material.OAK_BUTTON,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"stone_plate","石の感圧版",Material.STONE_PRESSURE_PLATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"wood_plate","木の感圧版",Material.OAK_PRESSURE_PLATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"fence_gate","オークのフェンスゲート",Material.OAK_FENCE_GATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"spruce_fence_gate","マツのフェンスゲート",Material.SPRUCE_FENCE_GATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"birch_fence_gate","シラカバのフェンスゲート",Material.BIRCH_FENCE_GATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"jungle_fence_gate","ジャングルのフェンスゲート",Material.JUNGLE_FENCE_GATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"dark_oak_fence_gate","ダークオークのフェンスゲート",Material.DARK_OAK_FENCE_GATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"acacia_fence_gate","アカシアのフェンスゲート",Material.ACACIA_FENCE_GATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"redstone_block","レッドストーンブロック",Material.REDSTONE_BLOCK,0), MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "lever", "レバー", Material.LEVER, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "redstone_torch_on", "レッドストーントーチ", Material.REDSTONE_TORCH_ON, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "trap_door", "木のトラップドア", Material.TRAP_DOOR, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "iron_trapdoor", "鉄のトラップドア", Material.IRON_TRAPDOOR, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "gold_plate", "重量感圧版 (軽) ", Material.GOLD_PLATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "iron_plate", "重量感圧版 (重) ", Material.IRON_PLATE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "wood_door", "オークのドア", Material.WOOD_DOOR, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "spruce_door_item", "マツのドア", Material.SPRUCE_DOOR_ITEM, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "birch_door_item", "シラカバのドア", Material.BIRCH_DOOR_ITEM, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "jungle_door_item", "ジャングルのドア", Material.JUNGLE_DOOR_ITEM, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "acacia_door_item", "アカシアのドア", Material.ACACIA_DOOR_ITEM, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "dark_oak_door_item", "ダークオークのドア", Material.DARK_OAK_DOOR_ITEM, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "note_block", "音符ブロック", Material.NOTE_BLOCK, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "redstone_lamp_off", "レッドストーンランプ", Material.REDSTONE_LAMP_OFF, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "tripwire_hook", "トリップワイヤーフック", Material.TRIPWIRE_HOOK, 0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"redstone_torch_on","レッドストーントーチ",Material.REDSTONE_TORCH,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"trap_door","木のトラップドア",Material.OAK_TRAPDOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"iron_trapdoor","鉄のトラップドア",Material.IRON_TRAPDOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"gold_plate","重量感圧版 (軽) ",Material.LIGHT_WEIGHTED_PRESSURE_PLATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"iron_plate","重量感圧版 (重) ",Material.HEAVY_WEIGHTED_PRESSURE_PLATE,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"wood_door","オークのドア",Material.OAK_DOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"spruce_door_item","マツのドア",Material.SPRUCE_DOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"birch_door_item","シラカバのドア",Material.BIRCH_DOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"jungle_door_item","ジャングルのドア",Material.JUNGLE_DOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"acacia_door_item","アカシアのドア",Material.ACACIA_DOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"dark_oak_door_item","ダークオークのドア",Material.DARK_OAK_DOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"note_block","音符ブロック",Material.NOTE_BLOCK,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"redstone_lamp_off","レッドストーンランプ",Material.REDSTONE_LAMP,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"tripwire_hook","トリップワイヤーフック",Material.TRIPWIRE_HOOK,0), MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "dropper", "ドロッパー", Material.DROPPER, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "piston_sticky_base", "粘着ピストン", Material.PISTON_STICKY_BASE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "piston_base", "ピストン", Material.PISTON_BASE, 0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"piston_sticky_base","粘着ピストン",Material.STICKY_PISTON,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"piston_base","ピストン",Material.PISTON,0), MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "tnt", "TNT", Material.TNT, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "trapped_chest", "トラップチェスト", Material.TRAPPED_CHEST, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "daylight_detector", "日照センサー", Material.DAYLIGHT_DETECTOR, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "iron_door", "鉄のドア", Material.IRON_DOOR, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "diode", "レッドストーンリピーター", Material.DIODE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "dispenser", "ディスペンサー", Material.DISPENSER, 0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"trapped_chest","トラップチェスト",Material.TRAPPED_CHEST,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"daylight_detector","日照センサー",Material.DAYLIGHT_DETECTOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"iron_door","鉄のドア",Material.IRON_DOOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"diode","レッドストーンリピーター",Material.REPEATER,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"dispenser","ディスペンサー",Material.DISPENSER,0), MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "hopper", "ホッパー", Material.HOPPER, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "redstone_comparator", "レッドストーンコンパレーター", Material.REDSTONE_COMPARATOR, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "powered_rail", "パワードレール", Material.POWERED_RAIL, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "detector_rail", "ディテクターレール", Material.DETECTOR_RAIL, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "activator_rail", "アクティベーターレール", Material.ACTIVATOR_RAIL, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "boat", "オークのボート", Material.BOAT, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "spruce_boat", "マツのボート", Material.BOAT_SPRUCE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "birch_boat", "シラカバのボート", Material.BOAT_BIRCH, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "jungle_boat", "ジャングルのボート", Material.BOAT_JUNGLE, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "acacia_boat", "アカシアのボート", Material.BOAT_ACACIA, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "dark_oak_boat", "ダークオークのボート", Material.BOAT_DARK_OAK, 0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"redstone_comparator","レッドストーンコンパレーター",Material.COMPARATOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"powered_rail","パワードレール",Material.POWERED_RAIL,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"detector_rail","ディテクターレール",Material.DETECTOR_RAIL,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"activator_rail","アクティベーターレール",Material.ACTIVATOR_RAIL,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "boat", "オークのボート", Material.OAK_BOAT, 0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"spruce_boat","マツのボート",Material.SPRUCE_BOAT,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"birch_boat","シラカバのボート",Material.BIRCH_BOAT,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"jungle_boat","ジャングルのボート",Material.JUNGLE_BOAT,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"acacia_boat","アカシアのボート",Material.ACACIA_BOAT,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"dark_oak_boat","ダークオークのボート",Material.DARK_OAK_BOAT,0), MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "saddle", "サドル", Material.SADDLE, 0), MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "minecart", "トロッコ", Material.MINECART, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "chest_minecart", "チェスト付きトロッコ", Material.STORAGE_MINECART, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "furnace_minecart", "かまど付きトロッコ", Material.POWERED_MINECART, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "hopper_minecart", "ホッパー付きトロッコ", Material.HOPPER_MINECART, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "iron_horse_armor", "鉄の馬鎧", Material.IRON_BARDING, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "golden_horse_armor", "金の馬鎧", Material.GOLD_BARDING, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "diamond_horse_armor", "ダイヤの馬鎧", Material.DIAMOND_BARDING, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_13", "レコード", Material.GOLD_RECORD, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_cat", "レコード", Material.GREEN_RECORD, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_blocks", "レコード", Material.RECORD_3, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_chirp", "レコード", Material.RECORD_4, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_far", "レコード", Material.RECORD_5, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_mall", "レコード", Material.RECORD_6, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_mellohi", "レコード", Material.RECORD_7, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_stal", "レコード", Material.RECORD_8, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_strad", "レコード", Material.RECORD_9, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_ward", "レコード", Material.RECORD_10, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_11", "レコード", Material.RECORD_11, 0), - MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION, "record_wait", "レコード", Material.RECORD_12, 0) + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"chest_minecart","チェスト付きトロッコ",Material.CHEST_MINECART,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"furnace_minecart","かまど付きトロッコ",Material.FURNACE_MINECART,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"hopper_minecart","ホッパー付きトロッコ",Material.HOPPER_MINECART,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"iron_horse_armor","鉄の馬鎧",Material.IRON_HORSE_ARMOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"golden_horse_armor","金の馬鎧",Material.GOLDEN_HORSE_ARMOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"diamond_horse_armor","ダイヤの馬鎧",Material.DIAMOND_HORSE_ARMOR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_13","レコード",Material.MUSIC_DISC_13,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_cat","レコード",Material.MUSIC_DISC_CAT,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_blocks","レコード",Material.MUSIC_DISC_BLOCKS,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_chirp","レコード",Material.MUSIC_DISC_CHIRP,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_far","レコード",Material.MUSIC_DISC_FAR,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_mall","レコード",Material.MUSIC_DISC_MALL,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_mellohi","レコード",Material.MUSIC_DISC_MELLOHI,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_stal","レコード",Material.MUSIC_DISC_STAL,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_strad","レコード",Material.MUSIC_DISC_STRAD,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_ward","レコード",Material.MUSIC_DISC_WARD,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_11","レコード",Material.MUSIC_DISC_11,0), + MineStackObjectByMaterial(REDSTONE_AND_TRANSPORTATION,"record_wait","レコード",Material.MUSIC_DISC_WAIT,0) ) /** @@ -599,7 +600,7 @@ class BukkitMineStackObjectList[F[_]: Sync]( */ private val minestackBuiltinGachaPrizes: List[MineStackObjectGroup[ItemStack]] = leftElems( MineStackObjectByItemStack(GACHA_PRIZES, "gachaimo", None, hasNameLore = true, gachaPrizeAPI.staticGachaPrizeFactory.gachaRingo), - MineStackObjectByItemStack(GACHA_PRIZES, "exp_bottle", Some("エンチャントの瓶"), hasNameLore = false, new ItemStack(Material.EXP_BOTTLE, 1)) + MineStackObjectByItemStack(GACHA_PRIZES, "exp_bottle", Some("エンチャントの瓶"), hasNameLore = false, new ItemStack(Material.EXPERIENCE_BOTTLE)) ) // @formatter:on diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/PlayerPickupItemListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/PlayerPickupItemListener.scala index b97140073a..1de8cbafb3 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/PlayerPickupItemListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/minestack/bukkit/PlayerPickupItemListener.scala @@ -48,7 +48,6 @@ class PlayerPickupItemListener[F[_]: ConcurrentEffect, G[_]: ContextCoercion[*[_ item.remove() if (SeichiAssist.DEBUG) { player.sendMessage(RED.toString + "pick:" + itemStack.toString) - player.sendMessage(RED.toString + "pickDurability:" + itemStack.getDurability) } } .whenA(isSucceedTryIntoMineStack) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/openirontrapdoor/bukkit/listeners/PlayerClickIronTrapDoor.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/openirontrapdoor/bukkit/listeners/PlayerClickIronTrapDoor.scala index 1935fce2be..e4208cb298 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/openirontrapdoor/bukkit/listeners/PlayerClickIronTrapDoor.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/openirontrapdoor/bukkit/listeners/PlayerClickIronTrapDoor.scala @@ -2,11 +2,12 @@ package com.github.unchama.seichiassist.subsystems.openirontrapdoor.bukkit.liste import com.github.unchama.util.external.WorldGuardWrapper.isRegionMember import org.bukkit.Material +import org.bukkit.block.data.BlockData import org.bukkit.event.block.Action import org.bukkit.event.player.PlayerInteractEvent import org.bukkit.event.{EventHandler, Listener} import org.bukkit.inventory.EquipmentSlot -import org.bukkit.material.{MaterialData, Openable} +import org.bukkit.material.Openable object PlayerClickIronTrapDoor extends Listener { @EventHandler @@ -21,10 +22,15 @@ object PlayerClickIronTrapDoor extends Listener { ) return // TODO: 手に何も持っていない場合は機能するが、ブロックなどを持っている場合は機能しない(手に持っているものが設置できるもののときや弓矢は反応する) - val blockState = clickedBlock.getState - val materialData = blockState.getData.asInstanceOf[Openable] - materialData.setOpen(!materialData.isOpen) - blockState.setData(materialData.asInstanceOf[MaterialData]) - blockState.update() + val blockData = clickedBlock.getBlockData + blockData match { + case openable: Openable => + openable.setOpen(!openable.isOpen) + + val blockState = clickedBlock.getState + blockState.setBlockData(openable.asInstanceOf[BlockData]) + blockState.update() + case _ => + } } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/present/System.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/present/System.scala index f63133a04e..1c19d8c660 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/present/System.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/present/System.scala @@ -2,7 +2,6 @@ package com.github.unchama.seichiassist.subsystems.present import cats.effect.{ConcurrentEffect, IO} import com.github.unchama.concurrent.NonServerThreadContextShift -import com.github.unchama.generic.effect.unsafe.EffectEnvironment import com.github.unchama.minecraft.actions.OnMinecraftServerThread import com.github.unchama.seichiassist.domain.actions.UuidToLastSeenName import com.github.unchama.seichiassist.meta.subsystem.Subsystem @@ -12,8 +11,7 @@ import org.bukkit.command.TabExecutor object System { def wired[ConcurrentContext[_]: ConcurrentEffect: NonServerThreadContextShift]( - implicit environment: EffectEnvironment, - uuidToLastSeenName: UuidToLastSeenName[ConcurrentContext], + implicit uuidToLastSeenName: UuidToLastSeenName[ConcurrentContext], ioOnMainThread: OnMinecraftServerThread[IO] ): Subsystem[ConcurrentContext] = { implicit val repo: JdbcBackedPresentPersistence[ConcurrentContext] = diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/present/infrastructure/JdbcBackedPresentPersistence.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/present/infrastructure/JdbcBackedPresentPersistence.scala index 197c85ee08..394b95c437 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/present/infrastructure/JdbcBackedPresentPersistence.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/present/infrastructure/JdbcBackedPresentPersistence.scala @@ -22,7 +22,7 @@ class JdbcBackedPresentPersistence[F[_]: Sync] extends PresentPersistence[F, Ite DB.localTx { implicit session => // プレゼントのIDはauto_incrementなので明示的に指定しなくて良い sql"""INSERT INTO present (itemstack) VALUES ($stackAsBlob)""" - .updateAndReturnGeneratedKey + .updateAndReturnGeneratedKey() .apply() } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryItemData.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryItemData.scala index 259899bcf2..cc5bb366db 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryItemData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryItemData.scala @@ -3,7 +3,7 @@ package com.github.unchama.seichiassist.subsystems.seasonalevents.anniversary import com.github.unchama.itemstackbuilder.{SkullItemStackBuilder, SkullOwnerTextureValue} import com.github.unchama.seichiassist.subsystems.seasonalevents.anniversary.Anniversary.ANNIVERSARY_COUNT import com.github.unchama.seichiassist.util.EnchantNameToJapanese -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.Bukkit import org.bukkit.ChatColor._ import org.bukkit.Material._ @@ -36,13 +36,13 @@ object AnniversaryItemData { .map(lore => s"$RESET$GRAY$lore") .asJava - val itemMeta = Bukkit.getItemFactory.getItemMeta(SAPLING).tap { meta => + val itemMeta = Bukkit.getItemFactory.getItemMeta(OAK_SAPLING).tap { meta => import meta._ setDisplayName(s"$GOLD${BOLD}「気になる木」の苗") setLore(loreList) } - val itemStack = new ItemStack(SAPLING, 1) + val itemStack = new ItemStack(OAK_SAPLING, 1) itemStack.setItemMeta(itemMeta) new NBTItem(itemStack) @@ -64,25 +64,29 @@ object AnniversaryItemData { COAL_BLOCK, DIAMOND_BLOCK, DRAGON_EGG, - FENCE, + OAK_FENCE, + JUNGLE_FENCE, + ACACIA_FENCE, + BIRCH_FENCE, + DARK_OAK_FENCE, FLOWER_POT, GLOWSTONE, GOLD_BLOCK, GRASS, ICE, IRON_BLOCK, - MELON_BLOCK, + MELON, NETHER_BRICK, QUARTZ_BLOCK, SAND, SPONGE, - WORKBENCH + CRAFTING_TABLE ) val strangeSaplingSiinaRate = 0.0008 def isStrangeSapling(item: ItemStack): Boolean = - item != null && item.getType == SAPLING && { + item != null && item.getType == OAK_SAPLING && { new NBTItem(item).getByte(NBTTagConstants.typeIdTag) == 1 } @@ -135,14 +139,15 @@ object AnniversaryItemData { val loreList = { val enchDescription = enchantments.map { - case (ench, lvl) => s"$GRAY${EnchantNameToJapanese.getEnchantName(ench.getName, lvl)}" + case (ench, lvl) => + s"$GRAY${EnchantNameToJapanese.getEnchantName(ench.getKey.getKey, lvl)}" }.toList val lore = List("", "特殊なエンチャントが付与されています").map(lore => s"$YELLOW$lore") enchDescription ::: lore }.map(lore => s"$RESET$lore").asJava - val itemMeta = Bukkit.getItemFactory.getItemMeta(DIAMOND_SPADE).tap { meta => + val itemMeta = Bukkit.getItemFactory.getItemMeta(DIAMOND_SHOVEL).tap { meta => import meta._ setDisplayName(s"$GOLD${BOLD}SCARLET") setLore(loreList) @@ -150,7 +155,7 @@ object AnniversaryItemData { enchantments.foreach { case (ench, lvl) => addEnchant(ench, lvl, true) } } - val itemStack = new ItemStack(DIAMOND_SPADE, 1) + val itemStack = new ItemStack(DIAMOND_SHOVEL, 1) itemStack.setItemMeta(itemMeta) new NBTItem(itemStack) @@ -162,7 +167,7 @@ object AnniversaryItemData { } def isAnniversaryShovel(item: ItemStack): Boolean = - item != null && item.getType == DIAMOND_SPADE && { + item != null && item.getType == DIAMOND_SHOVEL && { new NBTItem(item).getByte(NBTTagConstants.typeIdTag) == 3 } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala index ff9311350f..febf0366e1 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/anniversary/AnniversaryListener.scala @@ -91,7 +91,7 @@ class AnniversaryListener( // Y座標を下に動かして(木の上方から)オークの木の頂点を探し、そのブロックを置き換える (10 to 0 by -1) .map(placedBlock.getRelative(0, _, 0)) - .find(block => block.getType == Material.LOG || block.getType == Material.LEAVES) + .find(block => block.getType == Material.OAK_LOG || block.getType == Material.OAK_LEAVES) .foreach(replaceBlockOnTreeTop(_, event.getPlayer.getName)) } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemData.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemData.scala index 44b8541612..75a1564a03 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemData.scala @@ -1,7 +1,7 @@ package com.github.unchama.seichiassist.subsystems.seasonalevents.christmas import com.github.unchama.seichiassist.subsystems.seasonalevents.christmas.Christmas.EVENT_YEAR -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.Color.fromRGB import org.bukkit.enchantments.Enchantment @@ -197,7 +197,7 @@ object ChristmasItemData { s"$RED${UNDERLINE}スポーン地点にいる村人に欲しい物を詰めてもらおう!" ).map(str => s"$RESET$str").asJava - val itemMeta = Bukkit.getItemFactory.getItemMeta(Material.INK_SACK).tap { meta => + Bukkit.getItemFactory.getItemMeta(Material.INK_SAC).tap { meta => import meta._ setDisplayName(s"${AQUA}靴下(${EVENT_YEAR}年)") setLore(loreList) @@ -206,11 +206,7 @@ object ChristmasItemData { } // 赤の染料 - val itemStack = new ItemStack(Material.INK_SACK, 1).tap { itemStack => - import itemStack._ - setDurability(1.toShort) - setItemMeta(itemMeta) - } + val itemStack = new ItemStack(Material.RED_DYE, 1) itemStack } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemListener.scala index 3a9efe1632..a2b12ad3bb 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/christmas/ChristmasItemListener.scala @@ -13,7 +13,7 @@ import com.github.unchama.seichiassist.util.InventoryOperations.{ isPlayerInventoryFull, removeItemfromPlayerInventory } -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.entity.EntityType._ import org.bukkit.entity.{EntityType, LivingEntity, Player} @@ -57,7 +57,7 @@ class ChristmasItemListener[F[_], G[_]: SyncEffect](instance: JavaPlugin)( val rand = new Random().nextDouble() val potionEffectType = if (rand > 0.5) PotionEffectType.LUCK else PotionEffectType.UNLUCK - player.addPotionEffect(new PotionEffect(potionEffectType, 20 * 30, 0), true) + player.addPotionEffect(new PotionEffect(potionEffectType, 20 * 30, 0)) removeItemfromPlayerInventory(player.getInventory, item, 1) @@ -74,7 +74,7 @@ class ChristmasItemListener[F[_], G[_]: SyncEffect](instance: JavaPlugin)( val rand = new Random().nextDouble() val potionEffectType = if (rand > 0.5) PotionEffectType.SPEED else PotionEffectType.SLOW - event.getPlayer.addPotionEffect(new PotionEffect(potionEffectType, 20 * 30, 0), true) + event.getPlayer.addPotionEffect(new PotionEffect(potionEffectType, 20 * 30, 0)) } @EventHandler @@ -117,7 +117,7 @@ class ChristmasItemListener[F[_], G[_]: SyncEffect](instance: JavaPlugin)( GUARDIAN, HUSK, MAGMA_CUBE, - PIG_ZOMBIE, + ZOMBIFIED_PIGLIN, SHULKER, SILVERFISH, SKELETON, @@ -186,7 +186,7 @@ class ChristmasItemListener[F[_], G[_]: SyncEffect](instance: JavaPlugin)( addItem(player, christmasSock) player.sendMessage(s"$AQUA「靴下」を見つけたよ!") } - player.playSound(player.getLocation, Sound.BLOCK_NOTE_HARP, 3.0f, 1.0f) + player.playSound(player.getLocation, Sound.BLOCK_NOTE_BLOCK_HARP, 3.0f, 1.0f) } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemData.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemData.scala index 11ad0aeaf1..62e86be13d 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemData.scala @@ -1,7 +1,7 @@ package com.github.unchama.seichiassist.subsystems.seasonalevents.halloween import com.github.unchama.seichiassist.util.EnchantNameToJapanese -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.Color.fromRGB import org.bukkit.enchantments.Enchantment @@ -82,7 +82,7 @@ object HalloweenItemData { val year = Calendar.getInstance().get(Calendar.YEAR) val enchDescription = enchantments.map { case (ench, lvl) => - s"$RESET$GRAY${EnchantNameToJapanese.getEnchantName(ench.getName, lvl)}" + s"$RESET$GRAY${EnchantNameToJapanese.getEnchantName(ench.getKey.toString, lvl)}" }.toList val lore = List( "", diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemListener.scala index 00c6368525..7e379643b9 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/halloween/HalloweenItemListener.scala @@ -9,7 +9,7 @@ import com.github.unchama.seichiassist.subsystems.seasonalevents.halloween.Hallo isHalloweenHoe, isHalloweenPotion } -import com.github.unchama.util.external.WorldGuardWrapper.isRegionMember +import com.github.unchama.util.external.WorldGuardWrapper import org.bukkit.ChatColor.{DARK_GREEN, LIGHT_PURPLE, UNDERLINE} import org.bukkit.Material import org.bukkit.block.Block @@ -40,7 +40,7 @@ object HalloweenItemListener extends Listener { // 10分 event .getPlayer - .addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 20 * 60 * 10, 0), true) + .addPotionEffect(new PotionEffect(PotionEffectType.SATURATION, 20 * 60 * 10, 0)) } } @@ -62,19 +62,18 @@ object HalloweenItemListener extends Listener { val player = event.getPlayer // まず、Playerが自分でクリックしたブロックについて判定する if (!canBeReplacedWithSoil(player, clickedBlock)) return - clickedBlock.setType(Material.SOIL) + clickedBlock.setType(Material.FARMLAND) // 次にクリックされたブロックから半径4ブロック以内のブロックについて判定する for (relX <- -4 to 4; relZ <- -4 to 4) { val block = clickedBlock.getRelative(relX, 0, relZ) - if (block != null && canBeReplacedWithSoil(player, block)) block.setType(Material.SOIL) + if (block != null && canBeReplacedWithSoil(player, block)) + block.setType(Material.FARMLAND) } } private def canBeReplacedWithSoil(player: Player, block: Block) = { - (block.getType == Material.DIRT || block.getType == Material.GRASS) && isRegionMember( - player, - block.getLocation - ) + (block.getType == Material.FARMLAND || block.getType == Material.GRASS) && WorldGuardWrapper + .isRegionMember(player, block.getLocation) } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearItemData.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearItemData.scala index 92ff0f8111..546a083420 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearItemData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearItemData.scala @@ -6,7 +6,7 @@ import com.github.unchama.seichiassist.subsystems.seasonalevents.newyear.NewYear EVENT_YEAR, NEW_YEAR_EVE } -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.enchantments.Enchantment import org.bukkit.inventory.{ItemFlag, ItemStack} @@ -43,7 +43,7 @@ object NewYearItemData { .tap { item => import item._ setByte(NBTTagConstants.typeIdTag, 1.toByte) - setObject(NBTTagConstants.expiryDateTag, END_DATE) + setLong(NBTTagConstants.expiryDateTag, END_DATE.toEpochDay) } .pipe(_.getItem) } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala index a09d4ac3a8..89f53e1a2c 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/newyear/NewYearListener.scala @@ -20,7 +20,7 @@ import com.github.unchama.targetedeffect.SequentialEffect import com.github.unchama.targetedeffect.TargetedEffect.emptyEffect import com.github.unchama.targetedeffect.commandsender.MessageEffect import com.github.unchama.targetedeffect.player.FocusedSoundEffect -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.Sound import org.bukkit.entity.Player @@ -91,7 +91,7 @@ class NewYearListener[F[_]: ConcurrentEffect: NonServerThreadContextShift, G[_]: val player = event.getPlayer val today = LocalDate.now() val expiryDate = - new NBTItem(item).getObject(NBTTagConstants.expiryDateTag, classOf[LocalDate]) + LocalDate.ofEpochDay(new NBTItem(item).getLong(NBTTagConstants.expiryDateTag)) if (today.isBefore(expiryDate) || today.isEqual(expiryDate)) { // マナを10%回復する manaApi.manaAmount(player).restoreFraction(0.1).runSync[SyncIO].unsafeRunSync() @@ -117,7 +117,7 @@ class NewYearListener[F[_]: ConcurrentEffect: NonServerThreadContextShift, G[_]: addItem(player, newYearBag) player.sendMessage(s"$AQUA「お年玉袋」を見つけたよ!") } - player.playSound(player.getLocation, Sound.BLOCK_NOTE_HARP, 3.0f, 1.0f) + player.playSound(player.getLocation, Sound.BLOCK_NOTE_BLOCK_HARP, 3.0f, 1.0f) } } } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiItemData.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiItemData.scala index d5a72532db..b0e0e3db04 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiItemData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiItemData.scala @@ -1,7 +1,7 @@ package com.github.unchama.seichiassist.subsystems.seasonalevents.seizonsiki import com.github.unchama.seichiassist.subsystems.seasonalevents.seizonsiki.Seizonsiki.END_DATE -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.inventory.ItemStack import org.bukkit.{Bukkit, Material} @@ -36,7 +36,7 @@ object SeizonsikiItemData { .tap { item => import item._ setByte(NBTTagConstants.typeIdTag, 1.toByte) - setObject(NBTTagConstants.expiryDateTag, END_DATE) + setLong(NBTTagConstants.expiryDateTag, END_DATE.toEpochDay) } .pipe(_.getItem) } diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiListener.scala index e23d9fa1c2..2814570d13 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/seizonsiki/SeizonsikiListener.scala @@ -8,7 +8,7 @@ import com.github.unchama.seichiassist.subsystems.seasonalevents.seizonsiki.Seiz import com.github.unchama.seichiassist.subsystems.seasonalevents.seizonsiki.SeizonsikiItemData._ import com.github.unchama.seichiassist.util.SendMessageEffect.sendMessageToEveryoneIgnoringPreference import com.github.unchama.seichiassist.util.EntityDeathCause.isEntityKilledByThornsEnchant -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor.{DARK_GREEN, LIGHT_PURPLE, UNDERLINE} import org.bukkit.Sound import org.bukkit.entity.{EntityType, Player} @@ -56,7 +56,7 @@ class SeizonsikiListener[F[_], G[_]: SyncEffect](implicit manaApi: ManaWriteApi[ val player = event.getPlayer val today = LocalDate.now() - val exp = new NBTItem(item).getObject(NBTTagConstants.expiryDateTag, classOf[LocalDate]) + val exp = LocalDate.ofEpochDay(new NBTItem(item).getLong(NBTTagConstants.expiryDateTag)) if (today.isBefore(exp)) { // マナを10%回復する manaApi.manaAmount(player).restoreFraction(0.1).runSync[SyncIO].unsafeRunSync() diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineItemData.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineItemData.scala index 80a4411381..f1b2d369a2 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineItemData.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineItemData.scala @@ -5,13 +5,13 @@ import com.github.unchama.seichiassist.subsystems.seasonalevents.valentine.Valen EVENT_DURATION, EVENT_YEAR } -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.inventory.ItemStack import org.bukkit.inventory.meta.SkullMeta import org.bukkit.{Bukkit, Material} -import java.time.LocalDateTime +import java.time.{LocalDateTime, ZoneOffset} import java.util.UUID import scala.jdk.CollectionConverters._ import scala.util.chaining._ @@ -43,9 +43,12 @@ object ValentineItemData { */ def isUsableCookie(item: ItemStack): Boolean = { val now = LocalDateTime.now() - val exp = Option( - new NBTItem(item).getObject(NBTTagConstants.expiryDateTimeTag, classOf[LocalDateTime]) - ).getOrElse(return false) + val exp = LocalDateTime.ofEpochSecond( + Option(new NBTItem(item).getLong(NBTTagConstants.expiryDateTimeTag)) + .getOrElse(return false), + 0, + ZoneOffset.of("+9") + ) now.isBefore(exp) || now.isEqual(exp) } @@ -74,7 +77,10 @@ object ValentineItemData { .tap { item => import item._ setByte(NBTTagConstants.typeIdTag, droppedCookieTypeId.toByte) - setObject(NBTTagConstants.expiryDateTimeTag, EVENT_DURATION.to) + setLong( + NBTTagConstants.expiryDateTimeTag, + EVENT_DURATION.to.toEpochSecond(ZoneOffset.of("+9")) + ) } .pipe(_.getItem) } @@ -113,8 +119,11 @@ object ValentineItemData { .tap { item => import item._ setByte(NBTTagConstants.typeIdTag, giftedCookieTypeId.toByte) - setObject(NBTTagConstants.expiryDateTimeTag, EVENT_DURATION.to) - setObject(NBTTagConstants.producerUuidTag, playerUuid) + setLong( + NBTTagConstants.expiryDateTimeTag, + EVENT_DURATION.to.toEpochSecond(ZoneOffset.of("+9")) + ) + setUUID(NBTTagConstants.producerUuidTag, playerUuid) setString(NBTTagConstants.producerNameTag, playerName) } .pipe(_.getItem) @@ -128,7 +137,7 @@ object ValentineItemData { * @return UUIDが設定されていれば[[Some]]、なければ[[None]] */ def ownerOf(item: ItemStack): Option[UUID] = - Option(new NBTItem(item).getObject(NBTTagConstants.producerUuidTag, classOf[UUID])) + Option(new NBTItem(item).getOrNull[UUID](NBTTagConstants.producerUuidTag, classOf[UUID])) def deathMessages(playerName: String, cookieProducerName: String): Seq[String] = Seq( s"${playerName}は${cookieProducerName}のチョコチップクッキーを食べた!猟奇的な味だった。", diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala index 689ed38b76..e3a7f91c50 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/seasonalevents/valentine/ValentineListener.scala @@ -14,7 +14,7 @@ import com.github.unchama.seichiassist.util.SendMessageEffect.sendMessageToEvery import com.github.unchama.targetedeffect.commandsender.MessageEffect import com.github.unchama.targetedeffect.player.FocusedSoundEffect import com.github.unchama.targetedeffect.{SequentialEffect, TargetedEffect} -import de.tr7zw.itemnbtapi.NBTItem +import de.tr7zw.nbtapi.NBTItem import org.bukkit.ChatColor._ import org.bukkit.Sound import org.bukkit.attribute.Attribute @@ -56,7 +56,7 @@ class ValentineListener[F[_]: ConcurrentEffect: NonServerThreadContextShift]( val damager = event.getDamager if (damager == null || damager.getType != EntityType.CREEPER) return - val excludedMonsters = Set(EntityType.WITCH, EntityType.PIG_ZOMBIE) + val excludedMonsters = Set(EntityType.WITCH, EntityType.ZOMBIFIED_PIGLIN) event.getEntity match { case damaged: Monster if !excludedMonsters.contains(damaged.getType) => val entityMaxHealth = damaged.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gachatrade/bukkit/listeners/GachaTradeListener.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gachatrade/bukkit/listeners/GachaTradeListener.scala index 8d1c69fb52..4e7f678df9 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gachatrade/bukkit/listeners/GachaTradeListener.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gachatrade/bukkit/listeners/GachaTradeListener.scala @@ -42,7 +42,7 @@ class GachaTradeListener[F[_]: ConcurrentEffect, G[_]: ContextCoercion[*[_], F]] // インベントリサイズが6列でない時終了 if (inventory.row != 6) return - if (inventory.getTitle != s"$LIGHT_PURPLE${BOLD}交換したい景品を入れてください") return + if (event.getView.getTitle != s"$LIGHT_PURPLE${BOLD}交換したい景品を入れてください") return // 交換後の情報 val tradedInformation = diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gttosiina/bukkit/listeners/GtToSiinaringo.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gttosiina/bukkit/listeners/GtToSiinaringo.scala index 4d6d14d755..8fd182471a 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gttosiina/bukkit/listeners/GtToSiinaringo.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/tradesystems/subsystems/gttosiina/bukkit/listeners/GtToSiinaringo.scala @@ -36,7 +36,7 @@ class GtToSiinaringo[F[_]: ConcurrentEffect]( // インベントリサイズが4列でない時終了 if (inventory.row != 4) return - if (inventory.getTitle != s"$GOLD${BOLD}椎名林檎と交換したい景品を入れてネ") return + if (event.getView.getTitle != s"$GOLD${BOLD}椎名林檎と交換したい景品を入れてネ") return // 交換後の情報 val tradedInformation = new BukkitTrade(name, gachaPrizeAPI.listOfNow.toIO.unsafeRunSync()) diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/FairyAPI.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/FairyAPI.scala index 8127d7192f..1a037693bb 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/FairyAPI.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/FairyAPI.scala @@ -55,7 +55,7 @@ trait FairyReadAPI[F[_], G[_], Player] { /** * @return 妖精に食べさせたりんごの量の上位`top`件を返す作用 */ - def rankingByMostConsumedApple(top: Int): F[Vector[AppleConsumeAmountRank]] + def rankingByMostConsumedApple(top: Int): F[Vector[Option[AppleConsumeAmountRank]]] /** * @return 妖精が食べたりんごの合計数を返す作用 diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/System.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/System.scala index 72d03d92e0..f02daa6925 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/System.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/System.scala @@ -105,7 +105,7 @@ object System { override def rankingByMostConsumedApple( top: Int - ): IO[Vector[AppleConsumeAmountRank]] = + ): IO[Vector[Option[AppleConsumeAmountRank]]] = persistence.fetchMostConsumedApplePlayersByFairy(top) override def totalConsumedApple: IO[AppleAmount] = diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/domain/FairyPersistence.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/domain/FairyPersistence.scala index 60de8f9490..9331e34689 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/domain/FairyPersistence.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/domain/FairyPersistence.scala @@ -91,7 +91,7 @@ trait FairyPersistence[F[_]] { * @param top 最上位から何番目まで取得するか件数を指定する。0以下であってはならない。 * @return 指定した件数が要素数となり、その並びが消費量の降順になっているような順序つきのコレクションを返す作用。 */ - def fetchMostConsumedApplePlayersByFairy(top: Int): F[Vector[AppleConsumeAmountRank]] + def fetchMostConsumedApplePlayersByFairy(top: Int): F[Vector[Option[AppleConsumeAmountRank]]] /** * @return 妖精が今まで食べたりんごの合計数を返す作用 diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/infrastructure/JdbcFairyPersistence.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/infrastructure/JdbcFairyPersistence.scala index f7f39eb8f9..1e86fc4584 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/infrastructure/JdbcFairyPersistence.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairy/infrastructure/JdbcFairyPersistence.scala @@ -161,12 +161,11 @@ class JdbcFairyPersistence[F[_]: Sync] extends FairyPersistence[F] { ): F[Option[AppleConsumeAmountRank]] = Sync[F].delay { DB.readOnly { implicit session => - sql"""SELECT vote_fairy.uuid AS uuid, name, given_apple_amount, - | RANK() OVER(ORDER BY given_apple_amount DESC) AS rank + sql"""SELECT vote_fairy.uuid AS uuid,name,given_apple_amount,COUNT(*) AS rank | FROM vote_fairy | INNER JOIN playerdata | ON (playerdata.uuid = vote_fairy.uuid) - | ORDER BY rank""" + | ORDER BY rank DESC;""" .stripMargin .map(rs => rs.string("uuid") -> AppleConsumeAmountRank( @@ -184,20 +183,19 @@ class JdbcFairyPersistence[F[_]: Sync] extends FairyPersistence[F] { override def fetchMostConsumedApplePlayersByFairy( top: Int - ): F[Vector[AppleConsumeAmountRank]] = + ): F[Vector[Option[AppleConsumeAmountRank]]] = Sync[F].delay { DB.readOnly { implicit session => - sql"""SELECT name, given_apple_amount, RANK() OVER(ORDER BY given_apple_amount DESC) AS rank FROM vote_fairy - | INNER JOIN playerdata ON (vote_fairy.uuid = playerdata.uuid) - | ORDER BY rank - | LIMIT $top;""" + sql"""SELECT name,given_apple_amount,COUNT(*) AS rank FROM vote_fairy + | INNER JOIN playerdata ON (vote_fairy.uuid = playerdata.uuid) + | ORDER BY rank DESC LIMIT $top;""" .stripMargin .map { rs => - val name = rs.string("name") - val rank = rs.int("rank") - val givenAppleAmount = rs.int("given_apple_amount") - - AppleConsumeAmountRank(name, rank, AppleAmount(givenAppleAmount)) + for { + name <- rs.stringOpt("name") + rank <- rs.intOpt("rank") + givenAppleAmount <- rs.intOpt("given_apple_amount") + } yield AppleConsumeAmountRank(name, rank, AppleAmount(givenAppleAmount)) } .toList() .apply() diff --git a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairyspeech/bukkit/BukkitFairySpeechGateway.scala b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairyspeech/bukkit/BukkitFairySpeechGateway.scala index 5cee695de1..9f6b05cb6c 100644 --- a/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairyspeech/bukkit/BukkitFairySpeechGateway.scala +++ b/src/main/scala/com/github/unchama/seichiassist/subsystems/vote/subsystems/fairyspeech/bukkit/BukkitFairySpeechGateway.scala @@ -24,11 +24,11 @@ class BukkitFairySpeechGateway[F[_]: Sync: Timer](player: Player) import cats.implicits._ override def playSpeechSound: F[Unit] = for { - _ <- FocusedSoundEffectF(Sound.BLOCK_NOTE_PLING, 2.0f, 1.0f).run(player) + _ <- FocusedSoundEffectF(Sound.BLOCK_NOTE_BLOCK_PLING, 2.0f, 1.0f).run(player) _ <- Timer[F].sleep(100.millis) - _ <- FocusedSoundEffectF(Sound.BLOCK_NOTE_PLING, 2.0f, 1.5f).run(player) + _ <- FocusedSoundEffectF(Sound.BLOCK_NOTE_BLOCK_PLING, 2.0f, 1.5f).run(player) _ <- Timer[F].sleep(100.millis) - _ <- FocusedSoundEffectF(Sound.BLOCK_NOTE_PLING, 2.0f, 2.0f).run(player) + _ <- FocusedSoundEffectF(Sound.BLOCK_NOTE_BLOCK_PLING, 2.0f, 2.0f).run(player) } yield {} } diff --git a/src/main/scala/com/github/unchama/seichiassist/task/GiganticBerserkTask.scala b/src/main/scala/com/github/unchama/seichiassist/task/GiganticBerserkTask.scala index 37ee8ffdb4..ec1421927d 100644 --- a/src/main/scala/com/github/unchama/seichiassist/task/GiganticBerserkTask.scala +++ b/src/main/scala/com/github/unchama/seichiassist/task/GiganticBerserkTask.scala @@ -35,7 +35,7 @@ class GiganticBerserkTask { // 確率でマナを回復させる val d = Math.random - if (d < playerdata.giganticBerserk.manaRegenerationProbability) { + if (d < playerdata.giganticBerserk.manaRegenerationProbability()) { if (playerdata.giganticBerserk.reachedLimit()) { manaApi.manaAmount(p).restoreCompletely.unsafeRunSync() player.sendMessage( @@ -92,7 +92,7 @@ class GiganticBerserkTask { val program = List( DiscordNotificationAPI[F].sendPlainText(messageWithoutColor).toIO, IO { - SendSoundEffect.sendEverySound(Sound.ENTITY_ENDERDRAGON_DEATH, 1, 1.2f) + SendSoundEffect.sendEverySound(Sound.ENTITY_ENDER_DRAGON_DEATH, 1, 1.2f) SendMessageEffect.sendMessageToEveryoneIgnoringPreference(messageWithColor) } ).sequence diff --git a/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala b/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala index d5dd66c7fb..276f80b024 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala @@ -18,18 +18,17 @@ import com.github.unchama.seichiassist.subsystems.breakcount.domain.CardinalDire import com.github.unchama.seichiassist.subsystems.breakcount.domain.level.SeichiExpAmount import com.github.unchama.targetedeffect.player.ActionBarMessageEffect import com.github.unchama.util.bukkit.ItemStackUtil -import com.github.unchama.util.external.ExternalPlugins +import com.github.unchama.util.external.{ExternalPlugins, WorldGuardWrapper} import org.bukkit.ChatColor._ import org.bukkit.World.Environment import org.bukkit._ import org.bukkit.block.Block -import org.bukkit.enchantments.Enchantment import org.bukkit.entity.{Entity, EntityType, Player} import org.bukkit.inventory.ItemStack -import org.bukkit.material.Dye import java.util.Random import java.util.stream.IntStream +import scala.jdk.CollectionConverters._ object BreakUtil { @@ -65,7 +64,7 @@ object BreakUtil { val playerData = SeichiAssist.playermap(player.getUniqueId) // 壊されるブロックがワールドガード範囲だった場合処理を終了 - if (!ExternalPlugins.getWorldGuard.canBuild(player, checkTarget.getLocation)) { + if (!WorldGuardWrapper.canBuild(player, checkTarget.getLocation)) { if (playerData.settings.shouldDisplayWorldGuardLogs) { player.sendMessage(s"${RED}ワールドガードで保護されています。") } @@ -101,7 +100,7 @@ object BreakUtil { } val isBlockProtectedSlab = - checkTarget.getType == Material.STEP && + checkTarget.getType == Material.STONE_SLAB && checkTarget.getY == halfBlockLayerYCoordinate && checkTarget.getData == 0.toByte @@ -184,181 +183,6 @@ object BreakUtil { } - /** - * ブロックをツールで破壊した時のドロップを計算する - * - * Bukkit/Spigotが提供するBlock.getDropsは信頼できる値を返さない。 本来はNMSのメソッドを呼ぶのが確実らしいが、一時的な実装として使用している。 参考: - * https://www.spigotmc.org/threads/getdrops-on-crops-not-functioning-as-expected.167751/#post-1779788 - */ - def dropItemOnTool( - tool: BreakTool - )(blockInformation: (Location, Material, Byte)): Option[BlockBreakResult] = { - val fortuneLevel = tool.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) - - val (blockLocation, blockMaterial, blockData) = blockInformation - - blockMaterial match { - case Material.GRASS_PATH | Material.SOIL => - return Some(BlockBreakResult.ItemDrop(new ItemStack(Material.DIRT))) - case Material.MOB_SPAWNER | Material.ENDER_PORTAL_FRAME | Material.ENDER_PORTAL => - return None - case _ => - } - - val rand = Math.random() - val bonus = Math.max(1, rand * (fortuneLevel + 2)).toInt - - val blockDataLeast4Bits = (blockData & 0x0f).toByte - val b_tree = (blockData & 0x03).toByte - - val silkTouch = tool.getEnchantmentLevel(Enchantment.SILK_TOUCH) - - if (silkTouch > 0) { - // シルクタッチの処理 - Some { - BlockBreakResult.ItemDrop { - blockMaterial match { - case Material.GLOWING_REDSTONE_ORE => - new ItemStack(Material.REDSTONE_ORE) - case Material.LOG | Material.LOG_2 | Material.LEAVES | Material.LEAVES_2 => - new ItemStack(blockMaterial, 1, b_tree.toShort) - case Material.MONSTER_EGGS => - new ItemStack(Material.STONE) - case _ => - new ItemStack(blockMaterial, 1, blockDataLeast4Bits.toShort) - } - } - } - } else if (fortuneLevel > 0 && MaterialSets.fortuneMaterials.contains(blockMaterial)) { - // 幸運の処理 - Some { - BlockBreakResult.ItemDrop { - blockMaterial match { - case Material.COAL_ORE => - new ItemStack(Material.COAL, bonus) - case Material.DIAMOND_ORE => - new ItemStack(Material.DIAMOND, bonus) - case Material.EMERALD_ORE => - new ItemStack(Material.EMERALD, bonus) - case Material.QUARTZ_ORE => - new ItemStack(Material.QUARTZ, bonus) - // レッドストーン鉱石, グロウストーン, スイカブロック, シーランタン, ラピスラズリ鉱石は、 - // ドロップアイテムの個数を求める計算が通常の鉱石の扱いと異なるため、特別な処理が必要である。 - case Material.REDSTONE_ORE | Material.GLOWING_REDSTONE_ORE => - val withBonus = (rand * (fortuneLevel + 2) + 4).toInt - new ItemStack(Material.GLOWSTONE_DUST, withBonus) - case Material.LAPIS_ORE => - val dye = new Dye() - dye.setColor(DyeColor.BLUE) - // 幸運エンチャントなしで掘った時のアイテムが得られる個数(4~9)に、幸運ボーナスを掛ける - val withBonus = (rand * 6 + 4).toInt * bonus - dye.toItemStack(withBonus) - // グロウストーンは幸運エンチャントがついていると高確率でより多くのダストをドロップする - // しかし、最大でも4個までしかドロップしない - case Material.GLOWSTONE => - val withBonus = (rand * (fortuneLevel + 3) + 2).toInt - val amount = if (withBonus > 4) 4 else withBonus - new ItemStack(Material.GLOWSTONE_DUST, amount) - // 同様に、メロンブロックは幸運エンチャントがついている場合、9個までしかドロップしない - case Material.MELON_BLOCK => - val withBonus = (rand * (fortuneLevel + 5) + 3).toInt - val amount = if (withBonus > 9) 9 else withBonus - new ItemStack(Material.MELON, amount) - case Material.SEA_LANTERN => - val withBonus = (rand * (fortuneLevel + 2) + 2).toInt - val amount = if (withBonus > 5) 5 else withBonus - new ItemStack(Material.PRISMARINE_CRYSTALS, amount) - case _ => - // unreachable - new ItemStack(blockMaterial, bonus) - } - } - } - } else { - // シルク幸運なしの処理 - blockMaterial match { - case Material.COAL_ORE => - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.COAL))) - case Material.DIAMOND_ORE => - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.DIAMOND))) - case Material.LAPIS_ORE => - val dye = new Dye() - dye.setColor(DyeColor.BLUE) - Some(BlockBreakResult.ItemDrop(dye.toItemStack((rand * 6 + 4).toInt))) - case Material.EMERALD_ORE => - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.EMERALD))) - case Material.REDSTONE_ORE | Material.GLOWING_REDSTONE_ORE => - Some( - BlockBreakResult.ItemDrop(new ItemStack(Material.REDSTONE, ((rand * 2) + 4).toInt)) - ) - case Material.QUARTZ_ORE => - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.QUARTZ))) - // グロウストーンは、2から4個のグロウストーンダストをドロップする - case Material.GLOWSTONE => - Some( - BlockBreakResult - .ItemDrop(new ItemStack(Material.GLOWSTONE_DUST, (rand * 3 + 2).toInt)) - ) - // スイカブロックは、3から7個のスイカをドロップする - case Material.MELON_BLOCK => - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.MELON, (rand * 5 + 3).toInt))) - // シーランタンは、2から3個のプリズマリンクリスタルをドロップする - case Material.SEA_LANTERN => - Some( - BlockBreakResult - .ItemDrop(new ItemStack(Material.PRISMARINE_CRYSTALS, (rand * 2 + 2).toInt)) - ) - case Material.STONE => - Some { - BlockBreakResult.ItemDrop { - if (blockData.toInt == 0x00) { - // 焼き石の処理 - new ItemStack(Material.COBBLESTONE) - } else { - // 他の石の処理 - new ItemStack(blockMaterial, 1, blockDataLeast4Bits.toShort) - } - } - } - case Material.GRASS => - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.DIRT))) - case Material.GRAVEL => - val p = fortuneLevel match { - case 1 => 0.14 - case 2 => 0.25 - case 3 => 1.00 - case _ => 0.1 - } - val dropMaterial = if (p > rand) Material.FLINT else Material.GRAVEL - - Some(BlockBreakResult.ItemDrop(new ItemStack(dropMaterial, bonus))) - case Material.LEAVES | Material.LEAVES_2 => - None - case Material.CLAY => - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.CLAY_BALL, 4))) - case Material.MONSTER_EGGS => - Some(BlockBreakResult.SpawnSilverFish(blockLocation)) - case Material.LOG | Material.LOG_2 => - Some(BlockBreakResult.ItemDrop(new ItemStack(blockMaterial, 1, b_tree.toShort))) - case Material.WOOD_STEP | Material.STEP | Material.STONE_SLAB2 - if (blockDataLeast4Bits & 8) != 0 => - // 上付きハーフブロックをそのままドロップするとmissing textureとして描画されるため、下付きの扱いとする - Some( - BlockBreakResult - .ItemDrop(new ItemStack(blockMaterial, 1, (blockDataLeast4Bits & 7).toShort)) - ) - case Material.BOOKSHELF => - // 本棚を破壊すると、本が3つドロップする - Some(BlockBreakResult.ItemDrop(new ItemStack(Material.BOOK, 3))) - case _ => - Some( - BlockBreakResult - .ItemDrop(new ItemStack(blockMaterial, 1, blockDataLeast4Bits.toShort)) - ) - } - } - } - /** * TODO: これはビジネスロジックである。breakcountシステムによって管理されるべき。 * @@ -385,8 +209,8 @@ object BreakUtil { .filter(MaterialSets.materialsToCountBlockBreak.contains) .map { // 氷塊とマグマブロックの整地量を2倍 - case Material.PACKED_ICE | Material.MAGMA => 2L - case _ => 1L + case Material.PACKED_ICE | Material.MAGMA_BLOCK => 2L + case _ => 1L } .sum @@ -412,7 +236,7 @@ object BreakUtil { targetBlocksInformation <- PluginExecutionContexts .onMainThread .runAction(SyncIO { - val seq: Seq[(Location, Material, Byte)] = targetBlocks + val seq: Seq[(Location, Material)] = targetBlocks .toSeq .filter { block => block.getType match { @@ -423,7 +247,7 @@ object BreakUtil { case _ => true } } - .map(block => (block.getLocation.clone(), block.getType, block.getData)) + .map(block => (block.getLocation.clone(), block.getType)) // ブロックをすべて[[toMaterial]]に変える targetBlocks.foreach(_.setType(toMaterial)) @@ -432,14 +256,17 @@ object BreakUtil { }) breakResults = { - val plainBreakResult = targetBlocksInformation.flatMap(dropItemOnTool(miningTool)) + val plainBreakResult = targetBlocksInformation.map { + case (location, _) => + (location, location.getBlock.getDrops(miningTool).asScala) + } val drops = plainBreakResult.mapFilter { - case BlockBreakResult.ItemDrop(itemStack) => Some(itemStack) - case BlockBreakResult.SpawnSilverFish(_) => None + case (_, drops) if drops.nonEmpty => Some(drops.head) + case _ => None } val silverFishLocations = plainBreakResult.mapFilter { - case BlockBreakResult.ItemDrop(_) => None - case BlockBreakResult.SpawnSilverFish(location) => Some(location) + case (location, drops) if drops.isEmpty => Some(location) + case _ => None } // 纏めなければ、FAWEの干渉を受け勝手に消される危険性などがある @@ -472,14 +299,14 @@ object BreakUtil { // 壊した時の音を再生する if (shouldPlayBreakSound) { targetBlocksInformation.foreach { - case (location, material, _) => + case (location, material) => dropLocation.getWorld.playEffect(location, Effect.STEP_SOUND, material) } } } // プレイヤーの統計を増やす - totalCount = totalBreakCount(targetBlocksInformation.map { case (_, m, _) => m }) + totalCount = totalBreakCount(targetBlocksInformation.map { case (_, m) => m }) blockCountWeight <- blockCountWeight[IO](player.getWorld) expIncrease = SeichiExpAmount.ofNonNegative(totalCount * blockCountWeight) diff --git a/src/main/scala/com/github/unchama/seichiassist/util/EnemyEntity.scala b/src/main/scala/com/github/unchama/seichiassist/util/EnemyEntity.scala index 10de3f680f..646d1f72c3 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/EnemyEntity.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/EnemyEntity.scala @@ -13,7 +13,7 @@ import org.bukkit.entity.EntityType.{ GUARDIAN, HUSK, MAGMA_CUBE, - PIG_ZOMBIE, + ZOMBIFIED_PIGLIN, SHULKER, SILVERFISH, SKELETON, @@ -41,7 +41,7 @@ object EnemyEntity { GUARDIAN, HUSK, MAGMA_CUBE, - PIG_ZOMBIE, + ZOMBIFIED_PIGLIN, SHULKER, SILVERFISH, SKELETON, diff --git a/src/main/scala/com/github/unchama/seichiassist/util/ItemInformation.scala b/src/main/scala/com/github/unchama/seichiassist/util/ItemInformation.scala index 7b22278d0a..eb323cd483 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/ItemInformation.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/ItemInformation.scala @@ -1,8 +1,8 @@ package com.github.unchama.seichiassist.util import org.bukkit.ChatColor.GREEN -import org.bukkit.block.{Block, Skull} -import org.bukkit.{Material, SkullType} +import org.bukkit.block.Block +import org.bukkit.Material import org.bukkit.inventory.ItemStack import org.bukkit.inventory.meta.SkullMeta @@ -11,76 +11,31 @@ import java.util.stream.IntStream object ItemInformation { import scala.jdk.CollectionConverters._ - import scala.util.chaining._ def isGachaTicket(itemStack: ItemStack): Boolean = { val containsRightClickMessage: String => Boolean = _.contains(s"${GREEN}右クリックで使えます") - if (itemStack.getType != Material.SKULL_ITEM) return false + if (itemStack.getType != Material.PLAYER_HEAD) return false val skullMeta = itemStack.getItemMeta.asInstanceOf[SkullMeta] - if (!(skullMeta.hasOwner && skullMeta.getOwner == "unchama")) return false + if (!(skullMeta.hasOwner && skullMeta.getOwningPlayer.getName == "unchama")) return false skullMeta.hasLore && skullMeta.getLore.asScala.exists(containsRightClickMessage) } - def itemStackContainsOwnerName(itemstack: ItemStack, name: String): Boolean = { - val meta = itemstack.getItemMeta - - val lore: List[String] = - if (meta.hasLore) - meta.getLore.asScala.toList - else - Nil - - lore.exists(line => - line.contains("所有者:") && line.drop(line.indexOf("所有者:") + 4).toLowerCase == name - .toLowerCase() - ) - } - def isMineHeadItem(itemstack: ItemStack): Boolean = { - itemstack.getType == Material.CARROT_STICK && + itemstack.getType == Material.CARROT_ON_A_STICK && loreIndexOf(itemstack.getItemMeta.getLore.asScala.toList, "頭を狩り取る形をしている...") >= 0 } def getSkullDataFromBlock(block: Block): Option[ItemStack] = { - if (block.getType != Material.SKULL) return None - - val skull = block.getState.asInstanceOf[Skull] - val itemStack = new ItemStack(Material.SKULL_ITEM) + if (block.getType != Material.PLAYER_HEAD) return None - // SkullTypeがプレイヤー以外の場合,SkullTypeだけ設定して終わり - if (skull.getSkullType != SkullType.PLAYER) { - val durability = skull.getSkullType match { - case SkullType.CREEPER => SkullType.CREEPER.ordinal.toShort - case SkullType.DRAGON => SkullType.DRAGON.ordinal.toShort - case SkullType.SKELETON => SkullType.SKELETON.ordinal.toShort - case SkullType.WITHER => SkullType.WITHER.ordinal.toShort - case SkullType.ZOMBIE => SkullType.ZOMBIE.ordinal.toShort - case _ => itemStack.getDurability - } - return Some(itemStack.tap(_.setDurability(durability))) - } // プレイヤーの頭の場合,ドロップアイテムからItemStackを取得.データ値をPLAYERにして返す - Some(block.getDrops.asScala.head.tap(_.setDurability(SkullType.PLAYER.ordinal.toShort))) + Some(block.getDrops.asScala.head) } - /** - * 指定された`String`が指定された[[ItemStack]]のloreに含まれているかどうか - * - * @param itemStack - * 確認する`ItemStack` - * @param sentence - * 探す文字列 - * @return - * 含まれていれば`true`、含まれていなければ`false`。ただし、`ItemStack`に`ItemMeta`と`Lore`のいずれかがなければfalse - */ - def isContainedInLore(itemStack: ItemStack, sentence: String): Boolean = - if (!itemStack.hasItemMeta || !itemStack.getItemMeta.hasLore) false - else loreIndexOf(itemStack.getItemMeta.getLore.asScala.toList, sentence) >= 0 - /** * loreを捜査して、要素の中に`find`が含まれているかを調べる。 * diff --git a/src/main/scala/com/github/unchama/seichiassist/util/ItemMetaFactory.java b/src/main/scala/com/github/unchama/seichiassist/util/ItemMetaFactory.java index 6df78bcc77..56811061fa 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/ItemMetaFactory.java +++ b/src/main/scala/com/github/unchama/seichiassist/util/ItemMetaFactory.java @@ -9,5 +9,5 @@ @SuppressWarnings("UtilityClassCanBeEnum") public final class ItemMetaFactory { private static final ItemFactory FACTORY = Bukkit.getItemFactory(); - public static final ValueHolder SKULL = new ValueHolder<>((SkullMeta) FACTORY.getItemMeta(Material.SKULL_ITEM), SkullMeta::clone); + public static final ValueHolder SKULL = new ValueHolder<>((SkullMeta) FACTORY.getItemMeta(Material.PLAYER_HEAD), SkullMeta::clone); } diff --git a/src/main/scala/com/github/unchama/seichiassist/util/PlayerSendable.scala b/src/main/scala/com/github/unchama/seichiassist/util/PlayerSendable.scala index 7b14dcc0a7..a448f5da32 100644 --- a/src/main/scala/com/github/unchama/seichiassist/util/PlayerSendable.scala +++ b/src/main/scala/com/github/unchama/seichiassist/util/PlayerSendable.scala @@ -21,7 +21,7 @@ object PlayerSendable { implicit def forStringArray[F[_]: OnMinecraftServerThread] : PlayerSendable[Array[String], F] = { (player, content) => OnMinecraftServerThread[F].runAction(SyncIO { - player.sendMessage(content) + player.sendMessage(content.mkString("\n")) }) } diff --git a/src/main/scala/com/github/unchama/targetedeffect/commandsender/MessageEffect.scala b/src/main/scala/com/github/unchama/targetedeffect/commandsender/MessageEffect.scala index 424880affd..32667be2be 100644 --- a/src/main/scala/com/github/unchama/targetedeffect/commandsender/MessageEffect.scala +++ b/src/main/scala/com/github/unchama/targetedeffect/commandsender/MessageEffect.scala @@ -26,6 +26,6 @@ object MessageEffectF { TargetedEffect.delay(_.sendMessage(string)) def apply[F[_]: Sync](stringList: List[String]): Kleisli[F, CommandSender, Unit] = - TargetedEffect.delay(_.sendMessage(stringList.toArray)) + TargetedEffect.delay(_.sendMessage(stringList.mkString("\n"))) } diff --git a/src/main/scala/com/github/unchama/util/external/CoreProtectWrapper.scala b/src/main/scala/com/github/unchama/util/external/CoreProtectWrapper.scala index cfae476980..5cfa03ea62 100644 --- a/src/main/scala/com/github/unchama/util/external/CoreProtectWrapper.scala +++ b/src/main/scala/com/github/unchama/util/external/CoreProtectWrapper.scala @@ -7,8 +7,7 @@ import org.bukkit.entity.Player class CoreProtectWrapper(val backbone: CoreProtectAPI) { def queueBlockRemoval(who: Player, where: Block): Boolean = { - // where.getDataが非推奨になっていますが、現在これ以外の方法でByteデータを取得する方法がないようです。 - backbone.logRemoval(who.getName, where.getLocation, where.getType, where.getData) + backbone.logRemoval(who.getName, where.getLocation, where.getType, where.getBlockData) } /* diff --git a/src/main/scala/com/github/unchama/util/external/WorldGuardWrapper.scala b/src/main/scala/com/github/unchama/util/external/WorldGuardWrapper.scala index af7d7f6235..7be453268e 100644 --- a/src/main/scala/com/github/unchama/util/external/WorldGuardWrapper.scala +++ b/src/main/scala/com/github/unchama/util/external/WorldGuardWrapper.scala @@ -1,10 +1,10 @@ package com.github.unchama.util.external -import com.sk89q.worldguard.LocalPlayer +import com.sk89q.worldedit.bukkit.BukkitAdapter import com.sk89q.worldguard.protection.managers.RegionManager -import com.sk89q.worldguard.protection.regions.ProtectedRegion -import org.bukkit.Location -import org.bukkit.World +import com.sk89q.worldguard.protection.regions.{ProtectedCuboidRegion, ProtectedRegion} +import com.sk89q.worldguard.{LocalPlayer, WorldGuard} +import org.bukkit.{Location, World} import org.bukkit.entity.Player import scala.jdk.CollectionConverters._ @@ -16,87 +16,93 @@ import scala.jdk.CollectionConverters._ */ object WorldGuardWrapper { - /** - * WorldGuardのインスタンス - */ - private val plugin = ExternalPlugins.getWorldGuard + private val worldGuard = WorldGuard.getInstance() /** * [[LocalPlayer]]を返す */ - private def wrapPlayer(player: Player): LocalPlayer = plugin.wrapPlayer(player) + private def wrapPlayer(player: Player): LocalPlayer = + worldGuard.checkPlayer(BukkitAdapter.adapt(player)) - /** - * [[RegionManager]]を返す - */ - def getRegionManager(world: World): Option[RegionManager] = Option( - // The expression is nullable: WorldConfiguration#useRegions is false => null - plugin.getRegionManager(world) - ) + def getRegionManager(world: World): RegionManager = + worldGuard.getPlatform.getRegionContainer.get(BukkitAdapter.adapt(world)) - /** - * [[Player]]が[[World]]の中で持っている保護の数を返す - * - * @return [[Player]]が[[World]]の中で持っている保護の数。[[getRegionManager]]が[[None]]であれば0。 - */ - def getRegionCountOfPlayer(player: Player, world: World): Int = - getRegionManager(world).map(_.getRegionCountOfPlayer(wrapPlayer(player))).getOrElse(0) + def getRegion(loc: Location): List[ProtectedRegion] = { + val container = + worldGuard.getPlatform.getRegionContainer.get(BukkitAdapter.adapt(loc.getWorld)) + container + .getApplicableRegions(BukkitAdapter.adapt(loc).toVector.toBlockPoint) + .getRegions + .asScala + .toList + } - /** - * [[World]]における[[Player]] の最大保護可能数を取得します. - * @return [[Player]]の[[World]] における最大保護可能数 - */ - def getMaxRegionCount(player: Player, world: World): Int = - // TODO: migrate this to OptionalInt - plugin.getGlobalStateManager.get(world).getMaxRegionCount(player) + def getRegions(world: World): List[ProtectedRegion] = { + worldGuard + .getPlatform + .getRegionContainer + .get(BukkitAdapter.adapt(world)) + .getRegions + .values() + .asScala + .toList + } - /** - * 現在[[Player]]が[[World]]でオーナーになっている保護の数を返す。 - * @param who 誰か - * @param where どのワールドか - * @return オーナーになっている保護の数。どこのオーナーでもない場合は0 - */ - def getNumberOfRegions(who: Player, where: World): Int = - // TODO: migrate this to OptionalInt - plugin.getRegionContainer.get(where).getRegionCountOfPlayer(wrapPlayer(who)) + def isNotOverlapping(world: World, region: ProtectedCuboidRegion): Boolean = { + val regions = worldGuard + .getPlatform + .getRegionContainer + .get(BukkitAdapter.adapt(world)) + .getRegions + .values() + region.getIntersectingRegions(regions).size() <= 0 + } - /** - * 現在[[Player]]が[[Location]]の座標でOwnerになっている保護があるかどうかを返す。 - * @param player 調べる対象であるPlayer - * @param location どの座標か - * @return Ownerである保護が1つだけあればtrue、ないか保護が2個以上重なっていて判定できなければfalse - */ - def isRegionOwner(player: Player, location: Location): Boolean = - getOneRegion(location).exists(_.isOwner(wrapPlayer(player))) + def canBuild(p: Player, loc: Location): Boolean = { + getRegion(loc).exists { region => + val player = wrapPlayer(p) + region.isOwner(player) || region.isMember(player) + } + } - /** - * [[Player]]が[[Location]]の座標でMemberになっている保護があるかどうかを返す。 - * NOTE: Ownerでもある場合も含まれる。 - * @param player 調べる対象であるPlayer - * @param location どの座標か - * @return Memberである保護が1つだけあればtrue、ないか保護が2個以上重なっていて判定できなければfalse - */ - def isRegionMember(player: Player, location: Location): Boolean = - getOneRegion(location).exists(_.isMember(wrapPlayer(player))) + def findByRegionName(name: String): Option[RegionManager] = + worldGuard.getPlatform.getRegionContainer.getLoaded.asScala.find(_.getName == name) - /** - * [[Location]]の座標にある保護を1つだけ取得する - * @param location どの座標か - * @return [[ProtectedRegion]]。保護が1個もないか、2個以上ある場合は[[None]] - */ - def getOneRegion(location: Location): Option[ProtectedRegion] = { - val regions = getRegions(location) + def removeByProtectedRegionRegion(world: World, region: ProtectedRegion): Unit = { + worldGuard + .getPlatform + .getRegionContainer + .get(BukkitAdapter.adapt(world)) + .removeRegion(region.getId) + } - Option.when(regions.size == 1)(regions.head) + def getMaxRegion(player: Player, world: World): Int = { + worldGuard + .getPlatform + .getGlobalStateManager + .get(BukkitAdapter.adapt(world)) + .getMaxRegionCount(wrapPlayer(player)) } - /** - * [[Location]]の座標にある保護をすべて取得する - * @param location どの座標か - * @return [[ProtectedRegion]]の[[Set]] - */ - def getRegions(location: Location): Set[ProtectedRegion] = - getRegionManager(location.getWorld) - .map(_.getApplicableRegions(location).getRegions.asScala.toSet) - .getOrElse(Set.empty) + def getNumberOfRegions(player: Player, world: World): Int = + worldGuard + .getPlatform + .getRegionContainer + .get(BukkitAdapter.adapt(world)) + .getRegionCountOfPlayer(wrapPlayer(player)) + + def getWorldMaxRegion(world: World): Int = { + worldGuard + .getPlatform + .getGlobalStateManager + .get(BukkitAdapter.adapt(world)) + .maxRegionCountPerPlayer + } + + def isRegionMember(player: Player, location: Location): Boolean = + getRegion(location).exists(_.isMember(wrapPlayer(player))) + + def canProtectionWorld(world: World): Boolean = + worldGuard.getPlatform.getGlobalStateManager.get(BukkitAdapter.adapt(world)).useRegions + } diff --git a/src/main/scala/com/github/unchama/util/nms/v1_12_2/world/WorldChunkSaving.scala b/src/main/scala/com/github/unchama/util/nms/v1_18_2/world/WorldChunkSaving.scala similarity index 92% rename from src/main/scala/com/github/unchama/util/nms/v1_12_2/world/WorldChunkSaving.scala rename to src/main/scala/com/github/unchama/util/nms/v1_18_2/world/WorldChunkSaving.scala index 4b048b1366..351400bac3 100644 --- a/src/main/scala/com/github/unchama/util/nms/v1_12_2/world/WorldChunkSaving.scala +++ b/src/main/scala/com/github/unchama/util/nms/v1_18_2/world/WorldChunkSaving.scala @@ -1,4 +1,4 @@ -package com.github.unchama.util.nms.v1_12_2.world +package com.github.unchama.util.nms.v1_18_2.world import cats.effect.{Concurrent, Sync} @@ -7,12 +7,12 @@ object WorldChunkSaving { import scala.jdk.CollectionConverters._ private object Reflection { - private val nmsPackage_1_12_R1 = "net.minecraft.server.v1_12_R1" - private val craftBukkitPackage_1_12_R1 = "org.bukkit.craftbukkit.v1_12_R1" + private val nmsPackage_1_18_R1 = "net.minecraft.server.v1_18_R1" + private val craftBukkitPackage_1_18_R1 = "org.bukkit.craftbukkit.v1_18_R1" object FileIOThread { private[Reflection] lazy val clazz: Class[_] = - Class.forName(s"$nmsPackage_1_12_R1.FileIOThread") + Class.forName(s"$nmsPackage_1_18_R1.FileIOThread") // public static FileIOThread method() lazy val getInstance: () => AnyRef = { @@ -32,7 +32,7 @@ object WorldChunkSaving { object Entity { private[Reflection] lazy val clazz: Class[_] = - Class.forName(s"$nmsPackage_1_12_R1.Entity") + Class.forName(s"$nmsPackage_1_18_R1.Entity") // public int field lazy val chunkX: AnyRef => Int = { @@ -56,7 +56,7 @@ object WorldChunkSaving { } object Chunk { - private[Reflection] lazy val clazz: Class[_] = Class.forName(s"$nmsPackage_1_12_R1.Chunk") + private[Reflection] lazy val clazz: Class[_] = Class.forName(s"$nmsPackage_1_18_R1.Chunk") // public void method(Entity) lazy val untrackEntity: AnyRef => AnyRef => Unit = { @@ -66,7 +66,7 @@ object WorldChunkSaving { } object World { - private[Reflection] lazy val clazz: Class[_] = Class.forName(s"$nmsPackage_1_12_R1.World") + private[Reflection] lazy val clazz: Class[_] = Class.forName(s"$nmsPackage_1_18_R1.World") // public final List field lazy val entityList: AnyRef => java.util.List[_ <: AnyRef] = { @@ -121,7 +121,7 @@ object WorldChunkSaving { object CraftWorld { private[Reflection] lazy val clazz: Class[_] = - Class.forName(s"$craftBukkitPackage_1_12_R1.CraftWorld") + Class.forName(s"$craftBukkitPackage_1_18_R1.CraftWorld") // public final nms.WorldServer (<: nms.World) // originally