Jump to content

[ACTUALLY SOLVED] [1.8.9] Trying to override Nether's chunk provider


Dizzlepop12

Recommended Posts

Hi! I'm trying to unregister the Nether dimension ID and create a new dimension with the same chunk provider, but with some minor edits. I've done just that, but the Nether is still using the same default chunk provider instead of the one I set it to use. I basically replaced all Netherrack with Bedrock as a test to see if it would work, but it's still Netherrack.

 

PreInit(Un-register the Nether dimension ID):

https://github.com/Dizzlepop12/Journey/blob/b1c0b5ffad4da86f12dfec5820a59f10cce16012/main/java/net/journey/proxy/CommonProxy.java#L47

 

DimensionHelper(To register the new dimension, line 130 and 145):

https://github.com/Dizzlepop12/Journey/blob/b1c0b5ffad4da86f12dfec5820a59f10cce16012/main/java/net/journey/dimension/DimensionHelper.java#L130

 

New ChunkProvider(Changes Netherrack to Bedrock as a test):

https://github.com/Dizzlepop12/Journey/blob/81c781ef9081752c23de41a0bcae190e9e6ae640/main/java/net/journey/dimension/nether/ChunkProviderNether.java

 

New WorldProvider(Essentially the same, but replaces the ChunkProvider with the new one):

https://github.com/Dizzlepop12/Journey/blob/b1c0b5ffad4da86f12dfec5820a59f10cce16012/main/java/net/journey/dimension/nether/WorldProviderNetherJourney.java

 

Thanks,

-Ryan

Link to comment
Share on other sites

Have you tried to do any debugging and have you looked into unregistering a vanilla dimension cause I'm not sure if that is possible as it would cause a huge problem. Plus DimensionManager.registerDimension() is only ever called in DimensionMessageHandler in the forge source. Not sure when the packet is sent though.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Just about all mods that change the Nether's generation in some way unregister the Nether and recreate the entire dimension using the same ID, BoP is a good example of this. I'm just not sure what other steps need to be made. If I unregister the dimension and don't do anything else, the Nether portal does not work (which means unregistering the dimension is possible without having any issues). But if I try re-adding the dimension, it uses the standard ChunkProvider instead of the custom one I created. I believe the issue has to do with the original ChunkProvider being re-initialized once the DimensionHelper class is loaded, but I'm not sure how to fix that.

Link to comment
Share on other sites

DimensionType.register();

I believe just use the same ID as the nether.

 

Disregard this, unless I am wrong and that does exist in 1.8.9.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

DimensionType.register();

I believe just use the same ID as the nether.

 

Disregard this, unless I am wrong and that does exist in 1.8.9.

 

The class and method have a different name but it has the same variables. What do I use for the provider type? Do I even need this if I already set the WorldProvider in the DimensionHelper class?

Link to comment
Share on other sites

If you didn't see the disregard, DimensionType doesn't exist in 1.8.9, but if you are talking about my last post you do need to unregister the provider because it doesn't override.

 

DimensionManager.registerProvider()

 

public static boolean registerProviderType(int id, Class<? extends WorldProvider> provider, boolean keepLoaded)
    {
        if (providers.containsKey(id))
        {
            return false;
        }
        providers.put(id, provider);
        spawnSettings.put(id, keepLoaded);
        return true;
    }

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

If you didn't see the disregard, DimensionType doesn't exist in 1.8.9, but if you are talking about my last post you do need to unregister the provider because it doesn't override.

 

DimensionManager.registerProvider()

 

public static boolean registerProviderType(int id, Class<? extends WorldProvider> provider, boolean keepLoaded)
    {
        if (providers.containsKey(id))
        {
            return false;
        }
        providers.put(id, provider);
        spawnSettings.put(id, keepLoaded);
        return true;
    }

 

 

It works wonderfully, thank you! Do you know how I could get a certain set of blocks to generate below a certain level in the Nether, like Natura's Tainted Soil? I'm not fond of chunk providers, so I'm a little stuck here.

I already successfully achieved it by using worldGenMinable and generating large amounts of blocks below a certain level, but this results in a lot of lag. The main reason I'm creating a new ChunkProvider is so I can fix this and have a lag-free solution.

Link to comment
Share on other sites

Well since I am not the best when it comes to this, Natura has a github, and it is a mod you are using as a reference. Take this it is dangerous to go alone.

 

https://github.com/progwml6/Natura/blob/master/src/main/java/mods/natura/dimension/NetheriteChunkProvider.java

 

*edit It might be something as simple as checking if the y level is less than a number and set the block you want though.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Oh also mark it as solved please.

I have one last problem though; It seems that my Nether mobs aren't spawning at all, which is weird because I used the BiomeDictionary.getBiomesForType() method, with the type being Type.NETHER. This worked in the past, but it won't work now. I'm sure I could find a loophole somewhere to fix this, but it would make the Nether incompatible with other mods that add entities to the Nether, and only the mobs in my mod would be able to spawn there.

Link to comment
Share on other sites

I don't have a 1.8 workspace setup atm, so could you check if NetherMobs are registered using the BiomeDictionary?

 

*edit Ignore me I'm a little tired It's like 1:30 over here.

 

 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

If you are using the vanilla biomeHell then no, but it could be that you are adding your spawns before it has been initialized I think. Were they working before overriding the The Nether Dimension?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

If you are using the vanilla biomeHell then no, but it could be that you are adding your spawns before it has been initialized I think. Were they working before overriding the The Nether Dimension?

They were spawning before I tried override the Nether. I tried moving the addSpawns to the top of preInit so it would get registered first, but that caused all mobs in the mod to not spawn. I then tried arranging it like so: http://prntscr.com/bzerc1 but that wouldn't work either.

Link to comment
Share on other sites

I'm sorry I should have been more specific, but how about you try moving addSpawns() to your init method?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I'm sorry I should have been more specific, but how about you try moving addSpawns() to your init method?

 

It seems to crash if I do that. I tried putting the addSpawns and init above the unregisters, but that caused it to crash also. The only way to prevent it from crashing is if I put the unregisterDimension and unregisterProvider below the addSpawns and init from the DimensionHelper...

 

http://prntscr.com/bzeve5

It's like a never ending paradox...

 

Edit: Other mobs spawn if I put addSpawns before the unregistering of the Nether, but mobs still don't spawn in the Nether, which leads me to believe the issue lies somewhere else.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.