-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweaking copper ore Crashes on world gen #55
Comments
Can you send me a link to a pastbin of your copper json file? |
it only happens when changing the values for dripstone caves. |
I will look into it first thing after I get home from work. OreTweaker does not really like mods that change to much things about world generation. |
it crashes without terrablender also |
Okey, good to know. Then its not Terrablenders fault. |
Ok did some more testing, if you change values for both entries it will crash, if you only change one or the other it does not crash, here the json that causes the crash i removed bop and terrablender and still get the crash, thank you for looking into this. |
Found the issue @Cracks777. Ore Tweaker uses the properties in the The exact alogritem for creating a unique name I use is: String registryName = String.format("%s_%s_%s_%s_%s_%s_feature",
Objects.requireNonNull(ore.getRegistryName()).getPath(),
fillerName,
minY,
maxY,
spawnRate,
maxVeinSize
); But since both your entries have the exact same values for these probs the second entry ends up with a duplicated name of the first one. I am releasing a simple fix to check if a name is available, if not it will auto append a number behind it to not collide with the name of the first entry. This was a design flaw when I designed this system. Thanks for finding it. |
Created a test build if you want to validate that it works for you now. If its stable I will release it on CurseForge tomorrow for 1.16, 1.17 and 1.18.1/2 |
New code should make it impossible to create duplicates. private static String makeRegistryNameUnique(String name) {
if (registryNames.contains(name)) {
int i = 1;
while (registryNames.contains(name + "_" + i)) {
i++;
}
return name + "_" + i;
}
return name;
}
private static final List<String> registryNames = new ArrayList<>();
private static String createUniqueRegistryName(Block block, String filler, int minY, int maxY, float spawnRate, int maxVeinSize, float discardChanceOnAirExposure, String distribution, boolean isDeepSlate, String featureType) {
String registryName;
if (isDeepSlate) {
registryName = String.format("deepslate_%s_%s_%s_%s_%s_%s_%s_%s_%s_feature",
Objects.requireNonNull(block.getRegistryName()).getPath(),
filler,
minY,
maxY,
spawnRate,
maxVeinSize,
discardChanceOnAirExposure,
distribution,
featureType
);
} else {
registryName = String.format("ore_%s_%s_%s_%s_%s_%s_%s_%s_%s_feature",
Objects.requireNonNull(block.getRegistryName()).getPath(),
filler,
minY,
maxY,
spawnRate,
maxVeinSize,
discardChanceOnAirExposure,
distribution,
featureType
);
}
registryName = makeRegistryNameUnique(registryName);
ModLogger.debug("Registry Name: " + registryName);
registryNames.add(registryName);
return registryName;
} |
yes, It worked just fine. thank you for the fast response. |
Fixed for 1.16, 1.18.1 and 1.18.2 https://www.curseforge.com/minecraft/mc-mods/ore-tweaker/files |
Minecraft Version
Forge Version
Mod Version
Describe the bug
How to reproduce
**Link to [crashlog]
The text was updated successfully, but these errors were encountered: