Posted April 14, 20178 yr Hey everyone, when I set up my ore generation system to spawn per chunk, it seems like several of my generators all decide to start their spawning at the same x and z value, causing what looks like a column of ore. Source for individual cluster generation: https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/world/WorldGeneratorCluster.java Source for super: https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/world/WorldGeneratorBase.java Screenshot example: http://prntscr.com/ewltbl This only seems to happen for clusters that only generate once per chunk or once every few chunks; clusters that generate multiple times per chunk seem to work just fine. For more background, I started this mod before COFH was up for 1.10.2, and I decided to make a few changes at the same time. I have a custom ore block that can contain up to 7 different kinds of ores in one, and breaking the block drops ore chunks for each of the contained ores. This functionality is working just fine. Edited April 15, 20178 yr by oa10712
April 14, 20178 yr The hell? https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/world/WorldGeneratorBase.java#L132-L135 Why are you sing random.double() for an integer value? https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/world/WorldGeneratorBase.java#L136 Also, your base Y value is 0, then you add 0, then you add 0 again. Also you randomize X and Z in three different places: https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/world/WorldGeneratorBase.java#L136 https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/world/WorldGeneratorCluster.java#L36 https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/world/WorldGeneratorCluster.java#L36 (or line 42) Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
April 14, 20178 yr Author Most of that was clean at one point, that was my attempt to fix it, the code gets much cleaner when i distribute test jars to people on my server to help find bugs. I will push a cleaner commit. The y value is handled within each of the generators to help in cases where multiple clusters are generated per chunk. Edited April 14, 20178 yr by oa10712
April 15, 20178 yr Author To anyone having similar issues, the Random passed in the generate method of classes implementing IWorldGenerator is chunk dependent, so all generation per chunk essentially "resets" the seed. Edited April 15, 20178 yr by oa10712
April 15, 20178 yr 19 hours ago, oa10712 said: several of my generators all decide to start their spawning at the same x and z value Sounds like your randomizing seed is always the same. Set a breakpoint to see what it is in each instance, then take steps to change it up. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
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.