aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
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
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')
-rw-r--r--src/main/java/gregtech/api/enums/Dyes.java4
-rw-r--r--src/main/java/gregtech/api/enums/SteamVariant.java15
-rw-r--r--src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java2
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_1by1.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_2by2.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java97
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_3by3.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_4by4.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_BasicTank.java3
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_DigitalTank.java185
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java30
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java123
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIColorOverride.java6
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java2
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_2by2_Fluid.java32
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_BasicMachine.java3
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_DigitalTank.java111
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_MaintenanceHatch.java29
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java3
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIContainer_SpecialFilter.java18
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUICover.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIDialogSelectItem.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_GUIScreen.java1
-rw-r--r--src/main/java/gregtech/api/gui/GT_Slot_Holo_ME.java10
-rw-r--r--src/main/java/gregtech/api/gui/modularui/GT_CoverUIBuildContext.java70
-rw-r--r--src/main/java/gregtech/api/gui/modularui/GT_UIInfos.java204
-rw-r--r--src/main/java/gregtech/api/gui/modularui/GT_UITextures.java347
-rw-r--r--src/main/java/gregtech/api/gui/modularui/GUITextureSet.java150
-rw-r--r--src/main/java/gregtech/api/gui/modularui/IDataFollowerWidget.java48
-rw-r--r--src/main/java/gregtech/api/gui/modularui/SteamTexture.java74
-rw-r--r--src/main/java/gregtech/api/interfaces/IConfigurationCircuitSupport.java (renamed from src/main/java/gregtech/api/interfaces/metatileentity/IConfigurationCircuitSupport.java)4
-rw-r--r--src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntity.java64
-rw-r--r--src/main/java/gregtech/api/interfaces/modularui/IAddGregtechLogo.java7
-rw-r--r--src/main/java/gregtech/api/interfaces/modularui/IAddInventorySlots.java14
-rw-r--r--src/main/java/gregtech/api/interfaces/modularui/IAddUIWidgets.java8
-rw-r--r--src/main/java/gregtech/api/interfaces/modularui/IBindPlayerInventoryUI.java9
-rw-r--r--src/main/java/gregtech/api/interfaces/modularui/IGetGUITextureSet.java9
-rw-r--r--src/main/java/gregtech/api/interfaces/modularui/IGetTitleColor.java10
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IColoredTileEntity.java11
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IGregTechTileEntity.java6
-rw-r--r--src/main/java/gregtech/api/interfaces/tileentity/IHasWorldObjectAndCoords.java12
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java1
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseTileEntity.java412
-rw-r--r--src/main/java/gregtech/api/metatileentity/CommonMetaTileEntity.java128
-rw-r--r--src/main/java/gregtech/api/metatileentity/CoverableTileEntity.java151
-rw-r--r--src/main/java/gregtech/api/metatileentity/MetaPipeEntity.java14
-rw-r--r--src/main/java/gregtech/api/metatileentity/MetaTileEntity.java166
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBatteryBuffer.java65
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java323
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Bronze.java12
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_Steel.java15
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicTank.java92
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java95
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java56
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Input.java9
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBus.java67
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Maintenance.java75
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java18
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_MultiInput.java117
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Output.java85
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBus.java65
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java154
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SpecialFilter.java111
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_TieredMachineBlock.java38
-rw-r--r--src/main/java/gregtech/api/multitileentity/base/BaseMultiTileEntity.java10
-rw-r--r--src/main/java/gregtech/api/net/GT_Packet_GtTileEntityGuiRequest.java7
-rw-r--r--src/main/java/gregtech/api/net/GT_Packet_SetConfigurationCircuit.java25
-rw-r--r--src/main/java/gregtech/api/net/GT_Packet_TileEntityCoverGUI.java42
-rw-r--r--src/main/java/gregtech/api/objects/GT_Cover_None.java12
-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
78 files changed, 5213 insertions, 2366 deletions
diff --git a/src/main/java/gregtech/api/enums/Dyes.java b/src/main/java/gregtech/api/enums/Dyes.java
index 46207ee781..2a546e6138 100644
--- a/src/main/java/gregtech/api/enums/Dyes.java
+++ b/src/main/java/gregtech/api/enums/Dyes.java
@@ -125,4 +125,8 @@ public enum Dyes implements IColorModulationContainer {
public short[] getRGBA() {
return mRGBa;
}
+
+ public static Dyes getDyeFromIndex(short index) {
+ return index != -1 ? Dyes.get(index) : Dyes.MACHINE_METAL;
+ }
}
diff --git a/src/main/java/gregtech/api/enums/SteamVariant.java b/src/main/java/gregtech/api/enums/SteamVariant.java
new file mode 100644
index 0000000000..333f678900
--- /dev/null
+++ b/src/main/java/gregtech/api/enums/SteamVariant.java
@@ -0,0 +1,15 @@
+package gregtech.api.enums;
+
+import java.util.Locale;
+
+public enum SteamVariant {
+ BRONZE,
+ STEEL,
+ PRIMITIVE,
+ NONE;
+
+ @Override
+ public String toString() {
+ return super.toString().toLowerCase(Locale.ENGLISH);
+ }
+}
diff --git a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java
index f2774bbd38..588fb415c2 100644
--- a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java
+++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java
@@ -2,7 +2,7 @@ package gregtech.api.gui;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import gregtech.api.interfaces.metatileentity.IConfigurationCircuitSupport;
+import gregtech.api.interfaces.IConfigurationCircuitSupport;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
diff --git a/src/main/java/gregtech/api/gui/GT_Container_1by1.java b/src/main/java/gregtech/api/gui/GT_Container_1by1.java
index 3c65c5e590..882b4d0502 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_1by1.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_1by1.java
@@ -4,6 +4,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
+@Deprecated
public class GT_Container_1by1 extends GT_ContainerMetaTile_Machine {
public GT_Container_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
diff --git a/src/main/java/gregtech/api/gui/GT_Container_2by2.java b/src/main/java/gregtech/api/gui/GT_Container_2by2.java
index 92d50b3aae..4267423b75 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_2by2.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_2by2.java
@@ -4,6 +4,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
+@Deprecated
public class GT_Container_2by2 extends GT_ContainerMetaTile_Machine {
public GT_Container_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
diff --git a/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java b/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java
deleted file mode 100644
index d2d6249e5b..0000000000
--- a/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package gregtech.api.gui;
-
-import gregtech.api.interfaces.IFluidAccess;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_MultiInput;
-import gregtech.api.util.GT_Utility;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraftforge.fluids.FluidStack;
-
-public class GT_Container_2by2_Fluid extends GT_ContainerMetaTile_Machine {
-
- public GT_Container_2by2_Fluid(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- /**
- * Subclasses must ensure third slot (aSlotIndex==2) is drainable fluid display item slot.
- * Otherwise, subclasses must intercept the appropriate the slotClick event and call super.slotClick(2, xxx) if necessary
- */
- @Override
- public void addSlots(InventoryPlayer aInventoryPlayer) {
- addSlotToContainer(new GT_Slot_Render(mTileEntity, 0, 71, 26));
- addSlotToContainer(new GT_Slot_Render(mTileEntity, 1, 89, 26));
- addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 71, 44));
- addSlotToContainer(new GT_Slot_Render(mTileEntity, 3, 89, 44));
- }
-
- @Override
- public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex < 4 && aSlotIndex >= 0 && aMouseclick < 2) {
- GT_MetaTileEntity_Hatch_MultiInput tTank =
- (GT_MetaTileEntity_Hatch_MultiInput) mTileEntity.getMetaTileEntity();
- if (mTileEntity.isClientSide()) {
- /*
- * See comment in gregtech.api.gui.GT_Container_BasicTank.slotClick on why this is necessary
- */
- Slot slot = (Slot) inventorySlots.get(aSlotIndex);
- tTank.setFluid(GT_Utility.getFluidFromDisplayStack(slot.getStack()), aSlotIndex);
- }
- MultiFluidAccess tDrainableAccess = MultiFluidAccess.from(tTank, aSlotIndex);
- ItemStack tStackHeld = aPlayer.inventory.getItemStack();
- FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(tStackHeld, true);
- if (tDrainableAccess.isMatch(tFluidHeld, aSlotIndex))
- return handleFluidSlotClick(
- tDrainableAccess, aPlayer, aMouseclick == 0, true, !tTank.isDrainableStackSeparate());
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
-
- @Override
- public int getSlotCount() {
- return 0;
- }
-
- @Override
- public int getShiftClickSlotCount() {
- return 0;
- }
-
- static class MultiFluidAccess implements IFluidAccess {
- private final GT_MetaTileEntity_Hatch_MultiInput mTank;
- private final int mSlot;
-
- public MultiFluidAccess(GT_MetaTileEntity_Hatch_MultiInput aTank, int aSlot) {
- this.mTank = aTank;
- this.mSlot = aSlot;
- }
-
- public boolean isMatch(FluidStack stack, int slot) {
- if (!mTank.hasFluid(stack)) return true;
- if (stack == null) return true;
- return stack.equals(mTank.getFluid(slot));
- }
-
- @Override
- public void set(FluidStack stack) {
- mTank.setFluid(stack, mSlot);
- }
-
- @Override
- public FluidStack get() {
- return mTank.getFluid(mSlot);
- }
-
- @Override
- public int getCapacity() {
- return mTank.getCapacity();
- }
-
- static MultiFluidAccess from(GT_MetaTileEntity_Hatch_MultiInput aTank, int aSlot) {
- return new MultiFluidAccess(aTank, aSlot);
- }
- }
-}
diff --git a/src/main/java/gregtech/api/gui/GT_Container_3by3.java b/src/main/java/gregtech/api/gui/GT_Container_3by3.java
index 282d740347..80f3e213d6 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_3by3.java
+++ b/src/main/java/gregtech/api/gui/GT_Container_3by3.java
@@ -4,6 +4,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
+@Deprecated
public class GT_Container_3by3 extends GT_ContainerMetaTile_Machine {
public GT_Container_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
diff --git a/src/main/java/gregtech/api/gui/GT_Container_4by4.java b/src/main/java/gregtech/api/gui/GT_Container_4by4.java
index 0b38a265a6..6aa0717a11 100644
--- a/src/main/java/gregtech/api/gui/GT_Container_4by4.java
+++ b/