Skip to content

[codex] Fix Peaceful pet config generation - #1

Draft
heoduling wants to merge 1 commit into
masterfrom
codex/fix-peaceful-config-generation
Draft

[codex] Fix Peaceful pet config generation#1
heoduling wants to merge 1 commit into
masterfrom
codex/fix-peaceful-config-generation

Conversation

@heoduling

Copy link
Copy Markdown
Owner

What changed

  • Route default pet attribute discovery through a PetNMS unspawned-entity hook.
  • Use the existing 26.2 NMS entity constructor without adding the temporary entity to the world.
  • Preserve the existing Bukkit implementation as the fallback for older supported modules.

Root cause

During first-run config generation, PetCreator.setExtras called World.createEntity for every supported type only to read default attributes. Shiroha 26.2 rejects PiglinBrute construction in Peaceful difficulty, aborting CombatPets enable before all pet configs are written.

Validation

  • Maven clean verify: 9/9 modules successful, 0 tests present.
  • Independent Folia plugin JAR verification passed.
  • Fresh isolated Shiroha 26.2 76af874 startup with difficulty=peaceful and nightcore 2.16.1 generated and loaded all 66 pet configs, including piglin_brute.yml, and enabled/stopped CombatPets normally.
  • The target Cannot spawn monster exception and Error occurred while enabling CombatPets were absent from the complete regression log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant