aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-11-26 01:56:28 +0900
committerGitHub <noreply@github.com>2022-11-25 17:56:28 +0100
commitcd2ba914a6b5b980ff56347455fcf43a9e3eea3b (patch)
tree9dfba22762592ee292edd9a6c2eb6e4c3d9c6e96 /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom
parent921527ce3cc5f92b067f180295fa55dae718461f (diff)
downloadGT5-Unofficial-cd2ba914a6b5b980ff56347455fcf43a9e3eea3b.tar.gz
GT5-Unofficial-cd2ba914a6b5b980ff56347455fcf43a9e3eea3b.tar.bz2
GT5-Unofficial-cd2ba914a6b5b980ff56347455fcf43a9e3eea3b.zip
Rewrite GUIs with ModularUI (#440)
* Update GT * NEI migration & cleanup Deprecate GTPP_Recipe_Map_Internal#sMappingsEx and delegate to GT_Recipe_Map#sMappings instead Remove recipe modification check * Boiler * Programmed Circuit & Super Bus * Lower the number of fluid slots for multi mixer NEI * Solar Generator * Crop Manager * Bronze Workbench & Advanced Workbench * Turbine Housing & Rotor Assembly * Iron Plated Blast Furnace * Player Safe * Advanced Muffler Hatch * spotlessApply * Auto Workbench * Breaker, Control Core, RTG Hatch, Steam Bus, some cleanup * Fix crash when removing Breaker * Data Orb Repository * Charging/Discharging Bus * Pollution Scrubber * Storage Crate, Shelf, TieredChest They're just broken in the first place, don't blame me * cleanup * Steam Condenser It's broken in the first place, never blame me! * Catalyst Housing, Ball Housing * Fluid Tank, generators, custom hatches, cleanup * Computer Cube MKII Many things are broken in the first place, I swear * Inventory Manager * Migrate multiblock dehydrator recipemap to ModularUI * Overflow cover * Redstone Circuit Block * Multiblock * cleanup * Update GT
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java14
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java24
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java13
3 files changed, 10 insertions, 41 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
index 332d911ac4..841359c0b2 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
@@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures.BlockIcons;
+import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Recipe;
@@ -80,12 +81,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
Logger.WARNING("Right Clicked");
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- } else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
+ GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
+ return true;
}
public ITexture[] getFront(byte aColor) {
@@ -330,4 +327,9 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
public int getTankPressure() {
return -100;
}
+
+ @Override
+ public boolean useModularUI() {
+ return true;
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
index f6cf2391b3..cb3f42b6f6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
@@ -5,8 +5,7 @@ import static gregtech.api.enums.GT_Values.V;
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_Container_BasicMachine;
-import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+import gregtech.api.gui.modularui.GT_UIInfos;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
@@ -19,7 +18,6 @@ import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.random.XSTR;
import java.util.Arrays;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@@ -446,29 +444,11 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- if (aBaseMetaTileEntity.isClientSide()) return true;
- aBaseMetaTileEntity.openGUI(aPlayer);
+ GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
return true;
}
@Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_Container_BasicMachine(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicMachine(
- aPlayerInventory,
- aBaseMetaTileEntity,
- getLocalName(),
- mGUIName,
- GT_Utility.isStringValid(mNEIName)
- ? mNEIName
- : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
- }
-
- @Override
public void initDefaultModes(NBTTagCompound aNBT) {
mMainFacing = -1;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
index bbc2206784..7e2cfaa94a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
@@ -4,9 +4,6 @@ import gregtech.api.enums.ItemList;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.xmod.gregtech.api.gui.power.CONTAINER_BasicTank;
-import gtPlusPlus.xmod.gregtech.api.gui.power.GUI_BasicTank;
-import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
@@ -130,16 +127,6 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
@Override
- public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new CONTAINER_BasicTank(aPlayerInventory, aBaseMetaTileEntity);
- }
-
- @Override
- public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GUI_BasicTank(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
- }
-
- @Override
public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide()) {
if (isFluidChangingAllowed() && getFillableStack() != null && getFillableStack().amount <= 0)