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
  • Minecraft Forge
  • Suggestions
  • command to clean /fml/registry/... entries of deinstalled mods?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
DanNetwalker

command to clean /fml/registry/... entries of deinstalled mods?

By DanNetwalker, September 23, 2016 in Suggestions

  • Reply to this topic
  • Start new topic

Recommended Posts

DanNetwalker    0

DanNetwalker

DanNetwalker    0

  • Tree Puncher
  • DanNetwalker
  • Members
  • 0
  • 4 posts
Posted September 23, 2016

There's this problem that people doesn't run into normally, that when you install a mod its blocks, objects, potions, etc are stored in the map registry, some data structure that links block name with the block ID used in the map.

 

This thing is great for a player that gets a modpack, goes to start a new map and boom! there it works, or migrating a map from a previous modpack version to the next (or players that join a server with blocks disabled? I may have not understood that use case). However, if a player (or modpack maker) has been adding and removing mods to test them for the modpack in a single map, or the mods have been changing over time while you keep playing the same map, the block registry will get filled with entries that are spending block IDs that could be used for real, working mods.

 

Could we please get a command that allows to remove the registry entries related to a mod, so that we can not only deinstall but "purge" it from a map?

  • Quote

Share this post


Link to post
Share on other sites

Ernio    600

Ernio

Ernio    600

  • Reality Controller
  • Ernio
  • Forge Modder
  • 600
  • 2638 posts
Posted September 23, 2016

While I hate having junk data anywhere - locked IDs are actually not one.

 

If you remove mod that took up some IDs, those IDs must stay locked to point at "null" block (read: AIR).

Whenever chunk is loaded and it can't find block with matching ID in registry, it will replace it to null (AIR).

Not holding those locked IDs would result in chunks that are loaded after adding 2nd mod (so not "purged" between transition from 1st to 2nd), to start loading different blocks - and you really don't want that.

  • Quote

1.7.10 is no longer supported by forge, you are on your own.

Share this post


Link to post
Share on other sites

DanNetwalker    0

DanNetwalker

DanNetwalker    0

  • Tree Puncher
  • DanNetwalker
  • Members
  • 0
  • 4 posts
Posted September 23, 2016

Oh, snap. So the problem it's not only cleaning the /FML registry, but also taking all the generated chunks, hunt for the blocks and change the block id for the air id. And with items it would be worse, it can be burrowed in the NBT data of other blocks... Then it may not be the kind of job for a forge command, but for an external tool or something that does the job during a server boot.

 

Any chance of something like this coming from the Forge team, anyway? If we had a nice command line nbt editor/manipulator I could mix that with mcedit and do it manually, but with the current tools I don't see how we can do that kind of "map repair", more like "map refresh".

  • Quote

Share this post


Link to post
Share on other sites

Ernio    600

Ernio

Ernio    600

  • Reality Controller
  • Ernio
  • Forge Modder
  • 600
  • 2638 posts
Posted September 23, 2016

You do understand that there is literally no point in making such tool?

The moment ID becomes "nullified" game automatically assumes that given blocks are now AIR, they just stay in world data until you load it.

It's cleaning itself. The only viable approach to such things.

 

Only valid argument here would be lack of free IDs for new mods - which is ridiculous, I can't imagine any map having that much stuff.

 

351bi45.jpg

 

Sure you can remove IDs, load tons of world data files (which is IO that takes time), then iterate over chunks and then blocks and then check agains every removed ID and then change data and save it back. Oh and did I mentiont TileEntities and Entities saved in world? How about Any other mechanism that every saved anything block-related? How about other mods? You can't even be sure you removed everything - and then BAM! Other mod suddenly loads different blocks from it's modded backpack items.

 

Not only pointless, but close to impossible.

 

Why bother? 8)

  • Quote

1.7.10 is no longer supported by forge, you are on your own.

Share this post


Link to post
Share on other sites

DanNetwalker    0

DanNetwalker

DanNetwalker    0

  • Tree Puncher
  • DanNetwalker
  • Members
  • 0
  • 4 posts
Posted September 24, 2016

Only valid argument here would be lack of free IDs for new mods - which is ridiculous, I can't imagine any map having that much stuff.

 

Ejem...

 

v3Nh2XY.jpg

 

Not a normal use case, but possible when you install a mod that it's really badly made (a single block id per block in a "huge library of blocks". Missing pieces for example. A frozen world, as another example. Do this mistake too many times and you are forced to abandon your map. Or manually fix it by removing block id by block id with nbtexplorer, which it works fairly well if you clean the map from those blocks  with mcedit, which is a pita because you have to note down block ID by block ID what was added by the removed mod.

 

A mod is removed? Fine. Put it's blocks/items/etc in a black list registry. Then an external tool can turn all that blacklisted blocks into id 0 and clean the blacklist entries after looking at all the chunks. Am I missing something here? As I see it, it's a registry entry and an external tool that loops it, not rocket science... items would be harded, I know, except that most of block containers are fairly standard (chests and such). Only mod blocks would be a problem, and not an uncontrollable problem.

 

And the point of letting players keep using a map that they played in for months? Well... do I really have to explain that?

  • Quote

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted September 24, 2016

Then just delete that entry. There are no plans to write a garbage collector program for this literally one in several million chance that you run through several screwed up mod packs.

 

Someone else can but its so low priority that I doubt I'll ever get to it

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

bmwalter68    0

bmwalter68

bmwalter68    0

  • Tree Puncher
  • bmwalter68
  • Members
  • 0
  • 4 posts
Posted February 1, 2020

FWIW, my family has a world we've been playing on for several years.  As we've moved through versions of Forge and various mods it has filled up with a ton of legacy blocks, finally crossing the 4096 explosion point when adding a new mod.  After reading this thread I found World Utils for 1.12.2 which successfully removed 600+ unused blocks from the world.  The command you're looking for is:

 

/worldutils registry remove-missing-blocks 

 

Step by step, here's how I fixed my issues:

  1. Back up the old map.  Make sure you don't /fml confirm when it it warns that you've exceeded 4096 blocks!
  2. Load up MC running the mods I was interested in keeping
  3. Started a clean flat world where I could execute the command
  4. Copy the afflicted level.dat into the instances config/worldutils folder
  5. Run: /worldutils registry remove-missing-blocks
  6. Copy the fixed level.dat back into my old world directory

YMMV and you definitely need to work with a version of level.dat that hasn't been saved after the exceeded max blocks warning.

- B

  • Quote

Share this post


Link to post
Share on other sites

LexManos    1620

LexManos

LexManos    1620

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1620
  • 8954 posts
Posted February 2, 2020

3rd party utilities that mess with the world are not supported/endorsed as they have non-insignficant chances of breaking the world.

Beyond that update to 1.13+ to remove the 4096 limitation directly.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

OctaDragon    0

OctaDragon

OctaDragon    0

  • Tree Puncher
  • OctaDragon
  • Members
  • 0
  • 1 post
Posted February 18
On 9/24/2016 at 2:58 PM, DanNetwalker said:

 

Ejem...

 

v3Nh2XY.jpg

 

Not a normal use case, but possible when you install a mod that it's really badly made (a single block id per block in a "huge library of blocks". Missing pieces for example. A frozen world, as another example. Do this mistake too many times and you are forced to abandon your map. Or manually fix it by removing block id by block id with nbtexplorer, which it works fairly well if you clean the map from those blocks  with mcedit, which is a pita because you have to note down block ID by block ID what was added by the removed mod.

 

A mod is removed? Fine. Put it's blocks/items/etc in a black list registry. Then an external tool can turn all that blacklisted blocks into id 0 and clean the blacklist entries after looking at all the chunks. Am I missing something here? As I see it, it's a registry entry and an external tool that loops it, not rocket science... items would be harded, I know, except that most of block containers are fairly standard (chests and such). Only mod blocks would be a problem, and not an uncontrollable problem.

 

And the point of letting players keep using a map that they played in for months? Well... do I really have to explain that?

Man you saved my world :) thank you from 2021.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • DrCowiber
      Failed To Start Minecraft Server

      By DrCowiber · Posted 24 minutes ago

      im using this run.sh file, which contains: java -Xmx6G -Xms6G -jar minecraft_server.1.16.5.jar --nogui Edit: When I first posted about this I was using the serverRun.jar, which the first log file I posted is what the output was
    • Tez
      [1.15.2] Couln't not resolve dependency: net.minecraftforge:forge:1.15.2-31.2.0:userdev

      By Tez · Posted 44 minutes ago

      I'm new to mod coding so i've watch tutorial in youtube in setup workspace step i got this error , i've try many solutions to fix but it still not working try update gradle to 6.8.3 but still not working try update java and still not working too here's my stacktrace: Stacktrace
    • diesieben07
      Failed To Start Minecraft Server

      By diesieben07 · Posted 48 minutes ago

      Please show how exactly you are starting the server.
    • DrCowiber
      Failed To Start Minecraft Server

      By DrCowiber · Posted 1 hour ago

      https://pastebin.com/TZJEsrTB
    • diesieben07
      game keeps crashing while initializings

      By diesieben07 · Posted 1 hour ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • DrCowiber
      8
      Failed To Start Minecraft Server

      By DrCowiber
      Started 19 hours ago

    • Tez
      0
      [1.15.2] Couln't not resolve dependency: net.minecraftforge:forge:1.15.2-31.2.0:userdev

      By Tez
      Started 44 minutes ago

    • Mysterious minecrafter
      1
      game keeps crashing while initializings

      By Mysterious minecrafter
      Started 2 hours ago

    • lukeeeeee_1
      1
      I'm not managing to enter worlds

      By lukeeeeee_1
      Started 3 hours ago

    • masiha128
      6
      i can not create any mods

      By masiha128
      Started 7 hours ago

  • Who's Online (See full list)

    • Uncreative
    • DrCowiber
    • Skyriis
    • Chryfi
    • RobinCirex
    • Iron1601
  • All Activity
  • Home
  • Minecraft Forge
  • Suggestions
  • command to clean /fml/registry/... entries of deinstalled mods?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community