mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-22 21:09:43 +00:00
3da14b3bbe
* Replace ore dictionary bus Extra Cells ore dict bus -> export bus w/ ore dict card (retains ore filter setting, not verified they are 1:1) * Add OpenComputer migration Moves migration to postInit, and migrates OC upgrades. * Remap wireless w/ correct encryption key + power Basically now works without needing to relink in security term * Update buildscript * spotless apply * spotlessApply (#125) Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
52 lines
2.1 KiB
Java
52 lines
2.1 KiB
Java
package com.glodblock.github.nei;
|
|
|
|
import java.util.HashSet;
|
|
import java.util.List;
|
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
import com.glodblock.github.FluidCraft;
|
|
import com.glodblock.github.client.gui.base.FCGuiEncodeTerminal;
|
|
import com.glodblock.github.nei.object.OrderStack;
|
|
import com.glodblock.github.nei.recipes.FluidRecipe;
|
|
import com.glodblock.github.network.CPacketTransferRecipe;
|
|
|
|
import codechicken.nei.api.IOverlayHandler;
|
|
import codechicken.nei.recipe.IRecipeHandler;
|
|
import codechicken.nei.recipe.TemplateRecipeHandler;
|
|
|
|
public class FluidPatternTerminalRecipeTransferHandler implements IOverlayHandler {
|
|
|
|
public static final FluidPatternTerminalRecipeTransferHandler INSTANCE = new FluidPatternTerminalRecipeTransferHandler();
|
|
public static final HashSet<String> notOtherSet = new HashSet<>();
|
|
public static final HashSet<String> craftSet = new HashSet<>();
|
|
|
|
static {
|
|
notOtherSet.add("smelting");
|
|
notOtherSet.add("brewing");
|
|
craftSet.add("crafting");
|
|
craftSet.add("crafting2x2");
|
|
}
|
|
|
|
@Override
|
|
public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift) {
|
|
if (firstGui instanceof FCGuiEncodeTerminal) {
|
|
boolean priority = ((FCGuiEncodeTerminal) firstGui).container.prioritize;
|
|
List<OrderStack<?>> in = FluidRecipe.getPackageInputs(recipe, recipeIndex, priority);
|
|
List<OrderStack<?>> out = FluidRecipe.getPackageOutputs(recipe, recipeIndex, !notUseOther(recipe));
|
|
boolean craft = shouldCraft(recipe);
|
|
FluidCraft.proxy.netHandler.sendToServer(new CPacketTransferRecipe(in, out, craft, shift));
|
|
}
|
|
}
|
|
|
|
private boolean notUseOther(IRecipeHandler recipeHandler) {
|
|
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipeHandler;
|
|
return notOtherSet.contains(tRecipe.getOverlayIdentifier());
|
|
}
|
|
|
|
private boolean shouldCraft(IRecipeHandler recipeHandler) {
|
|
TemplateRecipeHandler tRecipe = (TemplateRecipeHandler) recipeHandler;
|
|
return craftSet.contains(tRecipe.getOverlayIdentifier());
|
|
}
|
|
}
|