aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-11-26 01:45:28 +0900
committerGitHub <noreply@github.com>2022-11-25 17:45:28 +0100
commit9a2741128a78bb52eba50a631126e090a5a2abd8 (patch)
treea90f47aa94951acb4050e45dc3ed60698e79cf32 /src/main/java/gregtech/api/util
parent51537482fefc4f9c6d3fbd93d119c333a63dcd7b (diff)
downloadGT5-Unofficial-9a2741128a78bb52eba50a631126e090a5a2abd8.tar.gz
GT5-Unofficial-9a2741128a78bb52eba50a631126e090a5a2abd8.tar.bz2
GT5-Unofficial-9a2741128a78bb52eba50a631126e090a5a2abd8.zip
Rewrite GUIs with ModularUI (#1381)
* Base work for ModularUI compat * Remove useless interface * Add almost all the widgets * Invert method * Refactor NEI stack placement positions * NEI handlers on ModularUI * Add some more docs * AdvDebugStructureWriter * Fix NEI progressbar not working * PrimitiveBlastFurnace * clean * derp * clean * spotlessApply * Boilers * Buffers * clean * N by N slots containers * Fix boilers not having bucket interaction Put opening UI to individual MetaTEs * Maintenance Hatch * clean * spotlessApply * Add dependency * IndustrialApiary * Adapt to ModularUI change * Base work for covers & fix crash with MP * Fix crash with server * Rewrite base work for covers * Send initial cover data on cover GUI open so that the time of showing incorrect data will be eliminated * Covers part 1 * Rename package: ModularUI -> modularui * Rename class: GT_UIInfo -> GT_UIInfos * Fix build * Covers part2 * Fix missing client check with tile UI & fix title overlap * CoverTabLine * Move cover window creators to inner class * Fix crash with null base TE * Close GUI when tile is broken * Color cover window with tile colorization * Change signature of addUIWidgets * FluidFilter cover, FluidDisplaySlotWidget, BasicTank, BasicGenerator, Output Hatch, MicrowaveEnergyTransmitter, Teleporter, DigitalChest, DigitalTank * Add title tab * Move package: modularui -> modularui/widget * Programmed circuit + IConfigurationCircuitSupport * clean * VolumetricFlask * Remove integrated circuit overlay from recipe input slots * Input Hatch & Quadruple Input Hatch * Multiblock * Deprecate old cover GUI * BasicMachines * Finish BasicMachine & NEI * Expand DTPF NEI to 9 slots * Fix ME input bus on MP * Move AESlotWidget to public class * Move GT_Recipe_Map constructors with mNEIUnificateOutput to setter method * Move SteamTexture.Variant to outer enum * Switch to remote repository * oops * Update MUI * Update MUI * Minor refactor for change amount buttons * Display items and fluids that exceed usual count * blah * use +=, why didn't I do this * Update MUI * Move ModularUI to Base (#1510) * Move ModularUI to Base * Move most of the ModularUI functionality to `BaseTileEntity` (and `CoverableTileEntity`) * `CommonMetaTileEntity` delegates ato the MetaTileEntity * Added several interfaces (with defaults) to indicate if a tile/metatile override/implement certain behaviors. * Moved `IConfigurationCircuitSupport` interface such that it will work with BaseTileEntity or a MetaTileEntity * Address reviews Co-authored-by: miozune <miozune@gmail.com> * Update MUI * Minor changes to NEI * Return :facepalm: * IGetTabIconSet override * Some more changes to NEI * Merge texture getter interfaces to new class GUITextureSet * Remove BBF structure picture as it's auto-buildable now * Make unified title tab style of texture angular * Expose some boiler texture getters for addon * Fix crash with cover GUI on pipe * Lower the number of recipe per page for DTPF & update MUI * Update MUI * Fix crash with middle-clicking slot on circuit selection GUI * Fix circuit selection window not syncing item from base machine * Merge GT_NEI_AssLineHandler into GT_NEI_DefaultHandler * Update MUI * Add in TecTech multi message * Allow changing the way of binding player inventory * Update MUI * Update MUI * Update MUI * Update MUI * Update MUI * Make MUI non-transitive to allow addons to use their own version * Force enable mixin * Format fluid amount tooltip * Add GUITextureSet.STEAM * Add guard against null ModularWindow creation * Add constructors for Muffler Hatch with inventory * Fix output slot on digital chest and tank allowing insertion * Don't log null ModularWindow * Add default implementation for IHasWorldObjectAndCoords#openGUI * Make openGTTileEntityUI accept MultiTE & cleanup Co-authored-by: Jason Mitchell <mitchej@gmail.com>
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_CoverBehavior.java17
-rw-r--r--src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java156
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java3300
3 files changed, 2115 insertions, 1358 deletions
diff --git a/src/main/java/gregtech/api/util/GT_CoverBehavior.java b/src/main/java/gregtech/api/util/GT_CoverBehavior.java
index 3bbb4f9ae5..f3b8f7a9fb 100644
--- a/src/main/java/gregtech/api/util/GT_CoverBehavior.java
+++ b/src/main/java/gregtech/api/util/GT_CoverBehavior.java
@@ -3,6 +3,7 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
import gregtech.api.enums.GT_Values;
+import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.net.GT_Packet_TileEntityCoverGUI;
@@ -28,7 +29,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
super(ISerializableObject.LegacyCoverData.class, coverTexture);
}
- private static int convert(ISerializableObject.LegacyCoverData data) {
+ protected static int convert(ISerializableObject.LegacyCoverData data) {
return data == null ? 0 : data.get();
}
@@ -106,6 +107,7 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
return onCoverShiftRightclick(aSide, aCoverID, convert(aCoverVariable), aTileEntity, aPlayer);
}
+ @Deprecated
@Override
protected Object getClientGUIImpl(
byte aSide,
@@ -318,15 +320,20 @@ public abstract class GT_CoverBehavior extends GT_CoverBehaviorBase<ISerializabl
if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) {
lastPlayer = aPlayer;
mPlayerNotified = false;
- GT_Values.NW.sendToPlayer(
- new GT_Packet_TileEntityCoverGUI(
- aSide, aCoverID, aCoverVariable, aTileEntity, (EntityPlayerMP) aPlayer),
- (EntityPlayerMP) aPlayer);
+ if (useModularUI()) {
+ GT_UIInfos.openCoverUI(aTileEntity, aPlayer, aSide);
+ } else {
+ GT_Values.NW.sendToPlayer(
+ new GT_Packet_TileEntityCoverGUI(
+ aSide, aCoverID, aCoverVariable, aTileEntity, (EntityPlayerMP) aPlayer),
+ (EntityPlayerMP) aPlayer);
+ }
return true;
}
return false;
}
+ @Deprecated
public Object getClientGUI(byte aSide, int aCoverID, int coverData, ICoverable aTileEntity) {
return null;
}
diff --git a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
index 1092a24307..b793a9b489 100644
--- a/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
+++ b/src/main/java/gregtech/api/util/GT_CoverBehaviorBase.java
@@ -2,11 +2,22 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.E;
+import com.gtnewhorizons.modularui.api.ModularUITextures;
+import com.gtnewhorizons.modularui.api.drawable.ItemDrawable;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
+import com.gtnewhorizons.modularui.common.widget.TextWidget;
+import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
+import gregtech.api.gui.GT_GUIColorOverride;
+import gregtech.api.gui.modularui.GT_CoverUIBuildContext;
+import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.net.GT_Packet_TileEntityCoverGUI;
import gregtech.api.objects.GT_ItemStack;
+import java.util.function.Supplier;
+import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -34,6 +45,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
protected GT_CoverBehaviorBase(Class<T> typeToken, ITexture coverTexture) {
this.typeToken = typeToken;
this.coverFGTexture = coverTexture;
+ this.colorOverride = new GT_GUIColorOverride(guiTexturePath);
}
public abstract T createDataObject(int aLegacyData);
@@ -216,6 +228,7 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
return onCoverShiftRightClickImpl(aSide, aCoverID, forceCast(aCoverVariable), aTileEntity, aPlayer);
}
+ @Deprecated
public final Object getClientGUI(
byte aSide,
int aCoverID,
@@ -404,6 +417,136 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
}
// endregion
+ // region UI stuff
+
+ protected GT_TooltipDataCache mTooltipCache = new GT_TooltipDataCache();
+ protected GT_GUIColorOverride colorOverride;
+ private static final String guiTexturePath = "gregtech:textures/gui/GuiCover.png";
+
+ /**
+ * For back compatibility, you need to override this if this cover uses ModularUI.
+ */
+ public boolean useModularUI() {
+ return false;
+ }
+
+ public ModularWindow createWindow(GT_CoverUIBuildContext buildContext) {
+ return new UIFactory(buildContext).createWindow();
+ }
+
+ /**
+ * Creates {@link ModularWindow} for this cover.
+ * This is separated from base class, as attaching the same covers in different sides of the same tile
+ * needs different UI with different context.
+ */
+ protected class UIFactory {
+
+ private final GT_CoverUIBuildContext uiBuildContext;
+
+ public UIFactory(GT_CoverUIBuildContext buildContext) {
+ this.uiBuildContext = buildContext;
+ }
+
+ public ModularWindow createWindow() {
+ ModularWindow.Builder builder = ModularWindow.builder(getGUIWidth(), getGUIHeight());
+ builder.setBackground(ModularUITextures.VANILLA_BACKGROUND);
+ builder.setGuiTint(getUIBuildContext().getGuiColorization());
+ if (doesBindPlayerInventory() && !getUIBuildContext().isAnotherWindow()) {
+ builder.bindPlayerInventory(getUIBuildContext().getPlayer());
+ }
+ addTitleToUI(builder);
+ addUIWidgets(builder);
+ if (getUIBuildContext().isAnotherWindow()) {
+ builder.widget(ButtonWidget.closeWindowButton(true).setPos(getGUIWidth() - 15, 3));
+ }
+ return builder.build();
+ }
+
+ /**
+ * Override this to add widgets for your UI.
+ */
+ protected void addUIWidgets(ModularWindow.Builder builder) {}
+
+ public GT_CoverUIBuildContext getUIBuildContext() {
+ return uiBuildContext;
+ }
+
+ /**
+ * Can return null when cover data is invalid e.g. tile is broken or cover is removed
+ */
+ @Nullable
+ public T getCoverData() {
+ if (isCoverValid()) {
+ return forceCast(getUIBuildContext()
+ .getTile()
+ .getComplexCoverDataAtSide(getUIBuildContext().getCoverSide()));
+ } else {
+ return null;
+ }
+ }
+
+ public boolean setCoverData(T data) {
+ if (isCoverValid()) {
+ getUIBuildContext()
+ .getTile()
+ .receiveCoverData(
+ getUIBuildContext().getCoverSide(),
+ getUIBuildContext().getCoverID(),
+ data,
+ getUIBuildContext().getPlayer() instanceof EntityPlayerMP
+ ? (EntityPlayerMP) getUIBuildContext().getPlayer()
+ : null);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean isCoverValid() {
+ return !getUIBuildContext().getTile().isDead()
+ && getUIBuildContext()
+ .getTile()
+ .getCoverBehaviorAtSideNew(
+ getUIBuildContext().getCoverSide())
+ != GregTech_API.sNoBehavior;
+ }
+
+ protected void addTitleToUI(ModularWindow.Builder builder) {
+ ItemStack coverItem = GT_Utility.intToStack(getUIBuildContext().getCoverID());
+ if (coverItem != null) {
+ builder.widget(new ItemDrawable(coverItem)
+ .asWidget()
+ .setPos(5, 5)
+ .setSize(16, 16))
+ .widget(new TextWidget(coverItem.getDisplayName())
+ .setDefaultColor(COLOR_TITLE.get())
+ .setPos(25, 9));
+ }
+ }
+
+ protected int getGUIWidth() {
+ return 176;
+ }
+
+ protected int getGUIHeight() {
+ return 107;
+ }
+
+ protected boolean doesBindPlayerInventory() {
+ return false;
+ }
+
+ protected int getTextColorOrDefault(String textType, int defaultColor) {
+ return colorOverride.getTextColorOrDefault(textType, defaultColor);
+ }
+
+ protected Supplier<Integer> COLOR_TITLE = () -> getTextColorOrDefault("title", 0x222222);
+ protected Supplier<Integer> COLOR_TEXT_GRAY = () -> getTextColorOrDefault("text_gray", 0x555555);
+ protected Supplier<Integer> COLOR_TEXT_WARN = () -> getTextColorOrDefault("text_warn", 0xff0000);
+ }
+
+ // endregion
+
// region impl
protected Block getFacadeBlockImpl(byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity) {
@@ -494,15 +637,20 @@ public abstract class GT_CoverBehaviorBase<T extends ISerializableObject> {
byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer) {
if (hasCoverGUI() && aPlayer instanceof EntityPlayerMP) {
lastPlayer = aPlayer;
- GT_Values.NW.sendToPlayer(
- new GT_Packet_TileEntityCoverGUI(
- aSide, aCoverID, aCoverVariable, aTileEntity, (EntityPlayerMP) aPlayer),
- (EntityPlayerMP) aPlayer);
+ if (useModularUI()) {
+ GT_UIInfos.openCoverUI(aTileEntity, aPlayer, aSide);
+ } else {
+ GT_Values.NW.sendToPlayer(
+ new GT_Packet_TileEntityCoverGUI(
+ aSide, aCoverID, aCoverVariable, aTileEntity, (EntityPlayerMP) aPlayer),
+ (EntityPlayerMP) aPlayer);
+ }
return true;
}
return false;
}
+ @Deprecated
protected Object getClientGUIImpl(
byte aSide, int aCoverID, T aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, World aWorld) {
return null;
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index a498754451..40ba7fe60f 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -3,11 +3,26 @@ package gregtech.api.util;
import static gregtech.api.enums.GT_Values.*;
import codechicken.nei.PositionedStack;
+import com.gtnewhorizons.modularui.api.ModularUITextures;
+import com.gtnewhorizons.modularui.api.drawable.IDrawable;
+import com.gtnewhorizons.modularui.api.drawable.UITexture;
+import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable;
+import com.gtnewhorizons.modularui.api.math.Pos2d;
+import com.gtnewhorizons.modularui.api.math.Size;
+import com.gtnewhorizons.modularui.api.screen.ModularWindow;
+import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
+import com.gtnewhorizons.modularui.common.widget.ProgressBar;
+import com.gtnewhorizons.modularui.common.widget.SlotWidget;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
+import gnu.trove.map.TByteObjectMap;
+import gnu.trove.map.hash.TByteObjectHashMap;
import gregtech.GT_Mod;
import gregtech.api.GregTech_API;
import gregtech.api.enums.*;
+import gregtech.api.enums.SteamVariant;
+import gregtech.api.gui.modularui.GT_UITextures;
+import gregtech.api.gui.modularui.SteamTexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
import gregtech.api.objects.GT_FluidStack;
@@ -15,11 +30,15 @@ import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.ItemData;
import gregtech.api.objects.MaterialStack;
import gregtech.api.util.extensions.ArrayExt;
+import gregtech.common.gui.modularui.UIHelper;
import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Replicator;
-import gregtech.nei.GT_NEI_DefaultHandler.FixedPositionedStack;
import ic2.core.Ic2Items;
+import java.awt.*;
import java.util.*;
+import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
+import javax.annotation.Nullable;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
@@ -30,6 +49,8 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
@@ -721,7 +742,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Use {@link GT_Recipe_Map#getInputPositionedStacks(GT_Recipe)} instead
+ * Use {@link GT_Recipe_Map#getItemInputPositions} or {@link GT_Recipe_Map#getSpecialItemPosition} or {@link GT_Recipe_Map#getFluidInputPositions} instead
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
@@ -730,7 +751,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
/**
- * Use {@link GT_Recipe_Map#getOutputPositionedStacks(GT_Recipe)} instead
+ * Use {@link GT_Recipe_Map#getItemOutputPositions} or {@link GT_Recipe_Map#getFluidOutputPositions} instead
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
@@ -974,6 +995,7 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
}
}
+ @SuppressWarnings("StaticInitializerReferencesSubClass")
public static class GT_Recipe_Map {
/**
* Contains all Recipe Maps
@@ -985,117 +1007,139 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
public static final Map<String, GT_Recipe_Map> sIndexedMappings = new HashMap<>();
public static final GT_Recipe_Map sOreWasherRecipes = new GT_Recipe_Map(
- new HashSet<>(500),
- "gt.recipe.orewasher",
- "Ore Washing Plant",
- null,
- RES_PATH_GUI + "basicmachines/OreWasher",
- 1,
- 3,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(500),
+ "gt.recipe.orewasher",
+ "Ore Washing Plant",
+ null,
+ RES_PATH_GUI + "basicmachines/OreWasher",
+ 1,
+ 3,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_BATH, ProgressBar.Direction.CIRCULAR_CW);
public static final GT_Recipe_Map sThermalCentrifugeRecipes = new GT_Recipe_Map(
- new HashSet<>(1000),
- "gt.recipe.thermalcentrifuge",
- "Thermal Centrifuge",
- null,
- RES_PATH_GUI + "basicmachines/ThermalCentrifuge",
- 1,
- 3,
- 1,
- 0,
- 2,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(1000),
+ "gt.recipe.thermalcentrifuge",
+ "Thermal Centrifuge",
+ null,
+ RES_PATH_GUI + "basicmachines/ThermalCentrifuge",
+ 1,
+ 3,
+ 1,
+ 0,
+ 2,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sCompressorRecipes = new GT_Recipe_Map(
- new HashSet<>(750),
- "gt.recipe.compressor",
- "Compressor",
- null,
- RES_PATH_GUI + "basicmachines/Compressor",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(750),
+ "gt.recipe.compressor",
+ "Compressor",
+ null,
+ RES_PATH_GUI + "basicmachines/Compressor",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_COMPRESS, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_COMPRESSOR_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_COMPRESS_STEAM);
public static final GT_Recipe_Map sExtractorRecipes = new GT_Recipe_Map(
- new HashSet<>(250),
- "gt.recipe.extractor",
- "Extractor",
- null,
- RES_PATH_GUI + "basicmachines/Extractor",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(250),
+ "gt.recipe.extractor",
+ "Extractor",
+ null,
+ RES_PATH_GUI + "basicmachines/Extractor",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_EXTRACT, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_CENTRIFUGE_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_EXTRACT_STEAM);
public static final GT_Recipe_Map sRecyclerRecipes = new GT_Recipe_Map_Recycler(
- new HashSet<>(0),
- "ic.recipe.recycler",
- "Recycler",
- "ic2.recycler",
- RES_PATH_GUI + "basicmachines/Recycler",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- false);
+ new HashSet<>(0),
+ "ic.recipe.recycler",
+ "Recycler",
+ "ic2.recycler",
+ RES_PATH_GUI + "basicmachines/Recycler",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_RECYCLE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_RECYCLE, ProgressBar.Direction.CIRCULAR_CW);
public static final GT_Recipe_Map sFurnaceRecipes = new GT_Recipe_Map_Furnace(
- new HashSet<>(0),
- "mc.recipe.furnace",
- "Furnace",
- "smelting",
- RES_PATH_GUI + "basicmachines/E_Furnace",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- false);
+ new HashSet<>(0),
+ "mc.recipe.furnace",
+ "Furnace",
+ "smelting",
+ RES_PATH_GUI + "basicmachines/E_Furnace",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT)
+ .setSlotOverlaySteam(false, GT_UITextures.OVERLAY_SLOT_FURNACE_STEAM)
+ .setProgressBarSteam(GT_UITextures.PROGRESSBAR_ARROW_STEAM);
public static final GT_Recipe_Map sMicrowaveRecipes = new GT_Recipe_Map_Microwave(
- new HashSet<>(0),
- "gt.recipe.microwave",
- "Microwave",
- "smelting",
- RES_PATH_GUI + "basicmachines/E_Furnace",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- false);
+ new HashSet<>(0),
+ "gt.recipe.microwave",
+ "Microwave",
+ "smelting",
+ RES_PATH_GUI + "basicmachines/E_Furnace",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ false)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_FURNACE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
/** Set {@code aSpecialValue = -100} to bypass the disassembler tier check and default recipe duration. */
public static final GT_Recipe_Map sDisassemblerRecipes = new GT_Recipe_Map(
@@ -1113,590 +1157,712 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
1,
E,
true,
- false);
+ false) {
+ @Override
+ public IDrawable getOverlayForSlot(boolean isFluid, boolean isOutput, int index, boolean isSpecial) {
+ if (isOutput) {
+ switch (index) {
+ case 0:
+ case 2:
+ case 6:
+ case 8:
+ return GT_UITextures.OVERLAY_SLOT_CIRCUIT;
+ case 4:
+ return GT_UITextures.OVERLAY_SLOT_WRENCH;
+ }
+ }
+ return super.getOverlayForSlot(isFluid, isOutput, index, isSpecial);
+ }
+ }.setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_WRENCH)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ASSEMBLE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sScannerFakeRecipes = new GT_Recipe_Map(
- new HashSet<>(300),
- "gt.recipe.scanner",
- "Scanner",
- null,
- RES_PATH_GUI + "basicmachines/Scanner",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(300),
+ "gt.recipe.scanner",
+ "Scanner",
+ null,
+ RES_PATH_GUI + "basicmachines/Scanner",
+ 1,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_MICROSCOPE)
+ .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sRockBreakerFakeRecipes = new GT_Recipe_Map(
- new HashSet<>(200),
- "gt.recipe.rockbreaker",
- "Rock Breaker",
- null,
- RES_PATH_GUI + "basicmachines/RockBreaker",
- 1,
- 1,
- 0,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(200),
+ "gt.recipe.rockbreaker",
+ "Rock Breaker",
+ null,
+ RES_PATH_GUI + "basicmachines/RockBreaker",
+ 2,
+ 1,
+ 0,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_DUST)
+ .setSlotOverlay(false, true, GT_UITextures.OVERLAY_SLOT_CRUSHED_ORE)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_MACERATE, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sByProductList = new GT_Recipe_Map(
- new HashSet<>(1000),
- "gt.recipe.byproductlist",
- "Ore Byproduct List",
- null,
- RES_PATH_GUI + "basicmachines/Default",
- 1,
- 6,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(1000),
+ "gt.recipe.byproductlist",
+ "Ore Byproduct List",
+ null,
+ RES_PATH_GUI + "basicmachines/Default",
+ 1,
+ 6,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sReplicatorFakeRecipes = new ReplicatorFakeMap(
- new HashSet<>(100),
- "gt.recipe.replicator",
- "Replicator",
- null,
- RES_PATH_GUI + "basicmachines/Replicator",
- 0,
- 1,
- 0,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(100),
+ "gt.recipe.replicator",
+ "Replicator",
+ null,
+ RES_PATH_GUI + "basicmachines/Replicator",
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, GT_UITextures.OVERLAY_SLOT_CANISTER)
+ .setSlotOverlay(true, false, GT_UITextures.OVERLAY_SLOT_UUM)
+ .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
// public static final GT_Recipe_Map sAssemblylineFakeRecipes = new GT_Recipe_Map(new HashSet<>(30),
// "gt.recipe.scanner", "Scanner", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 1, 0, 1, E, 1, E, true,
// true);
- public static final GT_Recipe_Map sAssemblylineVisualRecipes = new GT_Recipe_Map(
- new HashSet<>(110),
- "gt.recipe.fakeAssemblylineProcess",
- "Assemblyline Process",
- null,
- RES_PATH_GUI + "FakeAssemblyline",
- 1,
- 1,
- 1,
- 0,
- 1,
- E,
- 1,
- E,
- true,
- false);
+ public static final GT_Recipe_Map sAssemblylineVisualRecipes = new GT_Recipe_Map_AssemblyLineFake(
+ new HashSet<>(110),
+ "gt.recipe.fakeAssemblylineProcess",
+ "Assemblyline Process",
+ null,
+ RES_PATH_GUI + "FakeAssemblyline",
+ 16,
+ 1,
+ 1,
+ 0,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setSlotOverlay(false, false, true, true, GT_UITextures.OVERLAY_SLOT_DATA_ORB)
+ .setUsualFluidInputCount(4);
public static final GT_Recipe_Map sPlasmaArcFurnaceRecipes = new GT_Recipe_Map(
- new HashSet<>(20000),
- "gt.recipe.plasmaarcfurnace",
- "Plasma Arc Furnace",
- null,
- RES_PATH_GUI + "basicmachines/PlasmaArcFurnace",
- 1,
- 4,
- 1,
- 1,
- 1,
- E,
- 1,
- E,
- true,
- true);
+ new HashSet<>(20000),
+ "gt.recipe.plasmaarcfurnace",
+ "Plasma Arc Furnace",
+ null,
+ RES_PATH_GUI + "basicmachines/PlasmaArcFurnace",
+ 1,
+ 4,
+ 1,
+ 1,
+ 1,
+ E,
+ 1,
+ E,
+ true,
+ true)
+ .setProgressBar(GT_UITextures.PROGRESSBAR_ARROW, ProgressBar.Direction.RIGHT);
public static final GT_Recipe_Map sArcFurnaceRecipes = new GT_Recipe_Map(
- new HashSet<>(20000),
- "gt.recipe.arcfurnace",
- "Arc Furnace",
- null,
- RES_PATH_GUI + "basicmachines/ArcFurnace",
- 1,
- 4,
- 1,
- 1,
- 3,
- E,
- 1,
- E,
- true,
-