aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java11
-rw-r--r--src/main/resources/assets/miscutils/textures/gui/overlay_button/harvester_toggle.pngbin0 -> 732 bytes
3 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java
index f7cd6cab23..febd8aea62 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java
@@ -84,6 +84,8 @@ public class GTPP_UITextures {
public static final UITexture OVERLAY_BUTTON_HARVESTER_MODE = UITexture
.fullImage(GTPlusPlus.ID, "gui/overlay_button/harvester_mode");
+ public static final UITexture OVERLAY_BUTTON_HARVESTER_TOGGLE = UITexture
+ .fullImage(GTPlusPlus.ID, "gui/overlay_button/harvester_toggle");
public static final UITexture OVERLAY_BUTTON_FLUSH = UITexture.fullImage(GTPlusPlus.ID, "gui/overlay_button/flush");
public static final UITexture OVERLAY_BUTTON_FLUSH_BRONZE = UITexture
.fullImage(GTPlusPlus.ID, "gui/overlay_button/flush_bronze");
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
index a0ecde949c..1d8d3a42d3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java
@@ -53,6 +53,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
private static final int SLOT_OUTPUT_START = 7;
public boolean mModeAlternative = false;
+ public boolean mHarvestEnabled = true;
public GT_MetaTileEntity_CropHarvestor(final int aID, final int aTier, final String aDescription) {
super(
@@ -242,6 +243,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
if (aCrop == null) continue;
if (this.mModeAlternative) processSecondaryFunctions(tCrop);
+ if (!this.mHarvestEnabled) break;
if (aCrop.canBeHarvested(tCrop) && tCrop.getSize() == aCrop.getOptimalHavestSize(tCrop)) {
if (!getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsage(), true)) continue;
@@ -630,12 +632,16 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
public void saveNBTData(NBTTagCompound aNBT) {
super.saveNBTData(aNBT);
aNBT.setBoolean("mModeAlternative", this.mModeAlternative);
+ aNBT.setBoolean("mHarvestEnabled", this.mHarvestEnabled);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
super.loadNBTData(aNBT);
this.mModeAlternative = aNBT.getBoolean("mModeAlternative");
+ if (aNBT.hasKey("mHarvestEnabled")) {
+ this.mHarvestEnabled = aNBT.getBoolean("mHarvestEnabled");
+ }
}
@Override
@@ -652,6 +658,11 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank
.addTooltip(1, "Disable Hydration/Fertilizing/Weed-EX")
.setBackground(GT_UITextures.BUTTON_STANDARD).setPos(47, 63).setSize(18, 18));
builder.widget(
+ new CycleButtonWidget().setToggle(() -> mHarvestEnabled, val -> mHarvestEnabled = val)
+ .setTexture(GTPP_UITextures.OVERLAY_BUTTON_HARVESTER_TOGGLE).addTooltip(0, "Enable Harvest")
+ .addTooltip(1, "Disable Harvest").setBackground(GT_UITextures.BUTTON_STANDARD).setPos(67, 63)
+ .setSize(18, 18));
+ builder.widget(
SlotGroup
.ofItemHandler(inventoryHandler, 2).startFromSlot(
SLOT_WEEDEX_1)
diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/harvester_toggle.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/harvester_toggle.png
new file mode 100644
index 0000000000..d69ecd279d
--- /dev/null
+++ b/src/main/resources/assets/miscutils/textures/gui/overlay_button/harvester_toggle.png
Binary files differ