maruohon / paintedbiomes

A Minecraft mod which allocates the biomes based on image templates.
GNU General Public License v3.0
13 stars 3 forks source link

1.12.2 Something seems incompatible with SpongeForge (1.12.2-2768-7.1.4) #9

Closed Azvalk closed 3 years ago

Azvalk commented 5 years ago

Hi ^^ I report a issue with SpongeForge. On a server with SpongeForge, the mod seems to work, as we can see here:

[17:35:16] [Server thread/INFO] [paintedbiomes]: Wrapping the BiomeProvider (of type net.minecraft.world.biome.BiomeProvider) of dimension 0 with fi.dy.masa.paintedbiomes.world.BiomeProviderPaintedBiomes

[17:35:16] [Server thread/INFO] [paintedbiomes]: Successfully read template image from 'Z:\Project\SERVEUR PLUGIN\config\paintedbiomes\templates\dim0\biomes.png' (dimensions: 4000x4000)

But, in the game, no visible effect .. and no error. I tested several things before removing SpongeForge and seeing the mod work. So, I put SpongeForge back in its place and changed that configuration: B: useGenLayer = false to true And this time, the mod had an effect. The shape of the world corresponds to the template, but the biomes are not there ..

The problem would come from the WorldChunkManager? SpongeForge would have priority?

maruohon commented 5 years ago

Could you try adding the latest 1.6.0 beta version of Just Enough Dimensions to the server, and run the /jed debug command in the overworld on the SpongeForge server, both with and without Painted Biomes installed (while having B: useGenLayer = false). And paste the command output from both cases.

Azvalk commented 5 years ago

With Painted Biome

Without

I see thatChunkProviderServer.chunkGenerator is org.spongepowered.mod.world.gen.SpongeChunkGeneratorForge in both case =/ normal ? Without SpongeForge, it's ChunkProviderServer.chunkGenerator: net.minecraft.world.gen.ChunkGeneratorOverworld

maruohon commented 5 years ago

I just remembered that I had fixed a related issue in JED when it's run under Sponge, in this commit: https://github.com/maruohon/justenoughdimensions/commit/847ed570c1218b93256be802fb5a20b4db3da798 So I have to look again how and when exactly Sponge gets the BiomeProvider and how it uses it, and whether or not it's possible for PB to override it any earlier so that it would work under Sponge too.

Edit: You said that the useGenLayer option also doesn't work properly? The terrain shape corresponds to the template biome, but the biome ID doesn't? What about surface blocks and decoration?

Azvalk commented 5 years ago

ah..it seems that biomes are present.. but, the result is different ^^' With useGenLayer: true, on the server with SpongeForge With useGenLayer: false, on singleplayer

maruohon commented 5 years ago

It looks like Sponge grabs the BiomeProvider as early as from some calls that happen from the WorldServer constructor, which means that it's not possible for me to override the BiomeProvider from Painted Biomes early enough for Sponge to have and use the Painted Biomes Biome Provider.

I think the only PB-only solution would be to add/use a Painted Biomes WorldType, so that the created WorldServer could get the PB BiomeProvider from that in the first place.

Another option would be to add a little bit more flexible BiomeProvider support to JED, and then possibly JED could be used to create the PB BiomeProvider without having to use a custom PB WorldType. That should hopefully allow using some other WorldType, like BIOMESOP, and thus have the BoP biomes be decorated properly, as that only happens if the BIOMESOP WorldType is used. In other words, if you wanted to use Painted Biomes and use some BoP biomes, then a PaintedBiomes WorldType couldn't be used.

Azvalk commented 5 years ago

Okay '-' .. I think I understood.. Good luck with that ^^ I think I prefer the solution with the participation of JED. There is some mods that have interesting worlds types, Quark and maybe one day RTG.. For now I simply use the GenLayer option, it works fine ^^ Thank you for your work, I will test all your future versions to keep you informed of any issue that may occur. =)

maruohon commented 5 years ago

Okay I did the changes/additions to basically add support for JED using the Painted Biomes BiomeProvider. The test builds with that support in place are here:

So to use this, in PB set useGenLayer to false, and somewhat counter-intuitively also don't add the target dimension to the enabledInDimensions list in Painted Biomes, unless you want to use PB in multiple dimensions with different per-dimension configs, then you would need to add it there... But it might also cause stuff to get messed up under Sponge if PB also tries to override the BiomeProvider, so I don't know if multi-dimension support really works unless I add a separate option for not overriding the BiomeProvider on PB's side (which is what the enabledInDimensions option also does, and why you want to leave it disabled if using JED to set the BiomeProvider).

And for JED, there is a new biomeprovider option where you set the class to use, here is an example: https://pastebin.com/xZuH3Z83