aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/api/ClientHelper.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-01-03 23:20:31 +0800
committershedaniel <daniel@shedaniel.me>2020-01-03 23:20:31 +0800
commit2077ebf086543587c4fc7ca9b125809609f749b9 (patch)
tree2d8bbbb075809c4dac0a701de238dfaf4d6b092a /src/main/java/me/shedaniel/rei/api/ClientHelper.java
parent3e5c16747b3403cc4cc725676c13ba50f04d3e9b (diff)
downloadRoughlyEnoughItems-2077ebf086543587c4fc7ca9b125809609f749b9.tar.gz
RoughlyEnoughItems-2077ebf086543587c4fc7ca9b125809609f749b9.tar.bz2
RoughlyEnoughItems-2077ebf086543587c4fc7ca9b125809609f749b9.zip
Compact the design and add cooking xp details
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.