🔌 Mixin リファレンスとバイトコード注入点
📌 リポジトリソースコードに関する免責事項: 本Wikiドキュメントはリポジトリの最新ソースコード状態を反映しており、CurseForgeやModrinthで公開されているリリース版に含まれない開発中機能を含む場合があります。
Better Bats uses Bytecode Mixins to modify vanilla entity and world spawning behavior while keeping world saves 100% vanilla-safe.
☕ 個人開発者ノート: 3D BOIDsによるコウモリのリアルな群飛やグアノによる作物施肥を気に入っていただけたら、ぜひ Ko-fi でのご支援をお願いします!
📋 Mixin 注入ポイント完全一覧表
| Mixin Class | Target Vanilla Class | Target Method | @At Injection Point | Cancellation / Behavior |
|---|---|---|---|---|
BatMixin | net.minecraft.world.entity.ambient.Bat | <init> | @At("TAIL") | Registers custom AI goals (Panic, Sleep, HuntLight, DiveBomb) into goalSelector. |
BatMixin | net.minecraft.world.entity.ambient.Bat | customServerAiStep | @At("HEAD") | cancellable = true. Completely replaces vanilla flight calculation with BatFlightHelper forces and resting logic. |
BatMixin | net.minecraft.world.entity.ambient.Bat | checkBatSpawnRules | @At("HEAD") | cancellable = true. Validates surface nighttime spawning rules. |
BatMixin | net.minecraft.world.entity.ambient.Bat | addAdditionalSaveData | @At("TAIL") | Writes betterbats:guano_ticks integer tag to ValueOutput. |
BatMixin | net.minecraft.world.entity.ambient.Bat | readAdditionalSaveData | @At("TAIL") | Reads betterbats:guano_ticks integer tag from ValueInput. |
GameEventDispatcherMixin | net.minecraft.world.level.gameevent.vibrations.VibrationSystem$Listener | handleGameEvent | @At("HEAD") | Notifies nearby bats of sprint/explosion vibrations. |
NaturalSpawnerMixin | net.minecraft.world.level.NaturalSpawner | m_6419_ | @At("HEAD") | Replaces vanilla bat spawn weights with bat_spawn_weight GameRule. |
See also: アーキテクチャとパッケージ | AI行動プロファイルと状態
