Skip to content

Commit c1c3bd1

Browse files
authored
Remove overclock button (#2794)
1 parent 53ac12e commit c1c3bd1

File tree

2 files changed

+2
-52
lines changed

2 files changed

+2
-52
lines changed

src/main/java/gregtech/api/capability/impl/AbstractRecipeLogic.java

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -937,22 +937,6 @@ protected int getOverclockForTier(long voltage) {
937937
return GTUtility.getOCTierByVoltage(voltage);
938938
}
939939

940-
/**
941-
* Creates an array of Voltage Names that the machine/multiblock can overclock to.
942-
* Since this is for use with the customizable overclock button, all tiers up to
943-
* {@link AbstractRecipeLogic#getMaxVoltage()}
944-
* are allowed, since the button is initialized to this value.
945-
*
946-
* @return a String array of the voltage names allowed to be used for overclocking
947-
*/
948-
public String[] getAvailableOverclockingTiers() {
949-
final int maxTier = getOverclockForTier(getMaxVoltage());
950-
final String[] result = new String[maxTier + 1];
951-
result[0] = "gregtech.gui.overclock.off";
952-
if (maxTier >= 0) System.arraycopy(GTValues.VNF, 1, result, 1, maxTier);
953-
return result;
954-
}
955-
956940
/**
957941
* sets up the recipe to be run
958942
*
@@ -1131,9 +1115,8 @@ public boolean isAllowOverclocking() {
11311115
*/
11321116
public void setMaximumOverclockVoltage(final long overclockVoltage) {
11331117
this.overclockVoltage = overclockVoltage;
1134-
// Overclocking is not allowed if the passed voltage is ULV
1135-
this.allowOverclocking = (overclockVoltage != GTValues.V[GTValues.ULV]);
1136-
metaTileEntity.markDirty();
1118+
// Overclocking is not allowed if the passed voltage is <= LV
1119+
this.allowOverclocking = (overclockVoltage <= GTValues.V[GTValues.LV]);
11371120
}
11381121

11391122
/**
@@ -1143,32 +1126,6 @@ public long getMaximumOverclockVoltage() {
11431126
return overclockVoltage;
11441127
}
11451128

1146-
/**
1147-
* This is needed as CycleButtonWidget requires an IntSupplier, without making an Enum of tiers.
1148-
*
1149-
* @return The current Tier for the voltage the machine is allowed to overclock to
1150-
*/
1151-
public int getOverclockTier() {
1152-
// If we do not allow overclocking, return ULV tier
1153-
if (!isAllowOverclocking()) {
1154-
return GTValues.ULV;
1155-
}
1156-
1157-
// This will automatically handle ULV, and return 0
1158-
return getOverclockForTier(this.overclockVoltage);
1159-
}
1160-
1161-
/**
1162-
* Sets the maximum Tier that the machine/multiblock is allowed to overclock to.
1163-
* This is used for the Overclock button in Machine GUIs.
1164-
* This is needed as CycleButtonWidget requires an Int Supplier, without making an Enum of tiers.
1165-
*
1166-
* @param tier The maximum tier the multiblock/machine can overclock to
1167-
*/
1168-
public void setOverclockTier(final int tier) {
1169-
setMaximumOverclockVoltage(GTValues.V[tier]);
1170-
}
1171-
11721129
/**
11731130
* Used to reset cached values in the Recipe Logic on events such as multiblock structure deformation
11741131
*/

src/main/java/gregtech/api/metatileentity/SimpleMachineMetaTileEntity.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import gregtech.api.gui.GuiTextures;
1515
import gregtech.api.gui.ModularUI;
1616
import gregtech.api.gui.resources.TextureArea;
17-
import gregtech.api.gui.widgets.CycleButtonWidget;
1817
import gregtech.api.gui.widgets.GhostCircuitSlotWidget;
1918
import gregtech.api.gui.widgets.ImageWidget;
2019
import gregtech.api.gui.widgets.LabelWidget;
@@ -513,14 +512,8 @@ protected ModularUI.Builder createGuiTemplate(EntityPlayer player) {
513512
GuiTextures.BUTTON_FLUID_OUTPUT, this::isAutoOutputFluids, this::setAutoOutputFluids)
514513
.setTooltipText("gregtech.gui.fluid_auto_output.tooltip")
515514
.shouldUseBaseBackground());
516-
leftButtonStartX += 18;
517515
}
518516

519-
builder.widget(new CycleButtonWidget(leftButtonStartX, 62 + yOffset, 18, 18,
520-
workable.getAvailableOverclockingTiers(), workable::getOverclockTier, workable::setOverclockTier)
521-
.setTooltipHoverString("gregtech.gui.overclock.description")
522-
.setButtonTexture(GuiTextures.BUTTON_OVERCLOCK));
523-
524517
if (exportItems.getSlots() + exportFluids.getTanks() <= 9) {
525518
ImageWidget logo = new ImageWidget(152, 63 + yOffset, 17, 17,
526519
GTValues.XMAS.get() ? getXmasLogo() : getLogo()).setIgnoreColor(true);

0 commit comments

Comments
 (0)