Skip to content

Commit

Permalink
Bypass NamespacedId forced lowercasing in ItemRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSzabo committed Nov 15, 2024
1 parent e32add7 commit 51ec413
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ public class NamespacedId {

public static final String AURASKILLS = "auraskills";
private final String namespace;
private final String originalKey;
private final String key;

private NamespacedId(String namespace, String key) {
this.namespace = namespace.toLowerCase(Locale.ROOT);
this.originalKey = key;
this.key = key.toLowerCase(Locale.ROOT);
}

Expand All @@ -33,6 +35,15 @@ public String getKey() {
return key;
}

/**
* Gets the original key portion of the NamespacedId, which is the key in the case it was created with.
*
* @return the original key
*/
public String getOriginalKey() {
return originalKey;
}

/**
* Returns the full String representation of the NamespacedId, with a / separating the
* namespace and the key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public ItemStack getItem(NamespacedId key) {
}

ExternalItemProvider provider = externalItemProviders.get(key.getNamespace());
if(provider != null) {
return provider.getItem(key.getKey());
if (provider != null) {
return provider.getItem(key.getOriginalKey());
}

return null;
Expand Down

0 comments on commit 51ec413

Please sign in to comment.