Posted July 20, 201510 yr 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.
July 23, 201510 yr 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). Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
July 24, 201510 yr Author 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)?
July 24, 201510 yr 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. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
July 24, 201510 yr Author 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?
July 24, 201510 yr 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. http://i.imgur.com/NdrFdld.png[/img]
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.