Realistic Terrain Generation

Realistic Terrain Generation

3M Downloads

The new EventManager may not be getting properly registered after being unregistered

srs-bsns opened this issue ยท 5 comments

commented

In single-player, if a world is created/loaded and then unloaded (back to the main menu) and then reloaded, the EventManager events (some? all?) appear to not get reregistered. This will result in chunk walls and the river remover not working.

The EventManager logs that it has reregistered the events, however, it only checks a boolean that is set when the registration method executes (yeah, hardly a proper check.. my bad ๐Ÿ˜ฆ). There should be a way to retrieve a list from Forge of all event listeners, and check that list to make sure our events are getting registered correctly, and if not, start to ๐Ÿ‘Š stuff until it is sufficiently broken so we can try to blame it all on someone else.. or we could just...
buryhead

This should be a priority.

Pics for proof:
2016-07-26_19 25 17
2016-07-26_19 25 27

commented

@srs-bsns You got a seed for that world? I tested quite a few worlds before releasing 1.1.0 and didn't see stone rivers or chunk walls.

commented

Yep, this is definitely a thing. :/

I'll take a look at it tonight.

commented

It doesn't matter the seed as it happens upon reload in any world, but lately I've been doing all of my testing with -3501856892360849268

Try this:

  1. Create and join a new world and don't move.
  2. Exit to main menu.
  3. Reload the world and fly around away from spawn.

Most times there will be chunk walls in a square shape around the spawn area. If not, fly around a bit more and create some new chunks, then rinse&repeat step 2 -> 3. Upon creating a new world the river remover will work, but upon reloading it won't, so you should see them quite easily.

Note: You can exit to the main menu as many times as you want and create a new world and you will never see this.

The registration event handler is registered on WorldTypeEvent.InitBiomeGens, which I (probably incorrectly) assumed would fire when a world is loaded, and not just when it is created. So, registering that handler on just WorldTypeEvent MAY fix it (only if any WorldTypeEvent is fired on world load), or, we may need to pick a different event to register those handlers.

The reason I chose WorldTypeEvent.InitBiomeGens is because it happens sufficiently early in the event chain and if the terrain event handlers are registered later, then they (I think just the river remover) are too late to do what they need to do and therefore wont work. There might be an earlier event to do the registration than WorldTypeEvent, though I'm not sure without looking into it.

I think the FMLServerAboutToStartEvent is too late for the river remover (It doesn't sound like it should be, but IIRC it is), but it can always be tried. In this event, event.getServer().getEntityWorld().getWorldInfo().getTerrainType() should return the proper WorldType to check against.

commented

Most times there will be chunk walls in a square shape around the spawn area.

Yeah, I got that when I tested a world before leaving work today. In all of my testing before the release, logging out immediately after joining the world isn't something that I thought to do.

Now that we know what's happening, it should hopefully be pretty straight-forward to fix. (But don't quote me on that! ๐Ÿ˜› )

commented

Fixed in 1.7.10 & 1.10.2