▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/CobbleStacker
CobbleStacker

CobbleStacker

CobbleStacker is a server-side Fabric mod that reduces lag by automatically merging nearby identical mobs, ground items, and spawners into a single entity with a stack counter, fully compatible with Cobblemon.

587
2
Все версииCobbleStacker 1.0.0

CobbleStacker 1.0.0

Release1 мес. назад

Список изменений

Bug Fixes Recap

Critical

  1. Spawner drops not restoring mob type when placed CobbleStackerMod.java:455 — The BLOCK_ENTITY_DATA NBT was missing the "id": "minecraft:mob_spawner" field. Without it, Minecraft 1.21 silently ignores the saved SpawnData when the spawner is placed, resulting in a default pig spawner. Added blockEntityTag.putString("id", "minecraft:mob_spawner") in dropSpawnerItem.

  2. ThreadLocal leak in MobSpawnerLogicMixin CobbleStackerMod.java:206-211 — If MobSpawnerLogic.serverTick threw an exception, the @At("RETURN") injection wouldn't fire, leaving the ThreadLocal set. Any entity spawned afterwards would be incorrectly treated as a spawner mob. Fixed by adding a validation check in onEntityLoad that verifies the block at the stored position is actually a spawner; if not, the stale context is cleared.

  3. Item/XP duplication with KILL_ALL death behavior LivingEntityMixin.java:41-45, 71-86, 167-226 — handleKillAll used server.execute() (1-tick delay) and age <= 2 to find drops, which was unreliable: it could miss the actual drops or multiply items from other mobs dying nearby. Fixed by capturing a snapshot of existing ItemEntity/XP orb IDs in the area before death (in onDeathHead), then at onDeathReturn only multiplying entities that are new (not in the snapshot). Removed the server.execute() wrapper entirely.

Important

  1. Entity ID reuse causing stale stack data MobStackManager.java:388 — cleanupDeadEntities only ran when stackData.size() > 50, leaving a window where newly spawned entities could inherit stack data from dead entities with the same runtime ID. Removed the size threshold so cleanup runs every cycle.

  2. /cs clear not actually unstacking entities CobbleStackerCommand.java:226-285 — The clear command just called handleKill which only wiped the internal data maps. Entities remained in the world with stale nametags like "x5 Zombie" while the mod treated them as stack=1. Now the command iterates all entities, resets their custom names, sets stack to 1, and then clears the data maps.

  3. Spawner stacking without mob type validation CobbleStackerMod.java:351-357, 421-438 — Players could stack different spawner types together (e.g., a Zombie Spawner onto a Pig Spawner) without any warning. Added a mob type compatibility check in handleSpawnerStack with a new helper method getSpawnerItemEntityType that reads the mob type from the held spawner item's NBT data.

  4. No periodic save for spawner data CobbleStackerMod.java:67, 179-183 — SpawnerDataManager.saveData() was only called during onServerStopping. A server crash meant all spawner stack data since startup was lost. Added a periodic save every 5 minutes (6000 ticks).

Minor / Performance

  1. World-spanning bounding box query in processStacking MobStackManager.java:352-358 — processStacking used getEntitiesByClass with a Box(-30000000 ... +30000000), which defeats Minecraft's spatial index optimization and forces a full entity scan every cycle. Replaced with world.iterateEntities() which directly iterates the entity list without spatial overhead.

  2. Invulnerability inconsistency for spawner-spawned mobs CobbleStackerMod.java:223 — onEntityLoad set the bypass flag but didn't set setInvulnerable(true), while processBypassRemovals always called setInvulnerable(false) on expiry. This could remove invulnerability that an entity had for other reasons. Added living.setInvulnerable(true) in onEntityLoad to match the behavior in handleKillOne.

  3. Stale batch processing indices across ticks MobStackManager.java:335-385 — currentWorldIndex and currentEntityIndex persisted between calls, but the entity list was recreated each time. Entities added/removed between ticks could cause out-of-range indices or skipped entities. Added bounds checking and automatic index reset when indices exceed the current entity list size.

Файлы

CobbleStacker-Fabric-1.0.0.jar(63.76 KiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

1.0.0

Загрузчики

Fabric

Версии игры

1.21–1.21.1

Загрузок

111

Дата публикации

1 мес. назад

Загрузил

ID версии

Главная