mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 20:22:17 +00:00
Rename handlerID field in catalysts.csv and IMC to catalystHandlerID
This commit is contained in:
1 parent
238e945126
commit
9109da8fca
5 files changed
+118
-80
No files matched your search
@@ -143,8 +143,8 @@ Again, this needs additional metadata work, either provided by mods themselves,
|
||||
|
||||
(values are strings if not specified otherwise)
|
||||
|
||||
- **handler:** id of the recipe handler for which this catalyst can be used; it's the fully-qualified handler class name in most cases
|
||||
- example: `vazkii.botania.client.integration.nei.recipe.RecipeHandlerPureDaisy`
|
||||
- **catalystHandlerID:** identifier of the handler for which this catalyst can be used; by default, this should be the overlay identifier, or alternatively the handler identifier if the former is not defined, or `forceClassName` is true; appropriate values can be inferred from the handler information dump described in a following section
|
||||
- example: `vazkii.botania.client.integration.nei.recipe.RecipeHandlerPureDaisy`, or `crafting`
|
||||
- *required*
|
||||
- **itemName:**, and **nbtInfo:** actual catalyst item
|
||||
- example: `Botania:specialFlower` (itemName), `{type:puredaisy}` (nbtInfo)
|
||||
@@ -156,7 +156,7 @@ Again, this needs additional metadata work, either provided by mods themselves,
|
||||
- **priority:** position of the catalyst within the list of all possible catalysts for a given recipe handler; higher priority takes precedence (integer value)
|
||||
- default: `0`
|
||||
- **minVersion:**, and **maxVersion:** only present in `catalysts.csv`, currently unused
|
||||
- **forceClassName:** traditionally, NEI used the fully-qualified handler class name, this restriction is lifted in this version of NEI, allowing handlers to specify their own ID and letting a single handler class act as multiple different handlers; this forces the catalyst to match on the handler class name; only needs to be used in rare cases; only supported in `catalysts.csv` (boolean value)
|
||||
- **forceClassName:** `catalystHandlerID` by default refers to the overlay identifier of the recipe handler and only falls back to the handler identifier if the former is undefined, so this options allows forcing matching the handler identifier even when an overlay identifier exists separately; only supported in `catalysts.csv` (boolean value)
|
||||
- **itemNotes:** ignored by NEI; this field is purely informational for development; not available via IMC
|
||||
|
||||
#### Dumping recipe handler information for debugging
|
||||
@@ -174,8 +174,8 @@ Our version of NEI adds a range of IMC messages for registering handler metadata
|
||||
The following messages are available:
|
||||
- **registerHandlerInfo:** NBT IMC message; allowed keys are specified in the handler metadata section
|
||||
- **removeHandlerInfo:** NBT IMC message; required key: `handler`, ID string of the handler to be removed (usually the fully-qualified name of the handler class)
|
||||
- **registerCatalystInfo:** NBT IMC message; allowed keys are specified in the catalyst metadata section; previously, this accepted the tag `handlerID`, which has been renamed to `handler` to unify it with the CSV column name, the old name has been deprecated
|
||||
- **removeCatalystInfo:** NBT IMC message; required keys: `handlerID` (usually the fully-qualified name of the handler class), `itemName` (optionally specify `nbtInfo` if necessary)
|
||||
- **registerCatalystInfo:** NBT IMC message; allowed keys are specified in the catalyst metadata section
|
||||
- **removeCatalystInfo:** NBT IMC message; required keys: `catalystHandlerID` ( identifier string of the handler from which the catalyst is to be removed), `itemName` (optionally specify `nbtInfo` if necessary)
|
||||
|
||||
Here is an example of how to send the handler and catalyst metadata via IMC:
|
||||
```java
|
||||
@@ -193,7 +193,7 @@ handlerMetadata.setInteger("maxRecipesPerPage", 5);
|
||||
FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", handlerMetadata);
|
||||
|
||||
NBTTagCompound catalystMetadata = new NBTTagCompound();
|
||||
catalystMetadata.setString("handlerID", inscriberHandler.getOverlayIdentifier());
|
||||
catalystMetadata.setString("catalystHandlerID", inscriberHandler.getOverlayIdentifier());
|
||||
catalystMetadata.setString("itemName", GameRegistry.findUniqueIdentifierFor(block));
|
||||
FMLInterModComms.sendMessage("NotEnoughItems", "registerCatalystInfo", catalystMetadata);
|
||||
```
|
||||
@@ -240,4 +240,4 @@ Parts inspired/borrowed/backported from [JEI][JEI112Tree] under the MIT License.
|
||||
Original code Copyright (c) 2014-2015 mezz and was licensed under the MIT License.
|
||||
|
||||
[JEI]: https://github.com/mezz/JustEnoughItems
|
||||
[JEI112Tree]: https://github.com/mezz/JustEnoughItems/tree/1.12
|
||||
[JEI112Tree]: https://github.com/mezz/JustEnoughItems/tree/1.12
|
||||
@@ -350,8 +350,8 @@ public class API {
|
||||
* @param priority higher priority comes first, default to 0
|
||||
*/
|
||||
public static void addRecipeCatalyst(ItemStack stack, IRecipeHandler handler, int priority) {
|
||||
String handlerID = RecipeCatalysts.getRecipeID(handler);
|
||||
addRecipeCatalyst(stack, handlerID, priority);
|
||||
String catalystHandlerID = RecipeCatalysts.getCatalystHandlerId(handler);
|
||||
addRecipeCatalyst(stack, catalystHandlerID, priority);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -370,8 +370,8 @@ public class API {
|
||||
* @param handlerID recipe category identifier (see also {@link RecipeCatalysts#getRecipeID(IRecipeHandler)})
|
||||
* @param priority higher priority comes first, default to 0
|
||||
*/
|
||||
public static void addRecipeCatalyst(ItemStack stack, String handlerID, int priority) {
|
||||
RecipeCatalysts.addRecipeCatalyst(handlerID, new CatalystInfo(stack, priority));
|
||||
public static void addRecipeCatalyst(ItemStack stack, String catalystHandlerID, int priority) {
|
||||
RecipeCatalysts.addRecipeCatalyst(catalystHandlerID, new CatalystInfo(stack, priority));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -382,12 +382,12 @@ public class API {
|
||||
}
|
||||
|
||||
public static void removeRecipeCatalyst(ItemStack stack, IRecipeHandler handler) {
|
||||
String handlerID = RecipeCatalysts.getRecipeID(handler);
|
||||
removeRecipeCatalyst(stack, handlerID);
|
||||
String catalystHandlerID = RecipeCatalysts.getCatalystHandlerId(handler);
|
||||
removeRecipeCatalyst(stack, catalystHandlerID);
|
||||
}
|
||||
|
||||
public static void removeRecipeCatalyst(ItemStack stack, String handlerID) {
|
||||
RecipeCatalysts.removeRecipeCatalyst(handlerID, stack);
|
||||
public static void removeRecipeCatalyst(ItemStack stack, String catalystHandlerID) {
|
||||
RecipeCatalysts.removeRecipeCatalyst(catalystHandlerID, stack);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -398,9 +398,9 @@ public class API {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static void addRecipeCatalyst(List<ItemStack> stacks, String handlerID) {
|
||||
public static void addRecipeCatalyst(List<ItemStack> stacks, String catalystHandlerID) {
|
||||
for (ItemStack stack : stacks) {
|
||||
addRecipeCatalyst(stack, handlerID);
|
||||
addRecipeCatalyst(stack, catalystHandlerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public class IMCHandler {
|
||||
}
|
||||
final NBTTagCompound tag = message.getNBTValue();
|
||||
final String handler = tag.getString("handler");
|
||||
NEIClientConfig.logger.info("Processing removeHandlerInfo `" + handler + "` from " + message.getSender());
|
||||
NEIClientConfig.logger.info("Processing removeHandlerInfo for '{}' from {}", handler, message.getSender());
|
||||
|
||||
GuiRecipeTab.handlerRemoverFromIMC.add(handler);
|
||||
}
|
||||
@@ -126,32 +126,56 @@ public class IMCHandler {
|
||||
}
|
||||
|
||||
if (!processedCatalystSenders.contains(message.getSender())) {
|
||||
NEIClientConfig.logger.info("Processing registerCatalystInfo from " + message.getSender());
|
||||
processedCatalystSenders.add(message.getSender());
|
||||
}
|
||||
final NBTTagCompound tag = message.getNBTValue();
|
||||
final String handlerID = tag.getString("handlerID");
|
||||
if (handlerID.isEmpty()) {
|
||||
NEIClientConfig.logger.warn("Missing handlerID for registerCatalystInfo!");
|
||||
final String catalystHandlerID;
|
||||
if (tag.hasKey("handlerID")) {
|
||||
NEIClientConfig.logger.warn(
|
||||
"Received tag 'handlerID' for registerCatalystInfo IMC from {}, this is deprecated, please use 'catalystHandlerID' instead",
|
||||
message.getSender());
|
||||
catalystHandlerID = tag.getString("handlerID");
|
||||
} else {
|
||||
catalystHandlerID = tag.getString("catalystHandlerID");
|
||||
}
|
||||
if (catalystHandlerID.equals("")) {
|
||||
NEIClientConfig.logger.warn(
|
||||
"registerCatalystInfo IMC from {} is missing required tag 'catalystHandlerID'",
|
||||
message.getSender());
|
||||
return;
|
||||
}
|
||||
NEIClientConfig.logger
|
||||
.info("Processing registerCatalystInfo IMC for '{}' from {}", catalystHandlerID, message.getSender());
|
||||
|
||||
final String modId = tag.hasKey("modId") ? tag.getString("modId") : null;
|
||||
final boolean requiresMod = tag.getBoolean("modRequired");
|
||||
final String excludedModId = tag.hasKey("excludedModId") ? tag.getString("excludedModId") : null;
|
||||
|
||||
if (requiresMod && modId != null && !Loader.isModLoaded(modId)) return;
|
||||
if (excludedModId != null && Loader.isModLoaded(excludedModId)) return;
|
||||
|
||||
final String itemName = tag.getString("itemName");
|
||||
final String nbtInfo = tag.hasKey("nbtInfo") ? tag.getString("nbtInfo") : null;
|
||||
if (itemName.isEmpty()) {
|
||||
NEIClientConfig.logger.warn(String.format("Missing itemName for registerCatalystInfo in `%s`!", handlerID));
|
||||
NEIClientConfig.logger.warn(
|
||||
"registerCatalystInfo IMC for '{}' from {} is missing required tag 'itemName'",
|
||||
catalystHandlerID,
|
||||
message.getSender());
|
||||
return;
|
||||
}
|
||||
final ItemStack itemStack = NEIServerUtils.getModdedItem(itemName, nbtInfo);
|
||||
if (itemStack == null) {
|
||||
NEIClientConfig.logger.warn(String.format("Cannot find item `%s`!", itemName));
|
||||
NEIClientConfig.logger.warn("Cannot find item '{}'!", itemName);
|
||||
return;
|
||||
}
|
||||
final int priority = tag.getInteger("priority");
|
||||
|
||||
RecipeCatalysts
|
||||
.addOrPut(RecipeCatalysts.catalystsAdderFromIMC, handlerID, new CatalystInfo(itemStack, priority));
|
||||
RecipeCatalysts.addOrPut(
|
||||
RecipeCatalysts.catalystsAdderFromIMC,
|
||||
catalystHandlerID,
|
||||
new CatalystInfo(itemStack, priority));
|
||||
NEIClientConfig.logger
|
||||
.info(String.format("Added catalyst `%s` to handler %s", itemStack.getDisplayName(), handlerID));
|
||||
.info("Added catalyst '{}' to catalyst handler {}", itemStack.getDisplayName(), catalystHandlerID);
|
||||
}
|
||||
|
||||
private static void handleRemoveCatalystInfo(IMCMessage message) {
|
||||
@@ -160,33 +184,46 @@ public class IMCHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
NEIClientConfig.logger.info("Processing removeCatalystInfo from " + message.getSender());
|
||||
NEIClientConfig.logger.info("Processing removeCatalystInfo IMC from {}", message.getSender());
|
||||
final NBTTagCompound tag = message.getNBTValue();
|
||||
final String handlerID = tag.getString("handlerID");
|
||||
if (handlerID.isEmpty()) {
|
||||
NEIClientConfig.logger.warn("Missing handlerID for registerCatalystInfo!");
|
||||
final String catalystHandlerID;
|
||||
if (tag.hasKey("handlerID")) {
|
||||
NEIClientConfig.logger.warn(
|
||||
"Received tag 'handlerID' for removeCatalystInfo IMC from {}, this is deprecated, please use 'catalystHandlerID' instead",
|
||||
message.getSender());
|
||||
catalystHandlerID = tag.getString("handlerID");
|
||||
} else {
|
||||
catalystHandlerID = tag.getString("catalystHandlerID");
|
||||
}
|
||||
if (catalystHandlerID.isEmpty()) {
|
||||
NEIClientConfig.logger.warn(
|
||||
"removeCatalystInfo IMC from {} is missing required tag 'catalystHandlerID'",
|
||||
message.getSender());
|
||||
return;
|
||||
}
|
||||
final String itemName = tag.getString("itemName");
|
||||
final String nbtInfo = tag.hasKey("nbtInfo") ? tag.getString("nbtInfo") : null;
|
||||
if (itemName.isEmpty()) {
|
||||
NEIClientConfig.logger.warn(String.format("Missing itemName for registerCatalystInfo in `%s`!", handlerID));
|
||||
NEIClientConfig.logger.warn(
|
||||
"removeCatalystInfo IMC for '{}' from {} is missing required tag 'itemName'",
|
||||
catalystHandlerID,
|
||||
message.getSender());
|
||||
return;
|
||||
}
|
||||
final ItemStack itemStack = NEIServerUtils.getModdedItem(itemName, nbtInfo);
|
||||
if (itemStack == null) {
|
||||
NEIClientConfig.logger.warn(String.format("Cannot find item `%s`!", itemName));
|
||||
NEIClientConfig.logger.warn("Cannot find item '{}'!", itemName);
|
||||
return;
|
||||
}
|
||||
|
||||
if (RecipeCatalysts.catalystsRemoverFromIMC.containsKey(handlerID)) {
|
||||
RecipeCatalysts.catalystsRemoverFromIMC.get(handlerID).add(itemStack);
|
||||
if (RecipeCatalysts.catalystsRemoverFromIMC.containsKey(catalystHandlerID)) {
|
||||
RecipeCatalysts.catalystsRemoverFromIMC.get(catalystHandlerID).add(itemStack);
|
||||
} else {
|
||||
RecipeCatalysts.catalystsRemoverFromIMC
|
||||
.put(handlerID, new ArrayList<>(Collections.singletonList(itemStack)));
|
||||
.put(catalystHandlerID, new ArrayList<>(Collections.singletonList(itemStack)));
|
||||
}
|
||||
NEIClientConfig.logger
|
||||
.info(String.format("Removed catalyst `%s` from handler %s", itemStack.getDisplayName(), handlerID));
|
||||
.info("Removed catalyst '{}' from catalyst handler {}", itemStack.getDisplayName(), catalystHandlerID);
|
||||
}
|
||||
|
||||
private static void logInvalidMessage(FMLInterModComms.IMCMessage message, String type) {
|
||||
|
||||
@@ -42,17 +42,17 @@ public class RecipeCatalysts {
|
||||
private static final List<String> forceClassNameList = new ArrayList<>();
|
||||
private static int heightCache;
|
||||
|
||||
public static void addRecipeCatalyst(String handlerID, CatalystInfo catalystInfo) {
|
||||
if (handlerID == null || handlerID.isEmpty() || catalystInfo.getStack() == null) return;
|
||||
addOrPut(catalystsAdderFromAPI, handlerID, catalystInfo);
|
||||
public static void addRecipeCatalyst(String catalystHandlerID, CatalystInfo catalystInfo) {
|
||||
if (catalystHandlerID == null || catalystHandlerID.isEmpty() || catalystInfo.getStack() == null) return;
|
||||
addOrPut(catalystsAdderFromAPI, catalystHandlerID, catalystInfo);
|
||||
}
|
||||
|
||||
public static void removeRecipeCatalyst(String handlerID, ItemStack stack) {
|
||||
if (handlerID == null || handlerID.isEmpty() || stack == null) return;
|
||||
if (catalystsRemoverFromAPI.containsKey(handlerID)) {
|
||||
catalystsRemoverFromAPI.get(handlerID).add(stack);
|
||||
public static void removeRecipeCatalyst(String catalystHandlerID, ItemStack stack) {
|
||||
if (catalystHandlerID == null || catalystHandlerID.isEmpty() || stack == null) return;
|
||||
if (catalystsRemoverFromAPI.containsKey(catalystHandlerID)) {
|
||||
catalystsRemoverFromAPI.get(catalystHandlerID).add(stack);
|
||||
} else {
|
||||
catalystsRemoverFromAPI.put(handlerID, new ArrayList<>(Collections.singletonList(stack)));
|
||||
catalystsRemoverFromAPI.put(catalystHandlerID, new ArrayList<>(Collections.singletonList(stack)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,20 +64,20 @@ public class RecipeCatalysts {
|
||||
return getRecipeCatalysts(getRecipeID(handler));
|
||||
}
|
||||
|
||||
public static List<PositionedStack> getRecipeCatalysts(String handlerID) {
|
||||
public static List<PositionedStack> getRecipeCatalysts(String catalystHandlerID) {
|
||||
if (!NEIClientConfig.areJEIStyleTabsVisible() || !NEIClientConfig.areJEIStyleRecipeCatalystsVisible()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return positionedRecipeCatalystMap.getOrDefault(handlerID, Collections.emptyList());
|
||||
return positionedRecipeCatalystMap.getOrDefault(catalystHandlerID, Collections.emptyList());
|
||||
}
|
||||
|
||||
public static boolean containsCatalyst(IRecipeHandler handler, ItemStack candidate) {
|
||||
return containsCatalyst(getRecipeID(handler), candidate);
|
||||
}
|
||||
|
||||
public static boolean containsCatalyst(String handlerID, ItemStack candidate) {
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
return recipeCatalystMap.get(handlerID).contains(candidate);
|
||||
public static boolean containsCatalyst(String catalystHandlerID, ItemStack candidate) {
|
||||
if (recipeCatalystMap.containsKey(catalystHandlerID)) {
|
||||
return recipeCatalystMap.get(catalystHandlerID).contains(candidate);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class RecipeCatalysts {
|
||||
|
||||
public static void loadCatalystInfo() {
|
||||
final boolean fromJar = NEIClientConfig.loadCatalystsFromJar();
|
||||
NEIClientConfig.logger.info("Loading catalyst info from " + (fromJar ? "JAR" : "Config"));
|
||||
NEIClientConfig.logger.info("Loading catalyst info from {}", (fromJar ? "JAR" : "Config"));
|
||||
recipeCatalystMap.clear();
|
||||
URL handlerUrl = RecipeCatalysts.class.getResource("/assets/nei/csv/catalysts.csv");
|
||||
|
||||
@@ -157,7 +157,7 @@ public class RecipeCatalysts {
|
||||
try {
|
||||
url = NEIClientConfig.catalystFile.toURI().toURL();
|
||||
} catch (MalformedURLException e) {
|
||||
NEIClientConfig.logger.warn("Invalid URL for catalysts csv (via config).");
|
||||
NEIClientConfig.logger.warn("Invalid URL for catalysts.csv (via config).");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public class RecipeCatalysts {
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()))) {
|
||||
CSVParser csvParser = CSVFormat.EXCEL.withFirstRecordAsHeader().parse(reader);
|
||||
for (CSVRecord record : csvParser) {
|
||||
final String handler = record.get("handler");
|
||||
final String catalystHandlerID = record.get("catalystHandlerID");
|
||||
final String modId = record.get("modId");
|
||||
final boolean requiresMod = Boolean.parseBoolean(record.get("modRequired"));
|
||||
final String excludedModId = record.get("excludedModId");
|
||||
@@ -191,41 +191,41 @@ public class RecipeCatalysts {
|
||||
String handlerID;
|
||||
try {
|
||||
// gently handling copy&paste from handlers.csv
|
||||
Class<?> clazz = Class.forName(handler);
|
||||
Class<?> clazz = Class.forName(catalystHandlerID);
|
||||
Object object = clazz.newInstance();
|
||||
if (object instanceof IRecipeHandler) {
|
||||
if (forceClassName) {
|
||||
forceClassNameList.add(handler);
|
||||
forceClassNameList.add(catalystHandlerID);
|
||||
}
|
||||
handlerID = getRecipeID((IRecipeHandler) object);
|
||||
} else {
|
||||
handlerID = handler;
|
||||
handlerID = catalystHandlerID;
|
||||
}
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
handlerID = handler;
|
||||
handlerID = catalystHandlerID;
|
||||
} catch (InstantiationException ignored) {
|
||||
NEIClientConfig.logger.warn("failed to create instance for " + handler);
|
||||
handlerID = handler;
|
||||
NEIClientConfig.logger.warn("failed to create instance for " + catalystHandlerID);
|
||||
handlerID = catalystHandlerID;
|
||||
}
|
||||
|
||||
addOrPut(recipeCatalystMap, handlerID, catalystInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.warn("Error parsing CSV");
|
||||
NEIClientConfig.logger.warn("Error parsing catalysts.csv");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
for (Map.Entry<String, CatalystInfoList> entry : catalystsAdderFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
String catalystHandlerID = entry.getKey();
|
||||
for (CatalystInfo catalyst : entry.getValue()) {
|
||||
addOrPut(recipeCatalystMap, handlerID, catalyst);
|
||||
addOrPut(recipeCatalystMap, catalystHandlerID, catalyst);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, CatalystInfoList> entry : catalystsAdderFromIMC.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
String catalystHandlerID = entry.getKey();
|
||||
for (CatalystInfo catalyst : entry.getValue()) {
|
||||
addOrPut(recipeCatalystMap, handlerID, catalyst);
|
||||
addOrPut(recipeCatalystMap, catalystHandlerID, catalyst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,27 +234,29 @@ public class RecipeCatalysts {
|
||||
Set<String> handlerIds = new HashSet<>(GuiRecipeTab.handlerMap.keySet());
|
||||
catalystsAdderFromIMC.keySet().forEach(handlerName -> {
|
||||
if (!handlerIds.contains(handlerName)) {
|
||||
NEIClientConfig.logger.warn("Could not find a registered handlerID that matches " + handlerName);
|
||||
NEIClientConfig.logger.warn(
|
||||
"Could not find a registered catalystHandlerID that matches '{}' as received via IMC",
|
||||
handlerName);
|
||||
handlerIds.forEach(handler -> {
|
||||
if (handler.equalsIgnoreCase(handlerName)) {
|
||||
NEIClientConfig.logger.warn(" -- Did you mean: " + handler);
|
||||
NEIClientConfig.logger.warn(" -- Did you mean: {}", handler);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
for (Map.Entry<String, List<ItemStack>> entry : catalystsRemoverFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
CatalystInfoList catalysts = recipeCatalystMap.get(handlerID);
|
||||
String catalystHandlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(catalystHandlerID)) {
|
||||
CatalystInfoList catalysts = recipeCatalystMap.get(catalystHandlerID);
|
||||
entry.getValue().forEach(catalysts::remove);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, List<ItemStack>> entry : catalystsRemoverFromIMC.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
CatalystInfoList catalysts = recipeCatalystMap.get(handlerID);
|
||||
String catalystHandlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(catalystHandlerID)) {
|
||||
CatalystInfoList catalysts = recipeCatalystMap.get(catalystHandlerID);
|
||||
entry.getValue().forEach(catalysts::remove);
|
||||
}
|
||||
}
|
||||
@@ -263,9 +265,8 @@ public class RecipeCatalysts {
|
||||
}
|
||||
|
||||
/**
|
||||
* Basically {@link NEIClientConfig#HANDLER_ID_FUNCTION}. Force using {@link IRecipeHandler#getHandlerId()} if
|
||||
* specified in catalysts.csv. In other words, refuse to share handlerID defined in
|
||||
* {@link TemplateRecipeHandler#getOverlayIdentifier()}.
|
||||
* Force using {@link IRecipeHandler#getHandlerId()} if specified in catalysts.csv. In other words, refuse to share
|
||||
* catalystHandlerID defined in {@link TemplateRecipeHandler#getOverlayIdentifier()}.
|
||||
*/
|
||||
public static String getRecipeID(IRecipeHandler handler) {
|
||||
if (forceClassNameList.stream().anyMatch(s -> s.equals(handler.getHandlerId()))) {
|
||||
@@ -274,11 +275,11 @@ public class RecipeCatalysts {
|
||||
return Objects.firstNonNull(handler.getOverlayIdentifier(), handler.getHandlerId());
|
||||
}
|
||||
|
||||
public static void addOrPut(Map<String, CatalystInfoList> map, String handlerID, CatalystInfo catalyst) {
|
||||
if (map.containsKey(handlerID)) {
|
||||
map.get(handlerID).add(catalyst);
|
||||
public static void addOrPut(Map<String, CatalystInfoList> map, String catalystHandlerID, CatalystInfo catalyst) {
|
||||
if (map.containsKey(catalystHandlerID)) {
|
||||
map.get(catalystHandlerID).add(catalyst);
|
||||
} else {
|
||||
map.put(handlerID, new CatalystInfoList(handlerID, catalyst));
|
||||
map.put(catalystHandlerID, new CatalystInfoList(catalystHandlerID, catalyst));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
handler,itemName,nbtInfo,modId,modRequired,excludedModId,priority,minVersion,maxVersion,forceClassName,itemNotes
|
||||
catalystHandlerID,itemName,nbtInfo,modId,modRequired,excludedModId,priority,minVersion,maxVersion,forceClassName,itemNotes
|
||||
crafting,minecraft:crafting_table,,minecraft,FALSE,terrafirmacraftplus,100,,,,
|
||||
smelting,minecraft:furnace,,minecraft,FALSE,terrafirmacraftplus,100,,,,
|
||||
codechicken.nei.recipe.BrewingRecipeHandler,minecraft:brewing_stand,,minecraft,FALSE,terrafirmacraftplus,100,,,,
|
||||
|
||||
|
Reference in new issue
Block a user