Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f77332e
Update MUI2 and GTCEu version.
MagicSweepy Nov 14, 2025
2b9a840
Try to fix Wire Coil type failure.
MagicSweepy Nov 14, 2025
94c5516
Fix unused PropertyEnum in stone variant class.
MagicSweepy Nov 14, 2025
e6fd365
MUI2 theme -> colorType fixes.
MagicSweepy Nov 14, 2025
3488158
Deleted unused MUI2 widget.
MagicSweepy Nov 14, 2025
2f3fbef
Various MUI2 update problems fixes.
MagicSweepy Nov 14, 2025
040c989
Disabled MUI2 dependencies transitive to resolve JEI version conflicts.
MagicSweepy Nov 14, 2025
f5fb53d
Resolved type parameter problem caused by PropertyEnum -> PropertyInt…
MagicSweepy Nov 14, 2025
ac47b61
Let CTM dependency level be API.
MagicSweepy Nov 15, 2025
0f70d3b
Merge branch 'main' into ms/mod-update
MagicSweepy Nov 18, 2025
8ed5a82
Merge branch 'main' into ms/mod-update
MagicSweepy Nov 19, 2025
35077c1
Merge branch 'main' into ms/mod-update
MagicSweepy Nov 22, 2025
018a352
Merge branch 'main' into ms/mod-update
MagicSweepy Nov 23, 2025
c0e35dc
Update GTCEu version.
MagicSweepy Dec 9, 2025
f19d516
Merge branch 'main' into ms/mod-update
MagicSweepy Dec 24, 2025
366afad
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 5, 2026
213667f
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 5, 2026
d25afee
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 5, 2026
7f094bf
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 6, 2026
ad43cd1
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 7, 2026
93f04fb
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 9, 2026
9d376d4
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 9, 2026
17ae23c
Synced MUI2 related updating.
MagicSweepy Jan 9, 2026
0a7c239
Merge branch 'main' into ms/mod-update
MagicSweepy Jan 26, 2026
b4badaf
Merge branch 'main' into ms/mod-update
MagicSweepy Feb 17, 2026
98e7b34
Merge branch 'main' into ms/mod-update
MagicSweepy Mar 11, 2026
8bdf7c2
clean up unused api imports
MagicSweepy Mar 11, 2026
69b903a
expose mui2 location ui texture methods for addon mod
MagicSweepy Mar 11, 2026
571db14
expose internal mui texture area methods for addon mod
MagicSweepy Mar 11, 2026
62bc84e
clean up global imports
MagicSweepy Mar 11, 2026
2368675
try to update to the latest GTCEu version
MagicSweepy Mar 11, 2026
c352227
adhoc compatibility fixes for MUI2 3.0.6 with GTCEu
MagicSweepy Mar 11, 2026
1001944
slotGroup registration fixes
MagicSweepy Mar 11, 2026
7cbbc83
add missing compat annotation for mixins class
MagicSweepy Mar 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,15 @@ dependencies {
implementation(libs.forgelin) {
exclude("net.minecraftforge")
}
implementation(deobf(libs.modularui))

implementation(libs.modularui) {
isTransitive = false
}

api(libs.codeChickenLib)
api(libs.ctm)
implementation(deobf(files("libs/morphismlib-1.12.2-1.0.0.jar")))
implementation(deobf(files("libs/gregtech-1.12.2-master-#2851.jar")))
implementation(deobf(files("libs/gregtech-1.12.2-master-#2901.jar")))
implementation(deobf(libs.ae2ExtendedLife))
implementation(libs.jei)
implementation(libs.theOneProbe)
Expand All @@ -134,7 +139,6 @@ dependencies {

compileOnly(libs.craftTweaker2)

runtimeOnly(deobf(libs.ctm))
runtimeOnly(deobf(libs.catalogue))

compileOnlyApi(libs.jetbrainsAnnotations)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jetbrainsAnnotations = "24.1.0"
# Mods
forgelin = "2.1.0.0"
mixinBooter = "9.1"
modularui = "2.5.0-rc4"
modularui = "3.0.6"
codeChickenLib = "3.2.3.358"
groovyScript = "1.2.0-hotfix1"
craftTweaker2 = "1.12-4.1.20.700"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public final class LateMixinLoader implements ILateMixinLoader
@Override
public List<String> getMixinConfigs()
{
return MixinUtil.getMixinConfigs("gregtech", "jei");
return MixinUtil.getMixinConfigs("gregtech", "jei", "modularui");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package gregtechlite.gtlitecore.mixins.gregtech;

import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase;
import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory;
import gregtechlite.gtlitecore.mixins.Implemented;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Implemented(at = "https://github.com/GregTechCEu/GregTech/pull/2900")
@Mixin(value = MultiblockUIFactory.class, remap = false)
public interface AccessorMultiblockUIFactory
{

@Accessor("mte")
MultiblockWithDisplayBase mte();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package gregtechlite.gtlitecore.mixins.gregtech;

import com.cleanroommc.modularui.factory.PosGuiData;
import com.cleanroommc.modularui.screen.ModularPanel;
import com.cleanroommc.modularui.utils.Alignment;
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
import com.cleanroommc.modularui.widget.Widget;
import com.cleanroommc.modularui.widgets.SlotGroupWidget;
import com.cleanroommc.modularui.widgets.layout.Flow;
import gregtech.api.metatileentity.multiblock.MultiblockWithDisplayBase;
import gregtech.api.metatileentity.multiblock.ProgressBarMultiblock;
import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory;
import gregtech.api.metatileentity.multiblock.ui.MultiblockUIFactory.Bars;
import gregtech.api.mui.GTGuis;
import gregtechlite.gtlitecore.mixins.Compat;
import gregtechlite.gtlitecore.mixins.Implemented;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;

@Implemented(at = "https://github.com/GregTechCEu/GregTech/pull/2900")
@Compat(modId = { "gregtech", "modularui" })
@Mixin(value = MultiblockUIFactory.class, remap = false)
public abstract class MixinMultiblockUIFactory
{

@Shadow
private int width;

@Shadow
private int height;

@Shadow
private MultiblockUIFactory.ScreenFunction screenFunction;

@Shadow
private boolean disableDisplay;

@Shadow
private boolean disableButtons;

/**
* @author Magic_Sweepy
* @reason For Modular UI 3.0.6+ version, the name of a {@link ModularPanel} be final, so it cannot be rewritten by
* the legacy {@code debugName} method. We should make compatible with Retro Sophisticated Backpacks mod,
* but GTCEu only compatible with Modular UI 3.0.4, so we used mixin to fix this method call in GTCEu.
*/
@NotNull
@Overwrite
public ModularPanel buildUI(PosGuiData guiData, PanelSyncManager syncManager)
{
MultiblockWithDisplayBase mte = ((AccessorMultiblockUIFactory) this).mte();

ModularPanel panel = GTGuis.createPanel(mte, width, height)
.childIf(!disableDisplay, () -> createScreen(syncManager));

if (mte instanceof ProgressBarMultiblock && ((ProgressBarMultiblock) mte).hasBars())
{
ProgressBarMultiblock progressBarMTE = ((ProgressBarMultiblock) mte);
panel.height(height + (Bars.HEIGHT * gtlitecore$calculateRows(progressBarMTE.getProgressBarCount())) - 2);
panel.child(createBars(progressBarMTE, syncManager));
}

if (disableDisplay && screenFunction != null)
{
screenFunction.addWidgets(panel, syncManager);
}

SlotGroupWidget playerInv = SlotGroupWidget.playerInventory(false);
if (disableButtons)
{
playerInv.alignX(0.5f);
}
else
{
playerInv.left(4);
}

return panel.child(Flow.row()
.bottom(7)
.coverChildrenHeight()
.margin(4, 0)
.crossAxisAlignment(Alignment.CrossAxis.CENTER)
.child(playerInv)
.childIf(!disableButtons, () -> createButtons(panel, syncManager, guiData)));
}

@NotNull
@Shadow
protected abstract Flow createButtons(@NotNull ModularPanel mainPanel, @NotNull PanelSyncManager panelSyncManager, PosGuiData guiData);

@Nullable
@Shadow
protected abstract Flow createBars(@NotNull ProgressBarMultiblock progressMulti, @NotNull PanelSyncManager panelSyncManager);

@Shadow
protected abstract Widget<?> createScreen(PanelSyncManager syncManager);

@Unique
private static int gtlitecore$calculateRows(int count)
{
if (count <= 3)
{
return 1;
}

if (count <= 8)
{
return 2;
}

throw new UnsupportedOperationException("Cannot compute progress bar rows for count " + count);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package gregtechlite.gtlitecore.mixins.modularui;

import com.cleanroommc.modularui.value.sync.ISyncRegistrar;
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
import com.cleanroommc.modularui.value.sync.SyncHandler;
import com.cleanroommc.modularui.widgets.slot.SlotGroup;
import gregtechlite.gtlitecore.mixins.Compat;
import gregtechlite.gtlitecore.mixins.Implemented;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;

@Implemented(at = "https://github.com/GregTechCEu/GregTech/pull/2900")
@Compat(modId = { "gregtech", "modularui" })
@Mixin(value = PanelSyncManager.class, remap = false)
public abstract class MixinPanelSyncManager implements ISyncRegistrar<PanelSyncManager>
{

@Unique
public PanelSyncManager syncValue(String name, SyncHandler syncHandler)
{
return syncValue(name, 0, syncHandler);
}

@Unique
public PanelSyncManager registerSlotGroup(String name, int rowSize)
{
return registerSlotGroup(new SlotGroup(name, rowSize, 100, true));
}

@Shadow
public abstract PanelSyncManager registerSlotGroup(SlotGroup slotGroup);

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ fun VariantBlockFactory.makeCrucibleBlock() : VariantBlock<Crucible>
this.setDefaultState(getState(Crucible.BRONZE))
}

override fun computeVariants(): Collection<Crucible> = enumValues<Crucible>().toList()

override fun canCreatureSpawn(state: IBlockState,
world: IBlockAccess,
pos: BlockPos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ inline fun <reified T> VariantBlockFactory.makeMetalActiveBlock() : VariantActiv
this.setDefaultState(getState(VALUES[0]))
}

override fun computeVariants(): Collection<T> = enumValues<T>().toList()

override fun canCreatureSpawn(state: IBlockState,
world: IBlockAccess,
pos: BlockPos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ inline fun <reified T> VariantBlockFactory.makeMetalBlock() : VariantBlock<T> wh
this.setDefaultState(getState(VALUES[0]))
}

override fun computeVariants(): Collection<T> = enumValues<T>().toList()

override fun canCreatureSpawn(state: IBlockState,
world: IBlockAccess,
pos: BlockPos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ inline fun <reified T> VariantBlockFactory.makeMetalCutoutBlock() : VariantBlock
this.setDefaultState(getState(VALUES[0]))
}

override fun computeVariants(): Collection<T> = enumValues<T>().toList()

@Deprecated("Deprecated in Java")
override fun isOpaqueCube(state: IBlockState) = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ inline fun <reified T> VariantBlockFactory.makeTransparentBlock() : VariantBlock
this.useNeighborBrightness = true
}

override fun computeVariants(): Collection<T> = enumValues<T>().toList()

override fun canCreatureSpawn(state: IBlockState,
world: IBlockAccess,
pos: BlockPos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ fun VariantBlockFactory.makeWireCoilBlock() : VariantActiveBlock<WireCoil>
this.setDefaultState(getState(WireCoil.ADAMANTIUM))
}

override fun computeVariants(): Collection<WireCoil> = enumValues<WireCoil>().toList()

override fun canCreatureSpawn(state: IBlockState,
world: IBlockAccess,
pos: BlockPos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

package gregtechlite.gtlitecore.api.collection

import java.util.*
import com.google.gson.internal.LinkedTreeMap as MutableTreeMap
import java.util.TreeMap

// region Tree Map

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,39 @@ object GTLiteGuiTextures

// endregion

fun texture(path: String) = TextureArea(GTLiteMod.id(path), 0.0, 0.0, 1.0, 1.0)
/**
* Creates texture area with its [path].
*
* This method create internal Modular UI format [TextureArea] for legacy GTCEu API, if you want to create an ui
* texture for Modular UI 2 format, please use methods in [GTLiteMuiTextures] class.
*
* @param path The path in the mod specified namespace.
*
* @see GTLiteMuiTextures.texture
*/
@JvmStatic
fun texture(path: String): TextureArea = TextureArea(GTLiteMod.id(path), 0.0, 0.0, 1.0, 1.0)

/**
* Creates steam textures with its [path].
*
* This method create internal Modular UI format [TextureArea] for legacy GTCEu API, if you want to create an ui
* texture for Modular UI 2 format, please use methods in [GTLiteMuiTextures] class.
*
* @param path The path in the mod specified namespace.
*
* @see GTLiteMuiTextures.texture
* @see gregtech.api.mui.GTGuiTheme.BRONZE
* @see gregtech.api.mui.GTGuiTheme.STEEL
*/
@JvmStatic
fun steamTexture(path: String): SteamTexture = runCatching {
val constructor = SteamTexture::class.constructors
.first { it.parameters.size == 2 }
.also { it.isAccessible = true }

val bronzeTexture = TextureArea(GTLiteMod.id(String.format(path, "bronze")),
0.0, 0.0, 1.0, 1.0)

val steelTexture = TextureArea(GTLiteMod.id(String.format(path, "steel")),
0.0, 0.0, 1.0, 1.0)
val bronzeTexture = TextureArea(GTLiteMod.id(path.format("bronze")), 0.0, 0.0, 1.0, 1.0)
val steelTexture = TextureArea(GTLiteMod.id(path.format("steel")), 0.0, 0.0, 1.0, 1.0)

return@runCatching constructor.call(bronzeTexture, steelTexture)
}
Expand Down
Loading