TheEnderKiller 0 Report post Posted July 20, 2015 I have created a custom village, and have just copied minecraft's code for now to get things to work. But I'm unsure on how to get the structure to actually generate. I have done the MapGenStructureIO.registerStructure... and the StructureVillagePieces.registerVillagePieces(); in my main mod class. But what more do I have to do? The vanilla structures are generated in ChunkProviderGenerate.class from what I understand, how do I get my structure to spawn? Would InitMapGenEvent help with this? If so, how do I use it properly? EDIT: I created a custom world type, so things work now. I have a new question though, about these two fields in MapGenVillage: this.field_82665_g = 32; this.field_82666_h = 8; Anyone knows what these do? I think the first one has something to do with distance to other villages, but I'm not sure about the other one. Share this post Link to post Share on other sites
TheEnderKiller 0 Report post Posted July 21, 2015 Anyone? Share this post Link to post Share on other sites
TheEnderKiller 0 Report post Posted July 22, 2015 Does no one know anything about this? Share this post Link to post Share on other sites
Choonster 1594 Report post Posted July 23, 2015 Do you want to add buildings to existing villages or create your own villages from scratch? If it's the former, I explain how to do that briefly here. If it's the latter, you may be able to use FML's IWorldGenerator as a wrapper for your MapGenStructure class (since MapGenStructure sets blocks in the World directly rather than using the Block array like other MapGen classes). Share this post Link to post Share on other sites
TheEnderKiller 0 Report post Posted July 24, 2015 Do you want to add buildings to existing villages or create your own villages from scratch? If it's the former, I explain how to do that briefly here. If it's the latter, you may be able to use FML's IWorldGenerator as a wrapper for your MapGenStructure class (since MapGenStructure sets blocks in the World directly rather than using the Block array like other MapGen classes). I'm creating my own custom village separate from the vanilla one. Would this be the only way or is there any other way you can think of which doesn't have anything to do with IWorldGenerator (like the vanilla structures as far as I know)? Share this post Link to post Share on other sites
Choonster 1594 Report post Posted July 24, 2015 ChunkProviderGenerate has a fixed number of fields containing the vanilla structures to generate, but you can replace them with your own using InitMapGenEvent. You may be able to extend MapGenVillage to generate both vanilla villages and your own villages, but it would probably be a fairly hackish solution. Share this post Link to post Share on other sites
TheEnderKiller 0 Report post Posted July 24, 2015 ChunkProviderGenerate has a fixed number of fields containing the vanilla structures to generate, but you can replace them with your own using InitMapGenEvent. You may be able to extend MapGenVillage to generate both vanilla villages and your own villages, but it would probably be a fairly hackish solution. Thanks for your help, I ended up creating a new WorldType with a custom ChunkProviderGenerate instead. I have one more thing to ask, maybe you (or someone else who reads this) know the answer. In MapGenVillage, there are two fields: this.field_82665_g = 32; this.field_82666_h = 8; I think the first one has something to to with distance to other villages, correct me if I'm wrong. But I have no idea what the second one does, can anyone help me here? Share this post Link to post Share on other sites
coolAlias 745 Report post Posted July 24, 2015 If you use your IDE to open the Call Hierarchy on those fields, you can find out where they are used. field_82665_g and field_82666_h are both used to determine if a village can generate in a chunk (x, z) - see MapGenVillage#canSpawnStructureAtCoords for the nitty-gritty. Share this post Link to post Share on other sites