aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/ClientHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/shedaniel/rei/api/ClientHelper.java')
-rw-r--r--src/main/java/me/shedaniel/rei/api/ClientHelper.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/src/main/java/me/shedaniel/rei/api/ClientHelper.java
index 08ab4fcab..112037403 100644
--- a/src/main/java/me/shedaniel/rei/api/ClientHelper.java
+++ b/src/main/java/me/shedaniel/rei/api/ClientHelper.java
@@ -6,7 +6,6 @@
package me.shedaniel.rei.api;
import me.shedaniel.rei.impl.ClientHelperImpl;
-import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
@@ -126,7 +125,19 @@ public interface ClientHelper {
* @param identifier the identifier to find
* @return the mod name
*/
- String getModFromIdentifier(Identifier identifier);
+ default String getModFromIdentifier(Identifier identifier) {
+ if (identifier == null)
+ return "";
+ return getModFromModId(identifier.getNamespace());
+ }
+
+ /**
+ * Gets the mod from a modid
+ *
+ * @param modid the modid of the mod
+ * @return the mod name
+ */
+ String getModFromModId(String modid);
/**
* Finds all recipes and open them in a recipe screen.