mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-20 12:20:00 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
f1dea5460a
commit
f106b5e766
172 files changed
+2552
-2088
No files matched your search
@@ -1,17 +1,22 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
|
||||
|
||||
public static ArrayList<IUsageHandler> usagehandlers = new ArrayList<>();
|
||||
public static ArrayList<IUsageHandler> serialUsageHandlers = new ArrayList<>();
|
||||
|
||||
public static boolean openRecipeGui(String inputId, Object... ingredients) {
|
||||
RecipeHandlerQuery<IUsageHandler> recipeQuery = new RecipeHandlerQuery<>(
|
||||
h -> getUsageOrCatalystHandler(h, inputId, ingredients), usagehandlers, serialUsageHandlers);
|
||||
h -> getUsageOrCatalystHandler(h, inputId, ingredients),
|
||||
usagehandlers,
|
||||
serialUsageHandlers);
|
||||
ArrayList<IUsageHandler> handlers = recipeQuery.runWithProfiling("recipe.concurrent.usage");
|
||||
if (handlers.isEmpty()) return false;
|
||||
|
||||
@@ -35,14 +40,15 @@ public class GuiUsageRecipe extends GuiRecipe<IUsageHandler> {
|
||||
public static void registerUsageHandler(IUsageHandler handler) {
|
||||
final String handlerId = handler.getHandlerId();
|
||||
if (usagehandlers.stream().anyMatch(h -> h.getHandlerId().equals(handlerId))
|
||||
|| serialUsageHandlers.stream().anyMatch(h -> h.getHandlerId().equals(handlerId))) return;
|
||||
|| serialUsageHandlers.stream().anyMatch(h -> h.getHandlerId().equals(handlerId)))
|
||||
return;
|
||||
|
||||
if (NEIClientConfig.serialHandlers.contains(handlerId)) serialUsageHandlers.add(handler);
|
||||
else usagehandlers.add(handler);
|
||||
}
|
||||
|
||||
private static IUsageHandler getUsageOrCatalystHandler(
|
||||
IUsageHandler handler, String inputId, Object... ingredients) {
|
||||
private static IUsageHandler getUsageOrCatalystHandler(IUsageHandler handler, String inputId,
|
||||
Object... ingredients) {
|
||||
boolean skipCatalyst = NEIClientUtils.controlKey();
|
||||
if (NEIClientConfig.areJEIStyleRecipeCatalystsVisible() && !skipCatalyst) {
|
||||
return handler.getUsageAndCatalystHandler(inputId, ingredients);
|
||||
|
||||
Reference in new issue
Block a user