Fix CraftLegacy warning and hopper task stopping on stack size change#90
Conversation
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
|
@copilot reverse to getState(false). I found the problem it is because in the code there is DynamicMaterialDetector looping through material, can we remove it since we have SpawnerMobHeadTexture & MobHeadConfig which taking care of the texture already, also can check if EntityLootRegistry have smart mob version loading to avoid older version load mob and item from later version |
…ntity type validation Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
Done in commit fcd536d. Changes:
The CraftLegacy warning was triggered by |
Addresses two issues: (1) CraftLegacy initialization warning appearing in logs, and (2) hoppers stopping item transfer when spawner stack size changes.
Changes
Remove legacy material support trigger
DynamicMaterialDetectorclass that was iterating throughMaterial.values()in static initializer, which triggers CraftLegacy initializationSpawnerMenuAction(PLAYER_HEAD, SPAWNER, ZOMBIE_HEAD, SKELETON_SKULL, WITHER_SKELETON_SKULL, CREEPER_HEAD, PIGLIN_HEAD, DRAGON_HEAD)EntityTypevalidation inEntityLootRegistryto skip entity types not available in current server versiongetState(false)as it's not the source of the warningFix hopper task continuity on stack size changes
HopperHandler.restartHopperForSpawner()to stop and restart hopper tasks when spawner virtual inventory is recreatedSpawnerData.updateStackSize()after inventory recreation to maintain hopper task with fresh referencesThe hopper task was holding a stale inventory reference after stack size modification, causing transfer operations to fail silently.
Version compatibility improvements
EntityLootRegistrynow validates both entity types and materials, logging warnings and skipping entries not available in the current Minecraft versionOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.