Skip to content

Commit

Permalink
Adapt MUI to the great renaming (#76)
Browse files Browse the repository at this point in the history
* adapt mui to the great renaming

* update to renamed gt5u

* use non pre gt version
  • Loading branch information
NotAPenguin0 authored Sep 3, 2024
1 parent d5be50b commit b9621f2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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) {
Expand All @@ -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);
}
Expand All @@ -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;
}
Expand All @@ -84,15 +84,15 @@ 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;
}

default void addFluidNameInfo(List<Text> 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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -899,7 +899,7 @@ public Widget dynamicTooltipShift(Supplier<List<String>> dynamicTooltipShift) {
}

@Optional.Method(modid = ModularUI.MODID_GT5U)
public Widget setGTTooltip(Supplier<GT_TooltipDataCache.TooltipData> tooltipDataGetter) {
public Widget setGTTooltip(Supplier<GTTooltipDataCache.TooltipData> tooltipDataGetter) {
dynamicTooltip(() -> tooltipDataGetter.get().text);
dynamicTooltipShift(() -> tooltipDataGetter.get().shiftText);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit b9621f2

Please sign in to comment.