-
Bug
-
Resolution: Fixed
-
Minecraft 1.11.2, Minecraft 17w17b, Minecraft 1.12, Minecraft 1.12.2, Minecraft 18w02a
-
Confirmed
Based on 1.11.2 decompiled using MCP 9.35 rc1 and 17w17a decompiled using CFR
The bug
The command block and spawner minecart data fixer are not working correctly.
Command block minecart
First of all the method net.minecraft.entity.item.EntityMinecartCommandBlock.registerFixesMinecartCommand(DataFixer) compares the id value with the current id of the command block block entity, which will always fail. It should compare it with the id of the EntityMinecartCommandBlock (see EntityMinecartMobSpawner.registerFixesMinecartMobSpawner(DataFixer)).
The second problem is that it sets the old block entity id (Control) when trying to apply command block fixes. This fails when trying to fix chunks which were loaded after the block entity id changes. Another problem is that it sets the old command block minecart entity as well which would result in them being lost upon loading old worlds.
Spawner minecart
While the method net.minecraft.entity.item.EntityMinecartMobSpawner.registerFixesMinecartMobSpawner(DataFixer) uses the entity id, it always uses the latest. The problem is that there were changes to the NBT data of spawner when the old entity ids were used. This means trying to load a pre-1.9 world with spawner minecarts will not fix these.
How to reproduce
- Create a world in version 1.8.9
- Place a spawner
/setblock ~ ~ ~ mob_spawner 0 replace {SpawnData:{Color:1b},EntityId:"Sheep"}
- Summon a spawner minecart
/summon MinecartSpawner ~ ~ ~ {EntityId:ArmorStand,MinSpawnDelay:10s,MaxSpawnDelay:10s,SpawnCount:1}
- Open the world in the latest version
→ The spawners were fixed, but the spawner minecarts lost their data
General problem
The problem in general is that some fixes might apply to versions where the ids where different. Therefor setting the latest block entity id will not apply the fixes. However, setting only the old id would cause problems with fixes after the id changes. This means it would be good to set the id based on the passed data version. To not have special cases and possibly miss one with new versions or if a fix for an old version was forgotten and added later some kind of id lookup to get the respective id for a version should solve this problem.
- relates to
-
MC-124343 Command block minecart data walker never runs due to comparing different types
- Resolved