Skip to content

Commit

Permalink
Avoid replacing previous atlas registration in case of duplicate regi…
Browse files Browse the repository at this point in the history
…stration
  • Loading branch information
XFactHD committed Oct 8, 2024
1 parent 5f7b32d commit 4602f7c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public RegisterMaterialAtlasesEvent(Map<ResourceLocation, ResourceLocation> atla
* @param atlasInfoLocation The location of the atlas info JSON relative to the {@code atlases} directory
*/
public void register(ResourceLocation atlasLocation, ResourceLocation atlasInfoLocation) {
ResourceLocation oldAtlasInfoLoc = this.atlases.put(atlasLocation, atlasInfoLocation);
ResourceLocation oldAtlasInfoLoc = this.atlases.putIfAbsent(atlasLocation, atlasInfoLocation);
if (oldAtlasInfoLoc != null) {
throw new IllegalStateException(String.format(
"Duplicate registration of atlas: %s (old info: %s, new info: %s)",
Expand Down

0 comments on commit 4602f7c

Please sign in to comment.