Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [Solved] Error "unidentified mapping" after changing mod id
The update for 1.13 is being worked on - please be patient. (Updated 02/19/19)
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
HariboTer

[Solved] Error "unidentified mapping" after changing mod id

Started by HariboTer, February 9

4 posts in this topic

HariboTer    0

HariboTer

HariboTer    0

  • Tree Puncher
  • HariboTer
  • Members
  • 0
  • 3 posts
  • Report post
Posted February 9 (edited)

For private uses I've rewritten the MoarOres mod. Because it was not conforming to the conventional naming scheme (e.g. it was "SteelSword" instead of "steel_sword") I renamed everything properly and process the appropriate MissingMappings events to not break old worlds, which after some troubleshooting worked fine.

 

Then due to the amount of changes made, I found it adequate to change the mod id from "moarores" to "moaroresreforged". It's no trouble for new worlds, but for some odd reason it seems the MissingMappings stopped working. Or rather: The MissingMappings handling *still works*, but Forge now rejects it.

 

The code is (the methods are called from the main class which is listening for those events)

 

Spoiler

	public static void remapBlocks(MissingMappings<Block> event) {
		for (MissingMappings.Mapping<Block> miss : event.getMappings()) {
			Block block = blockMap.get(miss.key.toString());
			if (block != null) {
				miss.remap(block);
			}
			else {
				System.out.println("Couldn't remap "+miss.key);
			}
		}
	}
	
	public static void remapItems(MissingMappings<Item> event) {
		for (MissingMappings.Mapping<Item> miss : event.getMappings()) {
			Item item = itemMap.get(miss.key.toString());
			if (item != null) {
				miss.remap(item);
			}
			else {
				System.out.println("Couldn't remap "+miss.key);
			}
		}
	}

 

 

And the output that gets produced (I reduced the listings to one block and one item each in favor of readability):

Spoiler

[22:48:02] [Server thread/INFO] [FML]: Registry Block: Found a missing id from t
he world moarores:mythrilore
[22:48:02] [Server thread/INFO] [FML]: Registry Item: Found a missing id from th
e world moarores:mythrilingot
[22:48:02] [Server thread/INFO] [STDOUT]: [main.java.moaroresreforged.MoarOresRe
forgedMod:remapBlock:59]: Remapping blocks called!
[22:48:02] [Server thread/ERROR] [FML]: Unidentified mapping from registry minec
raft:blocks
[22:48:02] [Server thread/ERROR] [FML]:     moarores:mythrilore: 258
[22:48:02] [Server thread/INFO] [STDOUT]: [main.java.moaroresreforged.MoarOresRe
forgedMod:remapItem:65]: Remapping items called!
[22:48:02] [Server thread/ERROR] [FML]: Unidentified mapping from registry minec
raft:items
[22:48:02] [Server thread/ERROR] [FML]:     moarores:mythrilingot: 4104

 

It's worth noting that the printing "Couldn't remap ..." is *not* made, so the remapping worked, but forge doesn't like it.

How can I tell forge to accept the change?

Edited February 10 by HariboTer
Marked as solved

Share this post


Link to post
Share on other sites

Laike_Endaril    7

Laike_Endaril

Laike_Endaril    7

  • Creeper Killer
  • Laike_Endaril
  • Members
  • 7
  • 117 posts
  • Report post
Posted February 10

It looks like you're not setting a new registry name for the blocks before remapping them, so they map to their old mappings...if I'm reading it correctly.

 

If I'm right, then changing this...
 

miss.remap(block);

 

...to this...

 

miss.remap(block.setRegistryName(~~~enter correct registry name here, using new modid and block name~~~));

 

Should solve the immediate issue.  Make sure to do the same for items if that works for the blocks ofc

Share this post


Link to post
Share on other sites

HariboTer    0

HariboTer

HariboTer    0

  • Tree Puncher
  • HariboTer
  • Members
  • 0
  • 3 posts
  • Report post
Posted February 10

Thanks for your input. You should know though that the itemMap and the blockMap contain the registered and valid current items/blocks, keyed by their old names, which are not changed by the remapping because they are the target, not the source. So unfortunately your proposal doesn't fix the problem.

Share this post


Link to post
Share on other sites

HariboTer    0

HariboTer

HariboTer    0

  • Tree Puncher
  • HariboTer
  • Members
  • 0
  • 3 posts
  • Report post
Posted February 10

Rummaging around the MissingMappings code I found that getMappings() filters the mappings for only those whose mod ID matches the mod for which the event is called, which were empty due to the different mod ID. getAllMappings() does not perform this filtration, thus replacing getMappings() with getAllMappings() in both cases solved the issue 🙂

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 1
Go To Topic Listing Modder Support

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Laike_Endaril
      Problems with the updateTick method

      By Laike_Endaril · Posted 1 minute ago

      Thanks for adding in the build file; it makes importing the project much easier.

      After looking through your BlockClock and many related classes, I believe adding a TileEntity is the best approach for a clock.  You can probably make a clock without using a TE, but it might be tricky to preserve the internal timer state when the world unloads/reloads.  I suppose you might be able to get away with using a blockstate property as a timer, but I haven't tried this.   Consider taking a look at the BlockDaylightDetector class.  It may not be a clock in the way you're thinking, but some of its code could probably be useful here.  It uses a TileEntity as well.   That's about as far as my guesswork is going on this one.  If you still have trouble you'll need advice from someone with more related experience than I have.
    • diesieben07
      [1.12.2] Syncing TE form GUI

      By diesieben07 · Posted 14 minutes ago

      This int is completely irrelevant for modded tile entities.   @ZigTheHedge: Your sendUpdates method is stupid, don't blindly call random methods without knowing what they do. Call World#notifyBlockUpdate on the server to send the update packet to the client. Call World#notifyBlockUpdate on the client to re-render the block. If your update packet needs the block to be re-rendered you need to call this from onDataPacket. You must call TileEntity#markDirty when any data that's serialized to NBT (writeToNbt) has changed. This is not related to networking.
    • DavidM
      [1.12] Making a TESR less laggy

      By DavidM · Posted 22 minutes ago

      A FastTESR would probably boost your performance significantly, but there will still be some lag as rendering 125 ItemStacks per frame is very demanding on resources.
    • RoyalReject
      [1.12.2] Syncing TE form GUI

      By RoyalReject · Posted 25 minutes ago

      @Override public SPacketUpdateTileEntity getUpdatePacket() { ModMain.logger.warning("getUpdatePacket()"); NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new SPacketUpdateTileEntity(getPos(), 1, nbtTag); } Try setting return statement to return new SPacketUpdateTileEntity(this.pos, 3, this.getUpdateTag()); or just change 1 to 3
    • diesieben07
      Crash report

      By diesieben07 · Posted 26 minutes ago

      1.7.10 is no longer supported on this forum due to it's age. Update to a modern version of Minecraft to receive support.
  • Topics

    • Keheck
      8
      Problems with the updateTick method

      By Keheck
      Started February 8

    • ZigTheHedge
      2
      [1.12.2] Syncing TE form GUI

      By ZigTheHedge
      Started 7 hours ago

    • BeardlessBrady
      3
      [1.12] Making a TESR less laggy

      By BeardlessBrady
      Started 7 hours ago

    • Manfro
      1
      Crash report

      By Manfro
      Started 8 hours ago

    • DoctorLOGiQ
      6
      [1.13.2] Example mod fails to launch

      By DoctorLOGiQ
      Started Monday at 01:23 PM

  • Who's Online (See full list)

    • diesieben07
    • Laike_Endaril
    • adusut
    • Marcosch1337
    • DavidM
    • Mango106
    • TheRam
    • RoyalReject
    • nyuppo
    • Trooprm32
    • HeberonYT
    • ButterAleks
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [Solved] Error "unidentified mapping" after changing mod id
  • Theme
  • Contact Us

Copyright © 2017 ForgeDevelopment LLC Powered by Invision Community