From b795417480b1b533bad6f0883f49c618f76192cd Mon Sep 17 00:00:00 2001 From: Zorbatron Date: Thu, 19 Sep 2024 13:36:41 -0400 Subject: [PATCH] pre rebase --- .../MetaTileEntityReservoirHatch.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityReservoirHatch.java b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityReservoirHatch.java index e8cf6d7b59b..df9d9aa7731 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityReservoirHatch.java +++ b/src/main/java/gregtech/common/metatileentities/multi/multiblockpart/MetaTileEntityReservoirHatch.java @@ -11,6 +11,8 @@ import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart; import gregtech.api.metatileentity.multiblock.MultiblockAbility; +import gregtech.api.mui.GTGuiTextures; +import gregtech.api.mui.GTGuis; import gregtech.client.renderer.texture.Textures; import net.minecraft.client.resources.I18n; @@ -35,6 +37,11 @@ import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Matrix4; +import com.cleanroommc.modularui.api.drawable.IKey; +import com.cleanroommc.modularui.factory.PosGuiData; +import com.cleanroommc.modularui.screen.ModularPanel; +import com.cleanroommc.modularui.value.sync.PanelSyncManager; +import com.cleanroommc.modularui.widgets.SlotGroupWidget; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -116,6 +123,28 @@ public void registerAbilities(List abilityList) { abilityList.add(fluidTank); } + @Override + public boolean usesMui2() { + return true; + } + + @Override + public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager guiSyncManager) { + guiSyncManager.registerSlotGroup("item_inv", 2); + + // TODO: Change the position of the name when it's standardized. + return GTGuis.createPanel(this, 176, 166) + .child(IKey.lang(getMetaFullName()).asWidget().pos(5, 5)) + .child(IKey.lang("gregtech.gui.fluid_amount").color(0xFFFFFF).asWidget().pos(11, 20)) + .child(SlotGroupWidget.playerInventory().left(7).bottom(7)) + .child(GTGuiTextures.DISPLAY.asWidget() + .left(7).top(16) + .size(81, 55)) + .child(GTGuiTextures.TANK_ICON.asWidget() + .left(91).top(36) + .size(14, 15)); + } + @Override protected ModularUI createUI(EntityPlayer entityPlayer) { return createTankUI(fluidTank, getMetaFullName(), entityPlayer).build(getHolder(), entityPlayer);