From b9621f24748740ab67ce67f4ed47c9bf0e6eda72 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Tue, 3 Sep 2024 10:13:40 +0200 Subject: [PATCH] Adapt MUI to the great renaming (#76) * adapt mui to the great renaming * update to renamed gt5u * use non pre gt version --- dependencies.gradle | 2 +- .../modularui/api/widget/FluidInteractionUtil.java | 14 +++++++------- .../gtnewhorizons/modularui/api/widget/Widget.java | 4 ++-- .../common/widget/FluidNameHolderWidget.java | 4 ++-- .../modularui/common/widget/FluidSlotWidget.java | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 5bc999f..bd833f6 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -7,7 +7,7 @@ dependencies { implementation("com.github.GTNewHorizons:GTNHLib:0.2.11:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.0:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.46.09:dev") { + compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.49.55:dev") { transitive = false exclude group:"com.github.GTNewHorizons", module:"ModularUI" } diff --git a/src/main/java/com/gtnewhorizons/modularui/api/widget/FluidInteractionUtil.java b/src/main/java/com/gtnewhorizons/modularui/api/widget/FluidInteractionUtil.java index f2392c8..bad6835 100644 --- a/src/main/java/com/gtnewhorizons/modularui/api/widget/FluidInteractionUtil.java +++ b/src/main/java/com/gtnewhorizons/modularui/api/widget/FluidInteractionUtil.java @@ -21,8 +21,8 @@ import codechicken.nei.guihook.GuiContainerManager; import codechicken.nei.recipe.StackInfo; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.GT_FluidDisplayItem; +import gregtech.api.util.GTUtility; +import gregtech.common.items.ItemFluidDisplay; /** * You can override these methods to have your own behavior for fluid manipulation with widgets. @@ -34,7 +34,7 @@ public interface FluidInteractionUtil { */ default FluidStack getFluidForRealItem(ItemStack itemStack) { if (isGT5ULoaded) { - return GT_Utility.getFluidForFilledItem(itemStack, true); + return GTUtility.getFluidForFilledItem(itemStack, true); } else { FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(itemStack); if (fluidStack == null && itemStack.getItem() instanceof IFluidContainerItem) { @@ -49,7 +49,7 @@ default FluidStack getFluidForRealItem(ItemStack itemStack) { */ default FluidStack getFluidForPhantomItem(ItemStack itemStack) { if (isGT5ULoaded) { - return GT_Utility.getFluidFromContainerOrFluidDisplay(itemStack); + return GTUtility.getFluidFromContainerOrFluidDisplay(itemStack); } else { return StackInfo.getFluid(itemStack); } @@ -65,7 +65,7 @@ default ItemStack fillFluidContainer(FluidStack fluidStack, ItemStack itemStack) default ItemStack fillFluidContainerWithoutIFluidContainerItem(FluidStack fluidStack, ItemStack itemStack) { if (isGT5ULoaded) { - return GT_Utility.fillFluidContainer(fluidStack, itemStack, true, false); + return GTUtility.fillFluidContainer(fluidStack, itemStack, true, false); } return null; } @@ -84,7 +84,7 @@ default ItemStack fillFluidContainerWithIFluidContainerItem(FluidStack fluidStac default ItemStack getContainerForFilledItemWithoutIFluidContainerItem(ItemStack itemStack) { if (isGT5ULoaded) { - return GT_Utility.getContainerForFilledItem(itemStack, false); + return GTUtility.getContainerForFilledItem(itemStack, false); } return null; } @@ -92,7 +92,7 @@ default ItemStack getContainerForFilledItemWithoutIFluidContainerItem(ItemStack default void addFluidNameInfo(List tooltip, @NotNull FluidStack fluid) { tooltip.add(new Text(fluid.getLocalizedName()).format(EnumChatFormatting.WHITE)); if (isGT5ULoaded) { - String formula = GT_FluidDisplayItem.getChemicalFormula(fluid); + String formula = ItemFluidDisplay.getChemicalFormula(fluid); if (!formula.isEmpty()) { tooltip.add(new Text(formula).format(EnumChatFormatting.YELLOW)); } diff --git a/src/main/java/com/gtnewhorizons/modularui/api/widget/Widget.java b/src/main/java/com/gtnewhorizons/modularui/api/widget/Widget.java index b034659..2701811 100644 --- a/src/main/java/com/gtnewhorizons/modularui/api/widget/Widget.java +++ b/src/main/java/com/gtnewhorizons/modularui/api/widget/Widget.java @@ -37,7 +37,7 @@ import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.util.GT_TooltipDataCache; +import gregtech.api.util.GTTooltipDataCache; /** * This class draws a functional element of ModularUI @@ -899,7 +899,7 @@ public Widget dynamicTooltipShift(Supplier> dynamicTooltipShift) { } @Optional.Method(modid = ModularUI.MODID_GT5U) - public Widget setGTTooltip(Supplier tooltipDataGetter) { + public Widget setGTTooltip(Supplier tooltipDataGetter) { dynamicTooltip(() -> tooltipDataGetter.get().text); dynamicTooltipShift(() -> tooltipDataGetter.get().shiftText); return this; diff --git a/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidNameHolderWidget.java b/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidNameHolderWidget.java index ddc9958..e5dabaf 100644 --- a/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidNameHolderWidget.java +++ b/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidNameHolderWidget.java @@ -26,7 +26,7 @@ import com.gtnewhorizons.modularui.api.widget.Interactable; import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; /** * Holds fluid name and displays corresponding fluid. Can be useful for setting filter or locking fluid. @@ -156,7 +156,7 @@ protected FluidStack createFluidStack() { @Override public ItemStack getStackUnderMouse() { if (isGT5ULoaded) { - return GT_Utility.getFluidDisplayStack(createFluidStack(), false); + return GTUtility.getFluidDisplayStack(createFluidStack(), false); } return null; } diff --git a/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidSlotWidget.java b/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidSlotWidget.java index 83f79ee..d4b8fba 100644 --- a/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidSlotWidget.java +++ b/src/main/java/com/gtnewhorizons/modularui/common/widget/FluidSlotWidget.java @@ -50,7 +50,7 @@ import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils; import com.gtnewhorizons.modularui.common.internal.wrapper.ModularGui; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.GTUtility; @SuppressWarnings("unused") public class FluidSlotWidget extends SyncedWidget @@ -643,7 +643,7 @@ public IDrawable getOverlayTexture() { @Override public ItemStack getStackUnderMouse() { if (isGT5ULoaded) { - return GT_Utility.getFluidDisplayStack(handler.getFluidStackInTank(tank), false); + return GTUtility.getFluidDisplayStack(handler.getFluidStackInTank(tank), false); } return null; }