FredTargaryen Posted January 8, 2019 Share Posted January 8, 2019 I want to change the line GameRegistry.registerTileEntity(TileEntityFireplace.class, new ResourceLocation(DataReference.MODID+":fireplaceTE")); to GameRegistry.registerTileEntity(TileEntityFireplace.class, new ResourceLocation(DataReference.MODID+":fireplace")); but if I run post-change Minecraft with a pre-change world I get the error [15:23:33] [Server thread/WARN] [minecraft/TileEntity]: Skipping BlockEntity with id ftfloocraft:fireplace and the TileEntity is gone, because there doesn't seem to be an opportunity to remap the pre-change TileEntity to the post-change ResourceLocation. MissingMappingsEvent didn't seem to fire for TileEntities. My only idea right now is to register the tile entity once with the old ResourceLocation and once with the old one, and then somehow migrate the NBT data over. Is there a better way? Thanks for reading. Quote Link to comment Share on other sites More sharing options...
unassigned Posted January 8, 2019 Share Posted January 8, 2019 Maybe I do not entirely understand you, but you want to change the Tile's ID, without losing the data from another world? I don't think there is any way to do this. If you change the ID, the game doesn't recognize the TE in the world, which will make it not load it into game. Why do you care about the data attached to this block so much? I'm guessing you are in a testing environment, so changes like this will break existing TEs, but you can just put down the block with the new TE id and it should work the same. 1 Quote Currently developing: https://github.com/unassignedxd/Dynamic-Quarries Link to comment Share on other sites More sharing options...
FredTargaryen Posted January 8, 2019 Author Share Posted January 8, 2019 Yep, I don't want to lose data from a world made before changing the ID. The TileEntity stores teleporter data, so on a world with lots of teleporters players would have to break and replace all their teleporters and that could be tedious with a lot of teleporters in the world. I also have another TileEntity which has an inventory, and I wouldn't want players' items to be destroyed. I can keep the IDs the way they are; I'd just like to be able to change the ID to make my code a bit more consistent. Quote Link to comment Share on other sites More sharing options...
Cadiboo Posted January 9, 2019 Share Posted January 9, 2019 Forge provides the MissingMappingsEvent, I think it also fires for tile entities. 14 hours ago, FredTargaryen said: GameRegistry.registerTileEntity(TileEntityFireplace.class, new ResourceLocation(DataReference.MODID+":fireplace")); Don’t construct a ResourceLocation like that (domain+”:”+path), construct it with the overload that takes seperate parameters (domain, path) 1 Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme) Link to comment Share on other sites More sharing options...
FredTargaryen Posted January 9, 2019 Author Share Posted January 9, 2019 Well like I say I didn't see MissingMappingsEvent fired for tile entities. GameData doesn't seem to call makeRegistry for tile entities either. I'll change the ResourceLocations; guessing because your way is harder to screw up and avoids an extra function call? Quote Link to comment Share on other sites More sharing options...
Cadiboo Posted January 9, 2019 Share Posted January 9, 2019 Yeah, my bad, you need DataFixers for TileEntities. Mojang has also recently open-sourced their datafixing library 2 minutes ago, FredTargaryen said: because your way is harder to screw up Mostly the harder to screw up 1 Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme) Link to comment Share on other sites More sharing options...
FredTargaryen Posted January 9, 2019 Author Share Posted January 9, 2019 Ah, I'll look into DataFixers then. Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.