8
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

鬼滅の刃 mod が Apple Silicon M1 Mac でネイティブ動作ヌルヌル

Last updated at Posted at 2021-01-15

Apple Silicon (M1) 端末では LWJGL の違いで Minecraft の Forge が起動せず、これまで mod が使えませんでしたが、0xQSL さんのパッチ により動くようになります。クラッシュを回避する2行だけ。

     io_service_t service;
     CFDictionaryRef info;	    CFDictionaryRef info;
 
+    return NULL;
+
     if (IOServiceGetMatchingServices(kIOMasterPortDefault,
                                      IOServiceMatching("IODisplayConnect"),
                                      &it) != 0)

以下の手順で、先日 1.16 対応した 鬼滅の刃mod も Apple Silicon の ARM ネイティブでスムーズに動くようになりました。
(disclaimer: この記事で利用している言語は、C と bash です)

パッチ適用しないと下記のエラーになっていました。
crash.png

The game crashed whilst initializing game
Error: java.lang.IllegalStateException: GLFW error before init: [0x10008]Cocoa: Failed to find service port for display
Exit Code: 255

パッチ適用すると、Apple M1 で 60fps 出るようになります。

2021-01-15_15.05.59.jpg

(1) Java をインストールする。

Minecraft 内蔵の JVM は Rosetta 2 で動くので、まず ARM 対応 JVM を用意します。
https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit
「ARM 64-bit」が要チェック。
私は Java 11 (LTS) Zulu: 11.43.1021 の .dmg を使いました。
/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin/java
あたりにインストールされます。

[8/1追記]
Minecraft 1.17 以降は Java 16 が必要になります。
Java 11 環境では下記のメッセージが表示されて、起動しません。
現在の鬼滅の刃 mod は Minecraft 1.16.5 ベースなのでまだ大丈夫ですが、
Minecraft 1.17 バニラで遊ぶときは、Java 16 も導入して下さい。

Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/client/main/Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 55.0

[8/1追記ここまで]

(2) MultiMC をインストールする。

https://multimc.org/#Download
Mac OS X を選びます。

(3) MultiMC を起動して、Add Instance する

Name: Kimetsu(英語のみ空白なしが安全かも)
Vanilla Version 1.16.4
Edit Instance > Install Forge
Edit Instance > Settings > Java > Java installation > Auto-detect で適当に選ぶ。
Test ボタンで Platform reported: aarch64 と表示されるのを確認します。
aarch64.jpg

(4) 0xQSL さんの m1-multimc-hack を clone する。

mkdir github
cd github
git clone https://github.com/0xQSL/m1-multimc-hack.git --branch=fix-forge 
cd m1-multimc-hack
ls $PWD/mcwrap.py | pbcopy
# mcwrap.py のフルパスがクリップボードに入ります。

(5) m1-multimc-hack

MultiMC で Edit Instance > Settings > Custom Commands > Wrapper command で
(4) でコピーした mcwrap.py へのフルパスをペーストする。

(6) mod をダウンロードする

https://maounomods900225408.wordpress.com/2020/10/13/%E9%AC%BC%E6%BB%85%E3%81%AE%E5%88%83mod/
鬼滅の刃 mod 『Ver7.1(1.16.4用)1/8更新』のところからダウンロードする。

(7) mod を MultiMC に登録する

MultiMC で Edit Instance > Loader mods > Add から (4) でダウンロードした KimetsunoYaiba_1.16.4_ver7.1.jar を選択
mods.jpg


[追記]
当初、記事タイトルで 60fps と書いてましたが、画面内にキャラが増えると 30〜40fps くらいに落ちるので変更しました。
それでも 3.2 GHz Intel Core i7-8700B よりは速そう。

8
4
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?