You need to extend MapGenScatteredFeatures and replace the default instance with your own using InitMapGenEvent.
I've written an example of this here. This uses Forge's biome dictionary instead of a hardcoded biome list, allowing the structures to spawn in mod biomes equivalent to the vanilla ones.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Did you register the structure start and the event handler?
Scattered features are fairly rare, it may take a while to make one generate. While testing this, I added my own desert biome and registered with weight 1000 to make it spawn fairly often.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
You're calling TerrainGen.getModdedMapGen in an intializer block, which is run after the call to the super constructor but before any other code in the constructor. This means that the result of getModdedMapGen is being replaced with the vanilla instance in the constructor. Moving the getModdedMapGen calls into the constructor will fix this.
The version of Forge you're using also does this, but it was fixed in a more recent version so the result of getModdedMapGen is actually used. I'd recommend updating Forge to the current recommended version.
In CustomChunkProvider#placeBiomeBlocks, you're referencing the old cm.customBiome field (which is no longer set and can be deleted) instead of ModBiomes.firestone. This was causing a NullPointerException when first travelling to your dimension.
You should delete the Forge/FML licenses, credits and changelog, add this .gitignore file to your repository and then run the commands in this StackOverflow answer. This will tell Git to ignore any Gradle and IDE files that you don't need in your repository.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
...You know more about my code than I do...How is that even possible?
I just cloned your repository and did some testing.
For the getModdedMapGen call, I noticed that you'd done it differently (copying Forge's addition to the vanilla code) to the version of Forge I tested my own mod against; so I looked at Forge's patch for the class on GitHub and found the commit fixing the order of the calls. I had to look up how non-static initializer blocks worked, I'd never seen them used before (and I've never seen static initializer blocks used outside of Minecraft/Forge).
I got the NullPointerException for cm.customBiome when travelling to your dimension in a new world during testing and changing it to ModBiomes.firestone fixed that.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The Meaning of Life, the Universe, and Everything.
Join Date:
2/4/2013
Posts:
97
Member Details
where do I move getModdedMapGen? There is no super constructor in that classThe .git files were added by github. I don't fully understand how to push files to github without using the application.
where did I call getModdedMapGen? The .git files were added by github. I don't fully understand how to push files to github without using the application.
Just delete the files I talked about, copy the .gitignore file into your mod's root directory (where build.gradle and the gradlew scripts are) and commit the changes. Then run the commands in the StackOverflow answer.
If you're using GitHub for Windows, you can add/edit .gitignore from the Settings (cog/gear) > Repository Settings > Ignored Files menu.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The Meaning of Life, the Universe, and Everything.
Join Date:
2/4/2013
Posts:
97
Member Details
I updated my forge version, and copied over my code, a lot of the vanilla textures are white squares, I am using github for Mac, and there is no gear and it is not in preferences.
In that case, just create a file named .gitignore and copy the contents of the .gitignore file I linked into it.
I'm not sure what would cause white squares for vanilla textures.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The Meaning of Life, the Universe, and Everything.
Join Date:
2/4/2013
Posts:
97
Member Details
I have found the custom biome you made, no structures except things like lakes, lava lakes, and ravines. I added the .gitignore, but it saved as a .txt
I ran a test world with a command block that teleported me 500 blocks east (towards positive X) every 30 seconds or so. It took a very long time, but I eventually found an occurrence of your biome with the scattered features generated in it. They're extremely rare, so it will probably take a while to find one.
I noticed that all three structures generated on top of each other because you registered your biome with all three types. You may want to make them mutually exclusive in the Start inner class. I didn't realise that they'd all generate in the same spot if a biome was registered with more than one type.
Just rename .gitignore.txt to .gitignore.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
how can I increase the odds of the structures spawning
Reduce maxDistanceBetweenScatteredFeatures to make them more common. If you want to keep the same spawn rate in the overworld and only lower it for your dimension, check if this.worldObj.provider is an instance of CustomWorldProvider.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
How can I make a custom biome spawn Jungle and desert temples?
You need to extend MapGenScatteredFeatures and replace the default instance with your own using InitMapGenEvent.
I've written an example of this here. This uses Forge's biome dictionary instead of a hardcoded biome list, allowing the structures to spawn in mod biomes equivalent to the vanilla ones.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I implemented the code and the logger, it still isn't there.
Did you register the structure start and the event handler?
Scattered features are fairly rare, it may take a while to make one generate. While testing this, I added my own desert biome and registered with weight 1000 to make it spawn fairly often.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I added that. Here is my code, is there anything I left out?
You're calling TerrainGen.getModdedMapGen in an intializer block, which is run after the call to the super constructor but before any other code in the constructor. This means that the result of getModdedMapGen is being replaced with the vanilla instance in the constructor. Moving the getModdedMapGen calls into the constructor will fix this.
The version of Forge you're using also does this, but it was fixed in a more recent version so the result of getModdedMapGen is actually used. I'd recommend updating Forge to the current recommended version.
In CustomChunkProvider#placeBiomeBlocks, you're referencing the old cm.customBiome field (which is no longer set and can be deleted) instead of ModBiomes.firestone. This was causing a NullPointerException when first travelling to your dimension.
You should delete the Forge/FML licenses, credits and changelog, add this .gitignore file to your repository and then run the commands in this StackOverflow answer. This will tell Git to ignore any Gradle and IDE files that you don't need in your repository.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
...You know more about my code than I do...How is that even possible?
I just cloned your repository and did some testing.
For the getModdedMapGen call, I noticed that you'd done it differently (copying Forge's addition to the vanilla code) to the version of Forge I tested my own mod against; so I looked at Forge's patch for the class on GitHub and found the commit fixing the order of the calls. I had to look up how non-static initializer blocks worked, I'd never seen them used before (and I've never seen static initializer blocks used outside of Minecraft/Forge).
I got the NullPointerException for cm.customBiome when travelling to your dimension in a new world during testing and changing it to ModBiomes.firestone fixed that.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
where do I move getModdedMapGen? There is no super constructor in that classThe .git files were added by github. I don't fully understand how to push files to github without using the application.
In CustomChunkProvider, here.
Just delete the files I talked about, copy the .gitignore file into your mod's root directory (where build.gradle and the gradlew scripts are) and commit the changes. Then run the commands in the StackOverflow answer.
If you're using GitHub for Windows, you can add/edit .gitignore from the Settings (cog/gear) > Repository Settings > Ignored Files menu.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I updated my forge version, and copied over my code, a lot of the vanilla textures are white squares, I am using github for Mac, and there is no gear and it is not in preferences.
In that case, just create a file named .gitignore and copy the contents of the .gitignore file I linked into it.
I'm not sure what would cause white squares for vanilla textures.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I have found the custom biome you made, no structures except things like lakes, lava lakes, and ravines. I added the .gitignore, but it saved as a .txt
I ran a test world with a command block that teleported me 500 blocks east (towards positive X) every 30 seconds or so. It took a very long time, but I eventually found an occurrence of your biome with the scattered features generated in it. They're extremely rare, so it will probably take a while to find one.
I noticed that all three structures generated on top of each other because you registered your biome with all three types. You may want to make them mutually exclusive in the Start inner class. I didn't realise that they'd all generate in the same spot if a biome was registered with more than one type.
Just rename .gitignore.txt to .gitignore.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
how can I make all 3 spawn in the same biome, not on top of each other, and how can I increase the odds of the structures spawning
I'd recommend using WeightedRandom, like this.
Reduce maxDistanceBetweenScatteredFeatures to make them more common. If you want to keep the same spawn rate in the overworld and only lower it for your dimension, check if this.worldObj.provider is an instance of CustomWorldProvider.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thanks