Skip to content

Commit f58e870

Browse files
committed
Fixed #55
1 parent fa39545 commit f58e870

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
**v1.16.5 - 2.6.0 **
1+
**v1.16.5 - 2.7.0**
2+
* Fixed a game breaking bug where ores with the same properties causes the game to crash.
3+
* Updated to the latest forge version.
4+
5+
**v1.16.5 - 2.6.0**
26
**IMPORTANT UPDATE**
37
* I hope this patch fixes a bug causing all vanilla ores to not generate for some people.
48
* The bug only occurred for some users probably due to their Java VM and some differences in how they cast values.
59
* Some Java VMs fail to format and cast String.format("%s_%s_%d_%d_%f_%d") properly and ends up creating an illegal ResourceLocation for each ore entry.
610
* **Update to this version to fix!**
711

8-
v1.16.5 - 2.5.1
12+
**v1.16.5 - 2.5.1**
913
* Changed template to use new BiomeDictionary Type MOUNTAIN for Emerald Ore and Infested Stone.
1014
* Started working on enhancing performance when generating new chunks and biomes.
1115
* Ore reconstruction from JSON now cashes a lot of stuff to reduce stress on biome loading.

gradle.properties

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
org.gradle.jvmargs=-Xmx3G
33

44
# Mod Info
5-
VERSION=2.6.0
5+
VERSION=2.7.0
66
AUTHOR=Ewy
77
MODNAME=OreTweaker
88
MODID=oretweaker
99

1010
# Dependencies
1111
MC_VERSION=1.16.5
12-
FORGE_VERSION=36.2.9
12+
FORGE_VERSION=36.2.33
1313

1414
# Mappings
1515
MCP_CHANNEL=official
@@ -21,5 +21,4 @@ BIBLIOTHECA=3334930
2121

2222
# Curse Forge
2323
PROJECT_ID=242436
24-
RELEASE_TYPE=release
25-
24+
RELEASE_TYPE=release

src/main/java/com/ewyboy/oretweaker/tweaking/construction/OreReconstruction.java

+16-1
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,28 @@ private static void reconstructFeatureFromJSON() {
6969
}
7070
}
7171

72+
private static String makeRegistryNameUnique(String name) {
73+
if (registryNames.contains(name)) {
74+
int i = 1;
75+
while (registryNames.contains(name + "_" + i)) {
76+
i++;
77+
}
78+
return name + "_" + i;
79+
}
80+
return name;
81+
}
82+
83+
private static final List<String> registryNames = new ArrayList<>();
84+
7285
private static ConfiguredFeature<?, ?> reconstructOre(Block ore, Block filler, int minY, int maxY, float spawnRate, int maxVeinSize) {
7386
ModLogger.debug("Reconstructing ore: " + ore);
74-
String registryName = String.format("%s_%s_%s_%s_%s_%s",
87+
String registryName = String.format("ore_feature_%s_%s_%s_%s_%s_%s",
7588
Objects.requireNonNull(ore.getRegistryName()).getPath(),
7689
Objects.requireNonNull(filler.getRegistryName()).getPath(),
7790
minY, maxY, spawnRate, maxVeinSize
7891
);
92+
registryName = makeRegistryNameUnique(registryName);
93+
registryNames.add(registryName);
7994
return register(
8095
registryName, reconstructFeature(
8196
ore,

0 commit comments

Comments
 (0)