mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-22 13:09:45 +00:00
Complain if IMC adds a handler/catalyst for a handlerID that doesn't exist.
This commit is contained in:
1 parent
a12fadb10d
commit
1076da2511
2 files changed
+41
No files matched your search
@@ -15,6 +15,9 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -227,6 +230,24 @@ public class RecipeCatalysts {
|
||||
}
|
||||
}
|
||||
|
||||
if (!catalystsAdderFromIMC.isEmpty()) {
|
||||
// If we're getting an IMC message, it probably means it should match
|
||||
Set<String> handlerIds = Stream
|
||||
.concat(
|
||||
GuiCraftingRecipe.serialCraftingHandlers.stream(),
|
||||
GuiCraftingRecipe.craftinghandlers.stream())
|
||||
.map(ICraftingHandler::getHandlerId).collect(Collectors.toSet());
|
||||
catalystsAdderFromIMC.keySet().stream().forEach(handlerName -> {
|
||||
if (!handlerIds.contains(handlerName)) {
|
||||
NEIClientConfig.logger.warn("Could not find a registered handlerID that matches " + handlerName);
|
||||
handlerIds.forEach(handler -> {
|
||||
if (handler.equalsIgnoreCase(handlerName)) {
|
||||
NEIClientConfig.logger.warn(" -- Did you mean: " + handler);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
for (Map.Entry<String, List<ItemStack>> entry : catalystsRemoverFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
|
||||
Reference in new issue
Block a user