Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Disable ME stocking bus to fix an exploit.
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdielKavash committed Feb 23, 2024
1 parent 043751e commit 599d6dc
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import gregtech.api.util.GT_Utility;
import gregtech.api.util.VoidProtectionHelper;
import gregtech.common.items.GT_MetaGenerated_Tool_01;
import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_InputBus_ME;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.recipe.GTPPRecipeMaps;
import gtPlusPlus.core.block.ModBlocks;
Expand Down Expand Up @@ -135,6 +136,24 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
return checkPiece(mName, 1, 1, 0) && mCasing >= 8 && checkHatch();
}

@Override
public boolean checkHatch() {
// Tools from a stocking inout bus can not be damaged, this would cause an infinite durability exploit.
// Therefore disallow ME input bus.
if (!super.checkHatch()) return false;
for (GT_MetaTileEntity_Hatch_InputBus inputBus : mInputBusses) {
if (inputBus instanceof GT_MetaTileEntity_Hatch_InputBus_ME) {
return false;
}
}
return true;
}

@Override
public boolean supportsCraftingMEBuffer() {
return false;
}

@Override
public int getMaxParallelRecipes() {
return 1;
Expand Down

0 comments on commit 599d6dc

Please sign in to comment.