Skip to content

Commit e6a1605

Browse files
committed
fix for rc2
1 parent 5bbb1c4 commit e6a1605

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/main/java/gregtech/api/items/toolitem/IGTTool.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import cofh.api.item.IToolHammer;
6363
import com.cleanroommc.modularui.api.drawable.IKey;
6464
import com.cleanroommc.modularui.api.widget.IWidget;
65-
import com.cleanroommc.modularui.api.widget.Interactable;
6665
import com.cleanroommc.modularui.factory.HandGuiData;
6766
import com.cleanroommc.modularui.factory.ItemGuiFactory;
6867
import com.cleanroommc.modularui.screen.ModularPanel;
@@ -71,8 +70,7 @@
7170
import com.cleanroommc.modularui.value.sync.PanelSyncManager;
7271
import com.cleanroommc.modularui.widgets.ButtonWidget;
7372
import com.cleanroommc.modularui.widgets.TextWidget;
74-
import com.cleanroommc.modularui.widgets.layout.Column;
75-
import com.cleanroommc.modularui.widgets.layout.Row;
73+
import com.cleanroommc.modularui.widgets.layout.Flow;
7674
import com.enderio.core.common.interfaces.IOverlayRenderAware;
7775
import com.google.common.collect.HashMultimap;
7876
import com.google.common.collect.Multimap;
@@ -678,7 +676,7 @@ default List<IToolBehavior> getBehaviors(ItemStack stack) {
678676
if (!world.isRemote) {
679677
// TODO: relocate to keybind action when keybind PR happens
680678
if (player.isSneaking() && getMaxAoEDefinition(stack) != AoESymmetrical.none()) {
681-
ItemGuiFactory.open((EntityPlayerMP) player, hand);
679+
ItemGuiFactory.INSTANCE.open((EntityPlayerMP) player, hand);
682680
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
683681
}
684682
}
@@ -941,7 +939,7 @@ default ModularPanel buildUI(HandGuiData guiData, PanelSyncManager manager) {
941939
manager.syncValue("layer_value", layerValue);
942940

943941
return GTGuis.createPanel(usedStack.getTranslationKey(), 120, 80)
944-
.child(new Row()
942+
.child(Flow.row()
945943
.widthRel(1f)
946944
.margin(4, 0)
947945
.alignY(0.5f)
@@ -952,7 +950,7 @@ default ModularPanel buildUI(HandGuiData guiData, PanelSyncManager manager) {
952950
.child(createColumn(layerValue, "layers", false, defaultDefinition.layer)));
953951
}
954952

955-
default Column createColumn(IntSyncValue syncValue, String lang, boolean shouldDouble, int max) {
953+
default Flow createColumn(IntSyncValue syncValue, String lang, boolean shouldDouble, int max) {
956954
final var display = IKey.dynamic(
957955
() -> String.valueOf(1 + (shouldDouble ? 2 * syncValue.getIntValue() : syncValue.getIntValue())));
958956

@@ -964,7 +962,6 @@ default Column createColumn(IntSyncValue syncValue, String lang, boolean shouldD
964962
.onMousePressed(data -> {
965963
int val = syncValue.getIntValue();
966964
if (val < max) syncValue.setIntValue(++val);
967-
Interactable.playButtonClickSound();
968965
return true;
969966
});
970967

@@ -976,15 +973,14 @@ default Column createColumn(IntSyncValue syncValue, String lang, boolean shouldD
976973
.onMousePressed(data -> {
977974
int val = syncValue.getIntValue();
978975
if (val > 0) syncValue.setIntValue(--val);
979-
Interactable.playButtonClickSound();
980976
return true;
981977
});
982978

983-
return new Column()
979+
return Flow.column()
984980
.coverChildren()
985981
.child(new TextWidget(IKey.lang("item.gt.tool.aoe." + lang))
986982
.marginBottom(5))
987-
.child(new Row()
983+
.child(Flow.row()
988984
.coverChildren()
989985
.marginBottom(5)
990986
.child(increaseButton)

src/main/java/gregtech/common/items/tool/OpenGUIBehavior.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected OpenGUIBehavior() {}
2323
public @NotNull ActionResult<ItemStack> onItemRightClick(@NotNull World world, @NotNull EntityPlayer player,
2424
@NotNull EnumHand hand) {
2525
if (!world.isRemote) {
26-
ItemGuiFactory.open((EntityPlayerMP) player, hand);
26+
ItemGuiFactory.INSTANCE.open((EntityPlayerMP) player, hand);
2727
}
2828
return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand));
2929
}

0 commit comments

Comments
 (0)