aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/client
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-01-18 21:22:16 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-01-18 21:22:16 +0800
commitbf526920c4ab4bb6719e27c305a35e1772b2873b (patch)
treeef0079b05d9f0cb8f463af7e53d1cf9dcc55ea7c /src/main/java/me/shedaniel/rei/client
parent20110cfeefadb676be66ad2d195e62e0dc136c07 (diff)
downloadRoughlyEnoughItems-bf526920c4ab4bb6719e27c305a35e1772b2873b.tar.gz
RoughlyEnoughItems-bf526920c4ab4bb6719e27c305a35e1772b2873b.tar.bz2
RoughlyEnoughItems-bf526920c4ab4bb6719e27c305a35e1772b2873b.zip
Can't compile yet
Diffstat (limited to 'src/main/java/me/shedaniel/rei/client')
-rw-r--r--src/main/java/me/shedaniel/rei/client/ClientHelper.java127
-rw-r--r--src/main/java/me/shedaniel/rei/client/ConfigHelper.java6
-rw-r--r--src/main/java/me/shedaniel/rei/client/GuiHelper.java7
-rw-r--r--src/main/java/me/shedaniel/rei/client/RecipeHelper.java52
4 files changed, 90 insertions, 102 deletions
diff --git a/src/main/java/me/shedaniel/rei/client/ClientHelper.java b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
index fbbd4a93b..4668f552a 100644
--- a/src/main/java/me/shedaniel/rei/client/ClientHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ClientHelper.java
@@ -2,48 +2,44 @@ package me.shedaniel.rei.client;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
-import io.netty.buffer.Unpooled;
-import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.IRecipeCategory;
import me.shedaniel.rei.api.IRecipeDisplay;
import me.shedaniel.rei.gui.ContainerGuiOverlay;
import me.shedaniel.rei.gui.widget.ConfigWidget;
import me.shedaniel.rei.gui.widget.RecipeViewingWidget;
import me.shedaniel.rei.listeners.ClientLoaded;
-import me.shedaniel.rei.listeners.IMixinContainerGui;
-import net.fabricmc.api.ClientModInitializer;
-import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
-import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl;
-import net.fabricmc.loader.FabricLoader;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.Mouse;
-import net.minecraft.client.gui.Gui;
-import net.minecraft.client.util.InputUtil;
+import me.shedaniel.rei.listeners.IMixinGuiContainer;
+import me.shedaniel.rei.network.CreateItemsMessage;
+import me.shedaniel.rei.network.DeleteItemsMessage;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.MouseHelper;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.client.settings.KeyBinding;
+import net.minecraft.client.util.InputMappings;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
-import net.minecraft.item.Items;
-import net.minecraft.server.network.packet.CustomPayloadServerPacket;
-import net.minecraft.util.DefaultedList;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.PacketByteBuf;
-import net.minecraft.util.registry.Registry;
+import net.minecraft.network.EnumPacketDirection;
+import net.minecraft.util.NonNullList;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.registry.IRegistry;
+import org.dimdev.rift.listener.client.KeyBindingAdder;
+import org.dimdev.riftloader.RiftLoader;
import java.awt.*;
-import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.*;
import java.util.List;
-import java.util.Map;
-public class ClientHelper implements ClientLoaded, ClientModInitializer {
+public class ClientHelper implements ClientLoaded, KeyBindingAdder {
- private static final Identifier RECIPE_KEYBIND = new Identifier("roughlyenoughitems", "recipe_keybind");
- private static final Identifier USAGE_KEYBIND = new Identifier("roughlyenoughitems", "usage_keybind");
- private static final Identifier HIDE_KEYBIND = new Identifier("roughlyenoughitems", "hide_keybind");
- public static FabricKeyBinding RECIPE, USAGE, HIDE;
+ private static final ResourceLocation RECIPE_KEYBIND = new ResourceLocation("roughlyenoughitems", "recipe_keybind");
+ private static final ResourceLocation USAGE_KEYBIND = new ResourceLocation("roughlyenoughitems", "usage_keybind");
+ private static final ResourceLocation HIDE_KEYBIND = new ResourceLocation("roughlyenoughitems", "hide_keybind");
+ public static KeyBinding RECIPE, USAGE, HIDE;
private static List<ItemStack> itemList;
- private static boolean cheating;
+ private static boolean cheating = false;
public ClientHelper() {
this.itemList = Lists.newLinkedList();
@@ -51,19 +47,16 @@ public class ClientHelper implements ClientLoaded, ClientModInitializer {
public static String getModFromItemStack(ItemStack stack) {
if (!stack.isEmpty()) {
- Identifier location = Registry.ITEM.getId(stack.getItem());
+ ResourceLocation location = IRegistry.ITEM.getKey(stack.getItem());
assert location != null;
String modid = location.getNamespace();
if (modid.equalsIgnoreCase("minecraft"))
return "Minecraft";
- return FabricLoader.INSTANCE.getModContainers().stream()
- .map(modContainer -> {
- return modContainer.getInfo();
- })
- .filter(modInfo -> modInfo.getId().equals(modid) || (modInfo.getName() != null && modInfo.getName().equals(modid)))
+ return RiftLoader.instance.getMods().stream()
+ .filter(modInfo -> modInfo.id.equals(modid) || (modInfo.name != null && modInfo.name.equals(modid)))
.findFirst().map(modInfo -> {
- if (modInfo.getName() != null)
- return modInfo.getName();
+ if (modInfo.name != null)
+ return modInfo.name;
return modid;
}).orElse(modid);
}
@@ -75,10 +68,10 @@ public class ClientHelper implements ClientLoaded, ClientModInitializer {
}
public static Point getMouseLocation() {
- MinecraftClient client = MinecraftClient.getInstance();
- Mouse mouse = client.mouse;
- double double_1 = mouse.getX() * (double) client.window.getScaledWidth() / (double) client.window.getWidth();
- double double_2 = mouse.getY() * (double) client.window.getScaledHeight() / (double) client.window.getHeight();
+ Minecraft client = Minecraft.getInstance();
+ MouseHelper mouse = client.mouseHelper;
+ double double_1 = mouse.getMouseX() * (double) client.mainWindow.getScaledWidth() / (double) client.mainWindow.getWidth();
+ double double_2 = mouse.getMouseY() * (double) client.mainWindow.getScaledHeight() / (double) client.mainWindow.getHeight();
return new Point((int) double_1, (int) double_2);
}
@@ -91,42 +84,41 @@ public class ClientHelper implements ClientLoaded, ClientModInitializer {
}
public static void sendDeletePacket() {
- PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
- MinecraftClient.getInstance().getNetworkHandler().sendPacket(new CustomPayloadServerPacket(RoughlyEnoughItemsCore.DELETE_ITEMS_PACKET, buf));
+ DeleteItemsMessage message = new DeleteItemsMessage();
+ Minecraft.getInstance().getConnection().sendPacket(message.toPacket(EnumPacketDirection.CLIENTBOUND));
}
public static boolean tryCheatingStack(ItemStack cheatedStack) {
try {
- PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
- buf.writeItemStack(cheatedStack.copy());
- MinecraftClient.getInstance().getNetworkHandler().sendPacket(new CustomPayloadServerPacket(RoughlyEnoughItemsCore.CREATE_ITEMS_PACKET, buf));
+ CreateItemsMessage message = new CreateItemsMessage(cheatedStack.copy());
+ Minecraft.getInstance().getConnection().sendPacket(message.toPacket(EnumPacketDirection.CLIENTBOUND));
return true;
} catch (Exception e) {
return false;
}
}
- public static boolean executeRecipeKeyBind(ContainerGuiOverlay overlay, ItemStack stack, IMixinContainerGui parent) {
+ public static boolean executeRecipeKeyBind(ContainerGuiOverlay overlay, ItemStack stack, IMixinGuiContainer parent) {
Map<IRecipeCategory, List<IRecipeDisplay>> map = RecipeHelper.getRecipesFor(stack);
if (map.keySet().size() > 0)
- MinecraftClient.getInstance().openGui(new RecipeViewingWidget(MinecraftClient.getInstance().window, parent, map));
+ Minecraft.getInstance().displayGuiScreen(new RecipeViewingWidget(Minecraft.getInstance().mainWindow, parent, map));
return map.keySet().size() > 0;
}
- public static boolean executeUsageKeyBind(ContainerGuiOverlay overlay, ItemStack stack, IMixinContainerGui parent) {
+ public static boolean executeUsageKeyBind(ContainerGuiOverlay overlay, ItemStack stack, IMixinGuiContainer parent) {
Map<IRecipeCategory, List<IRecipeDisplay>> map = RecipeHelper.getUsagesFor(stack);
if (map.keySet().size() > 0)
- MinecraftClient.getInstance().openGui(new RecipeViewingWidget(MinecraftClient.getInstance().window, parent, map));
+ Minecraft.getInstance().displayGuiScreen(new RecipeViewingWidget(Minecraft.getInstance().mainWindow, parent, map));
return map.keySet().size() > 0;
}
- public static void openConfigWindow(Gui parent) {
- MinecraftClient.getInstance().openGui(new ConfigWidget(parent));
+ public static void openConfigWindow(GuiScreen parent) {
+ Minecraft.getInstance().displayGuiScreen(new ConfigWidget(parent));
}
public static List<ItemStack> getInventoryItemsTypes() {
- List<DefaultedList<ItemStack>> field_7543 = ImmutableList.of(MinecraftClient.getInstance().player.inventory.main, MinecraftClient.getInstance().player.inventory.armor
- , MinecraftClient.getInstance().player.inventory.offHand);
+ List<NonNullList<ItemStack>> field_7543 = ImmutableList.of(Minecraft.getInstance().player.inventory.mainInventory, Minecraft.getInstance().player.inventory.armorInventory
+ , Minecraft.getInstance().player.inventory.offHandInventory);
List<ItemStack> inventoryStacks = new ArrayList<>();
field_7543.forEach(itemStacks -> itemStacks.forEach(itemStack -> {
if (!itemStack.getItem().equals(Items.AIR))
@@ -137,25 +129,25 @@ public class ClientHelper implements ClientLoaded, ClientModInitializer {
@Override
public void clientLoaded() {
- Registry.ITEM.forEach(item -> {
+ IRegistry.ITEM.forEach(item -> {
if (!item.equals(Items.ENCHANTED_BOOK))
registerItem(item);
});
- Registry.ENCHANTMENT.forEach(enchantment -> {
- for(int i = enchantment.getMinimumLevel(); i < enchantment.getMaximumLevel(); i++) {
+ IRegistry.ENCHANTMENT.forEach(enchantment -> {
+ for(int i = enchantment.getMinLevel(); i < enchantment.getMaxLevel(); i++) {
Map<Enchantment, Integer> map = new HashMap<>();
map.put(enchantment, i);
ItemStack itemStack = new ItemStack(Items.ENCHANTED_BOOK);
- EnchantmentHelper.set(map, itemStack);
+ EnchantmentHelper.setEnchantments(map, itemStack);
registerItemStack(itemStack);
}
});
}
public void registerItem(Item item) {
- registerItemStack(item.getDefaultStack());
- DefaultedList<ItemStack> stacks = DefaultedList.create();
- item.addStacksForDisplay(item.getItemGroup(), stacks);
+ registerItemStack(item.getDefaultInstance());
+ NonNullList<ItemStack> stacks = NonNullList.create();
+ item.fillItemGroup(item.getGroup(), stacks);
stacks.forEach(this::registerItemStack);
}
@@ -166,23 +158,18 @@ public class ClientHelper implements ClientLoaded, ClientModInitializer {
private boolean alreadyContain(ItemStack stack) {
for(ItemStack itemStack : itemList)
- if (ItemStack.areEqual(stack, itemStack))
+ if (ItemStack.areItemsEqual(stack, itemStack))
return true;
return false;
}
@Override
- public void onInitializeClient() {
- this.cheating = false;
- registerFabricKeyBinds();
- }
-
- private void registerFabricKeyBinds() {
+ public Collection<? extends KeyBinding> getKeyBindings() {
String category = "key.rei.category";
- KeyBindingRegistryImpl.INSTANCE.addCategory(category);
- KeyBindingRegistryImpl.INSTANCE.register(RECIPE = FabricKeyBinding.Builder.create(RECIPE_KEYBIND, InputUtil.Type.KEY_KEYBOARD, 82, category).build());
- KeyBindingRegistryImpl.INSTANCE.register(USAGE = FabricKeyBinding.Builder.create(USAGE_KEYBIND, InputUtil.Type.KEY_KEYBOARD, 85, category).build());
- KeyBindingRegistryImpl.INSTANCE.register(HIDE = FabricKeyBinding.Builder.create(HIDE_KEYBIND, InputUtil.Type.KEY_KEYBOARD, 79, category).build());
+ List<KeyBinding> keyBindings = Lists.newArrayList();
+ keyBindings.add(RECIPE = new KeyBinding(RECIPE_KEYBIND.toString().replaceAll(":", "."), InputMappings.Type.KEYSYM, 82, category));
+ keyBindings.add(USAGE = new KeyBinding(USAGE_KEYBIND.toString().replaceAll(":", "."), InputMappings.Type.KEYSYM, 85, category));
+ keyBindings.add(HIDE = new KeyBinding(HIDE_KEYBIND.toString().replaceAll(":", "."), InputMappings.Type.KEYSYM, 79, category));
+ return keyBindings;
}
-
}
diff --git a/src/main/java/me/shedaniel/rei/client/ConfigHelper.java b/src/main/java/me/shedaniel/rei/client/ConfigHelper.java
index 3f1cb79c2..1d3a7e4e4 100644
--- a/src/main/java/me/shedaniel/rei/client/ConfigHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/ConfigHelper.java
@@ -1,7 +1,7 @@
package me.shedaniel.rei.client;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
-import net.fabricmc.loader.FabricLoader;
+import org.dimdev.riftloader.RiftLoader;
import java.io.File;
import java.io.FileWriter;
@@ -16,9 +16,11 @@ public class ConfigHelper {
private boolean craftableOnly;
public ConfigHelper() {
- this.configFile = new File(FabricLoader.INSTANCE.getConfigDirectory(), "rei.json");
+ this.configFile = new File(RiftLoader.instance.configDir, "rei.json");
this.craftableOnly = false;
try {
+ if (!configFile.getParentFile().exists() || !configFile.getParentFile().isDirectory())
+ configFile.getParentFile().mkdirs();
loadConfig();
} catch (IOException e) {
e.printStackTrace();
diff --git a/src/main/java/me/shedaniel/rei/client/GuiHelper.java b/src/main/java/me/shedaniel/rei/client/GuiHelper.java
index bae2d852a..4b228b3a6 100644
--- a/src/main/java/me/shedaniel/rei/client/GuiHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/GuiHelper.java
@@ -3,8 +3,7 @@ package me.shedaniel.rei.client;
import com.google.common.collect.Lists;
import me.shedaniel.rei.gui.ContainerGuiOverlay;
import me.shedaniel.rei.gui.widget.TextFieldWidget;
-import me.shedaniel.rei.listeners.IMixinContainerGui;
-import net.minecraft.client.gui.ContainerGui;
+import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import java.util.List;
@@ -12,9 +11,9 @@ import java.util.List;
public class GuiHelper {
public static TextFieldWidget searchField;
+ public static List<ItemStack> inventoryStacks = Lists.newArrayList();
private static boolean overlayVisible = true;
private static ContainerGuiOverlay overlay;
- public static List<ItemStack> inventoryStacks = Lists.newArrayList();
public static boolean isOverlayVisible() {
return overlayVisible;
@@ -24,7 +23,7 @@ public class GuiHelper {
overlayVisible = !overlayVisible;
}
- public static ContainerGuiOverlay getOverlay(ContainerGui lastGui) {
+ public static ContainerGuiOverlay getOverlay(GuiContainer lastGui) {
if (overlay == null) {
overlay = new ContainerGuiOverlay(lastGui);
overlay.onInitialized();
diff --git a/src/main/java/me/shedaniel/rei/client/RecipeHelper.java b/src/main/java/me/shedaniel/rei/client/RecipeHelper.java
index 32d4f0ba5..f52c426df 100644
--- a/src/main/java/me/shedaniel/rei/client/RecipeHelper.java
+++ b/src/main/java/me/shedaniel/rei/client/RecipeHelper.java
@@ -6,8 +6,8 @@ import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.*;
import me.shedaniel.rei.listeners.RecipeSync;
import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.RecipeManager;
-import net.minecraft.util.Identifier;
+import net.minecraft.item.crafting.RecipeManager;
+import net.minecraft.util.ResourceLocation;
import java.awt.*;
import java.util.*;
@@ -16,11 +16,11 @@ import java.util.stream.Collectors;
public class RecipeHelper implements RecipeSync {
- private static Map<Identifier, List<IRecipeDisplay>> recipeCategoryListMap;
+ private static Map<ResourceLocation, List<IRecipeDisplay>> recipeCategoryListMap;
private static List<IRecipeCategory> categories;
private static RecipeManager recipeManager;
- private static Map<Identifier, SpeedCraftAreaSupplier> speedCraftAreaSupplierMap;
- private static Map<Identifier, List<SpeedCraftFunctional>> speedCraftFunctionalMap;
+ private static Map<ResourceLocation, SpeedCraftAreaSupplier> speedCraftAreaSupplierMap;
+ private static Map<ResourceLocation, List<SpeedCraftFunctional>> speedCraftFunctionalMap;
public RecipeHelper() {
this.recipeCategoryListMap = Maps.newHashMap();
@@ -43,7 +43,7 @@ public class RecipeHelper implements RecipeSync {
boolean slotDone = false;
for(ItemStack possibleType : inventoryItems) {
for(ItemStack slotPossible : slot)
- if (ItemStack.areEqualIgnoreTags(slotPossible, possibleType)) {
+ if (ItemStack.areItemsEqual(slotPossible, possibleType)) {
slotsCraftable++;
slotDone = true;
break;
@@ -60,28 +60,28 @@ public class RecipeHelper implements RecipeSync {
public static void registerCategory(IRecipeCategory category) {
categories.add(category);
- recipeCategoryListMap.put(category.getIdentifier(), Lists.newArrayList());
+ recipeCategoryListMap.put(category.getResourceLocation(), Lists.newArrayList());
}
- public static void registerRecipe(Identifier categoryIdentifier, IRecipeDisplay display) {
+ public static void registerRecipe(ResourceLocation categoryIdentifier, IRecipeDisplay display) {
if (!recipeCategoryListMap.containsKey(categoryIdentifier))
return;
recipeCategoryListMap.get(categoryIdentifier).add(display);
}
public static Map<IRecipeCategory, List<IRecipeDisplay>> getRecipesFor(ItemStack stack) {
- Map<Identifier, List<IRecipeDisplay>> categoriesMap = new HashMap<>();
- categories.forEach(f -> categoriesMap.put(f.getIdentifier(), new LinkedList<>()));
+ Map<ResourceLocation, List<IRecipeDisplay>> categoriesMap = new HashMap<>();
+ categories.forEach(f -> categoriesMap.put(f.getResourceLocation(), new LinkedList<>()));
for(List<IRecipeDisplay> value : recipeCategoryListMap.values())
for(IRecipeDisplay recipeDisplay : value)
for(ItemStack outputStack : (List<ItemStack>) recipeDisplay.getOutput())
- if (ItemStack.areEqualIgnoreTags(stack, outputStack))
+ if (ItemStack.areItemsEqual(stack, outputStack))
categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
categoriesMap.keySet().removeIf(f -> categoriesMap.get(f).isEmpty());
Map<IRecipeCategory, List<IRecipeDisplay>> recipeCategoryListMap = Maps.newHashMap();
categories.forEach(category -> {
- if (categoriesMap.containsKey(category.getIdentifier()))
- recipeCategoryListMap.put(category, categoriesMap.get(category.getIdentifier()));
+ if (categoriesMap.containsKey(category.getResourceLocation()))
+ recipeCategoryListMap.put(category, categoriesMap.get(category.getResourceLocation()));
});
return recipeCategoryListMap;
}
@@ -91,14 +91,14 @@ public class RecipeHelper implements RecipeSync {
}
public static Map<IRecipeCategory, List<IRecipeDisplay>> getUsagesFor(ItemStack stack) {
- Map<Identifier, List<IRecipeDisplay>> categoriesMap = new HashMap<>();
- categories.forEach(f -> categoriesMap.put(f.getIdentifier(), new LinkedList<>()));
+ Map<ResourceLocation, List<IRecipeDisplay>> categoriesMap = new HashMap<>();
+ categories.forEach(f -> categoriesMap.put(f.getResourceLocation(), new LinkedList<>()));
for(List<IRecipeDisplay> value : recipeCategoryListMap.values())
for(IRecipeDisplay recipeDisplay : value) {
boolean found = false;
for(List<ItemStack> input : (List<List<ItemStack>>) recipeDisplay.getInput()) {
for(ItemStack itemStack : input) {
- if (ItemStack.areEqualIgnoreTags(itemStack, stack)) {
+ if (ItemStack.areItemsEqual(itemStack, stack)) {
categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
found = true;
break;
@@ -111,8 +111,8 @@ public class RecipeHelper implements RecipeSync {
categoriesMap.keySet().removeIf(f -> categoriesMap.get(f).isEmpty());
Map<IRecipeCategory, List<IRecipeDisplay>> recipeCategoryListMap = Maps.newHashMap();
categories.forEach(category -> {
- if (categoriesMap.containsKey(category.getIdentifier()))
- recipeCategoryListMap.put(category, categoriesMap.get(category.getIdentifier()));
+ if (categoriesMap.containsKey(category.getResourceLocation()))
+ recipeCategoryListMap.put(category, categoriesMap.get(category.getResourceLocation()));
});
return recipeCategoryListMap;
}
@@ -122,24 +122,24 @@ public class RecipeHelper implements RecipeSync {
}
public static SpeedCraftAreaSupplier getSpeedCraftButtonArea(IRecipeCategory category) {
- if (!speedCraftAreaSupplierMap.containsKey(category.getIdentifier()))
+ if (!speedCraftAreaSupplierMap.containsKey(category.getResourceLocation()))
return bounds -> {
return new Rectangle((int) bounds.getMaxX() - 16, (int) bounds.getMaxY() - 16, 10, 10);
};
- return speedCraftAreaSupplierMap.get(category.getIdentifier());
+ return speedCraftAreaSupplierMap.get(category.getResourceLocation());
}
- public static void registerSpeedCraftButtonArea(Identifier category, SpeedCraftAreaSupplier rectangle) {
+ public static void registerSpeedCraftButtonArea(ResourceLocation category, SpeedCraftAreaSupplier rectangle) {
speedCraftAreaSupplierMap.put(category, rectangle);
}
public static List<SpeedCraftFunctional> getSpeedCraftFunctional(IRecipeCategory category) {
- if (speedCraftFunctionalMap.get(category.getIdentifier()) == null)
+ if (speedCraftFunctionalMap.get(category.getResourceLocation()) == null)
return Lists.newArrayList();
- return speedCraftFunctionalMap.get(category.getIdentifier());
+ return speedCraftFunctionalMap.get(category.getResourceLocation());
}
- public static void registerSpeedCraftFunctional(Identifier category, SpeedCraftFunctional functional) {
+ public static void registerSpeedCraftFunctional(ResourceLocation category, SpeedCraftFunctional functional) {
List<SpeedCraftFunctional> list = speedCraftFunctionalMap.containsKey(category) ? new LinkedList<>(speedCraftFunctionalMap.get(category)) : Lists.newLinkedList();
list.add(functional);
speedCraftFunctionalMap.put(category, list);
@@ -157,8 +157,8 @@ public class RecipeHelper implements RecipeSync {
return second.getPriority() - first.getPriority();
});
RoughlyEnoughItemsCore.LOGGER.info("Loading %d REI plugins: %s", plugins.size(), String.join(", ", plugins.stream().map(plugin -> {
- Identifier identifier = RoughlyEnoughItemsCore.getPluginIdentifier(plugin);
- return identifier == null ? "NULL" : identifier.toString();
+ ResourceLocation ResourceLocation = RoughlyEnoughItemsCore.getPluginResourceLocation(plugin);
+ return ResourceLocation == null ? "NULL" : ResourceLocation.toString();
}).collect(Collectors.toList())));
Collections.reverse(plugins);
plugins.forEach(plugin -> {