Skip to content

Commit a6225ca

Browse files
committed
Fix accidental change of lang key for fluid/item voiding covers
1 parent 22d4377 commit a6225ca

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

src/main/java/gregtech/api/cover/CoverWithUI.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,14 @@ default ParentWidget<?> createSettingsRow() {
122122

123123
/**
124124
* Create a dynamic lang key that switches between {@code cover.generic.enabled} and {@code cover.generic.disabled}
125-
* depending on the result of the given boolean supplier.
125+
* depending on the result of the given boolean supplier. <br/>
126+
*
127+
* @param keyBase the base of the lang key to use. {@code .enabled} and {@code .disabled} will be appended.
126128
*/
127-
default IKey createEnabledKey(@NotNull BooleanSupplier enabledState) {
128-
return IKey.lang(() -> enabledState.getAsBoolean() ? "cover.generic.enabled" : "cover.generic.disabled");
129+
default IKey createEnabledKey(@NotNull String keyBase, @NotNull BooleanSupplier enabledState) {
130+
String enabled = keyBase + ".enabled";
131+
String disabled = keyBase + ".disabled";
132+
return IKey.lang(() -> enabledState.getAsBoolean() ? enabled : disabled);
129133
}
130134

131135
default int getIncrementValue(MouseData data) {

src/main/java/gregtech/common/covers/CoverFluidFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
166166
.coverChildrenHeight()
167167
.setEnabledIf(b -> getFilterMode() != FluidFilterMode.FILTER_BOTH)
168168
.child(new ToggleButton()
169-
.overlay(createEnabledKey(() -> this.allowFlow)
169+
.overlay(createEnabledKey("cover.generic", () -> this.allowFlow)
170170
.color(Color.WHITE.main)
171171
.shadow(false))
172172
.tooltip(tooltip -> tooltip

src/main/java/gregtech/common/covers/CoverFluidVoiding.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected ParentWidget<?> createUI(GuiData data, PanelSyncManager syncManager) {
8686
.marginBottom(2)
8787
.child(new ToggleButton()
8888
.value(isWorking)
89-
.overlay(createEnabledKey(() -> this.isWorkingAllowed)
89+
.overlay(createEnabledKey("behaviour.soft_hammer", () -> this.isWorkingAllowed)
9090
.color(Color.WHITE.darker(1)))
9191
.widthRel(0.6f)
9292
.left(0)));

src/main/java/gregtech/common/covers/CoverItemFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public ModularPanel buildUI(SidedPosGuiData guiData, PanelSyncManager guiSyncMan
168168
.coverChildrenHeight()
169169
.setEnabledIf(b -> getFilterMode() != ItemFilterMode.FILTER_BOTH)
170170
.child(new ToggleButton()
171-
.overlay(createEnabledKey(() -> this.allowFlow)
171+
.overlay(createEnabledKey("cover.generic", () -> this.allowFlow)
172172
.color(Color.WHITE.main)
173173
.shadow(false))
174174
.tooltip(tooltip -> tooltip

src/main/java/gregtech/common/covers/CoverItemVoiding.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected ParentWidget<Flow> createUI(GuiData data, PanelSyncManager guiSyncMana
8787
.marginBottom(2)
8888
.child(new ToggleButton()
8989
.value(isWorking)
90-
.overlay(createEnabledKey(() -> this.isWorkingAllowed)
90+
.overlay(createEnabledKey("behaviour.soft_hammer", () -> this.isWorkingAllowed)
9191
.color(Color.WHITE.darker(1)))
9292
.widthRel(0.6f)
9393
.left(0)));

0 commit comments

Comments
 (0)