Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lordIcocain committed Dec 14, 2024
1 parent 4560720 commit 837ad2f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ public abstract class MTEMultiBlockBase extends MetaTileEntity
protected VoidingMode voidingMode = getDefaultVoidingMode();
protected boolean batchMode = getDefaultBatchMode();
protected @Nonnull CheckRecipeResult checkRecipeResult = CheckRecipeResultRegistry.NONE;
protected boolean superCribsRecipeCheck = false;

protected static final String INPUT_SEPARATION_NBT_KEY = "inputSeparation";
protected static final String VOID_EXCESS_NBT_KEY = "voidExcess";
Expand Down Expand Up @@ -300,7 +299,6 @@ public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setBoolean(BATCH_MODE_NBT_KEY, batchMode);
aNBT.setBoolean(INPUT_SEPARATION_NBT_KEY, inputSeparation);
aNBT.setString(VOIDING_MODE_NBT_KEY, voidingMode.name);
aNBT.setBoolean(SUPER_CRIBS_MODE_NBT_KEY, superCribsRecipeCheck);
}

@Override
Expand Down Expand Up @@ -339,7 +337,6 @@ public void loadNBTData(NBTTagCompound aNBT) {
}
batchMode = aNBT.getBoolean(BATCH_MODE_NBT_KEY);
inputSeparation = aNBT.getBoolean(INPUT_SEPARATION_NBT_KEY);
superCribsRecipeCheck = aNBT.getBoolean(SUPER_CRIBS_MODE_NBT_KEY);
if (aNBT.hasKey(VOIDING_MODE_NBT_KEY, Constants.NBT.TAG_STRING)) {
voidingMode = VoidingMode.fromName(aNBT.getString(VOIDING_MODE_NBT_KEY));
} else if (aNBT.hasKey(VOID_EXCESS_NBT_KEY)) {
Expand Down Expand Up @@ -880,20 +877,6 @@ protected boolean supportsCraftingMEBuffer() {
return true;
}

// check if this machine working in same recipe map/maps
public boolean checkRecipeHash(RecipeMap<?> map, RecipeMap<?>[] maps, int hash) {
if (map != null && map.hashCode() == hash) {
return false;
} else if (maps != null) {
for (RecipeMap<?> tempMap : maps) {
if (tempMap.hashCode() == hash) {
return false;
}
}
}
return true;
}

/**
* Iterates over hatches and tries to find recipe. Assume {@link #processingLogic} is already set up for use.
* If return value is successful, inputs are consumed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
private final boolean supportFluids;
private boolean additionalConnection = false;
private boolean disablePatternOptimization = false;
public boolean superCribsRecipeCheck = false;

public MTEHatchCraftingInputME(int aID, String aName, String aNameRegional, boolean supportFluids) {
super(
Expand Down Expand Up @@ -563,7 +562,6 @@ public void saveNBTData(NBTTagCompound aNBT) {
if (customName != null) aNBT.setString("customName", customName);
aNBT.setBoolean("additionalConnection", additionalConnection);
aNBT.setBoolean("disablePatternOptimization", disablePatternOptimization);
aNBT.setBoolean("superCribsRecipeCheck", superCribsRecipeCheck);
getProxy().writeToNBT(aNBT);
}

Expand Down Expand Up @@ -613,7 +611,6 @@ public void loadNBTData(NBTTagCompound aNBT) {
if (aNBT.hasKey("customName")) customName = aNBT.getString("customName");
additionalConnection = aNBT.getBoolean("additionalConnection");
disablePatternOptimization = aNBT.getBoolean("disablePatternOptimization");
superCribsRecipeCheck = aNBT.getBoolean("superCribsRecipeCheck");

getProxy().readFromNBT(aNBT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;

import org.apache.commons.lang3.ArrayUtils;
import org.jetbrains.annotations.NotNull;

import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable;
Expand Down Expand Up @@ -394,16 +393,9 @@ protected CheckRecipeResult doCheckRecipe() {
// check crafting input hatches first
if (supportsCraftingMEBuffer()) {
for (IDualInputHatch dualInputHatch : mDualInputHatches) {
ItemStack[] sharedItems = dualInputHatch.getSharedItems();
for (var it = dualInputHatch.inventories(); it.hasNext();) {
IDualInputInventory slot = it.next();
ItemStack[] inputItems = slot.getItemInputs();
FluidStack[] inputFluids = slot.getFluidInputs();
if (inputItems.length == 0 && inputFluids.length == 0) continue;
inputItems = ArrayUtils.addAll(inputItems, sharedItems);
// Reverse order of input items for consistent behavior with standard input buses.
ArrayUtils.reverse(inputItems);
processingLogic.setInputItems(inputItems);
processingLogic.setInputItems(slot.getItemInputs());
processingLogic.setInputFluids(slot.getFluidInputs());
CheckRecipeResult foundResult = processingLogic.process();
if (foundResult.wasSuccessful()) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/assets/gregtech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,6 @@ GT5U.multiblock.speed=Speed
GT5U.multiblock.fluidPipeTier=Fluid Pipe Tier
GT5U.multiblock.itemPipeTier=Item Pipe Tier
GT5U.multiblock.coilLevel=Heating Coil Level
GT5U.multiblock.superCribs.true=SuperCribs recipe check mode is §aEnabled
GT5U.multiblock.superCribs.false=SuperCribs recipe check mode is §cDisabled

# NEI recipe handlers
GT5U.nei.heat_capacity=Heat Capacity: %s K (%s)
Expand Down

0 comments on commit 837ad2f

Please sign in to comment.