Skip to content

Commit 0672a79

Browse files
committed
fix primitive multis workable
fix diamond composition
1 parent c50fdb2 commit 0672a79

File tree

6 files changed

+7
-36
lines changed

6 files changed

+7
-36
lines changed

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

-19
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public abstract class AbstractRecipeLogic extends MTETrait implements IWorkable
3636

3737
public final RecipeMap<?> recipeMap;
3838

39-
protected boolean forceRecipeRecheck;
40-
@Deprecated protected ItemStack[] lastItemInputs;
41-
@Deprecated protected FluidStack[] lastFluidInputs;
4239
protected Recipe previousRecipe;
4340
protected boolean allowOverclocking = true;
4441
private long overclockVoltage = 0;
@@ -218,10 +215,6 @@ protected void trySearchNewRecipe() {
218215
metaTileEntity.getNotifiedFluidInputList().clear();
219216
}
220217

221-
public void forceRecipeRecheck() {
222-
this.forceRecipeRecheck = true;
223-
}
224-
225218
protected int getMinTankCapacity(IMultipleTankHandler tanks) {
226219
if (tanks.getTanks() == 0) {
227220
return 0;
@@ -237,18 +230,6 @@ protected Recipe findRecipe(long maxVoltage, IItemHandlerModifiable inputs, IMul
237230
return recipeMap.findRecipe(maxVoltage, inputs, fluidInputs, getMinTankCapacity(getOutputTank()), mode);
238231
}
239232

240-
/**
241-
* @deprecated Use {@link #hasNotifiedInputs() } instead
242-
* Left here for binary compatibility purposes
243-
*/
244-
@Deprecated
245-
protected boolean checkRecipeInputsDirty(IItemHandler inputs, IMultipleTankHandler fluidInputs) {
246-
boolean isDirty = this.hasNotifiedInputs();
247-
metaTileEntity.getNotifiedItemInputList().clear();
248-
metaTileEntity.getNotifiedFluidInputList().clear();
249-
return isDirty;
250-
}
251-
252233
protected static boolean areItemStacksEqual(ItemStack stackA, ItemStack stackB) {
253234
return (stackA.isEmpty() && stackB.isEmpty()) ||
254235
(ItemStack.areItemsEqual(stackA, stackB) &&

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

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ public void updateWorkable() {
2929
* Used to reset cached values in the Recipe Logic on structure deform
3030
*/
3131
public void invalidate() {
32-
lastItemInputs = null;
33-
lastFluidInputs = null;
3432
previousRecipe = null;
3533
progressTime = 0;
3634
maxProgressTime = 0;

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

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ protected int getOverclockingTier(long voltage) {
4747
* Used to reset cached values in the Recipe Logic on structure deform
4848
*/
4949
public void invalidate() {
50-
lastItemInputs = null;
51-
lastFluidInputs = null;
5250
previousRecipe = null;
5351
progressTime = 0;
5452
maxProgressTime = 0;

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

-6
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ protected boolean setupAndConsumeRecipeInputs(Recipe recipe) {
116116
} else return false;
117117
}
118118

119-
// Do this to casually ignore fluids from steam multiblocks
120-
@Override
121-
protected boolean checkRecipeInputsDirty(IItemHandler inputs, IMultipleTankHandler fluidInputs) {
122-
return super.checkRecipeInputsDirty(inputs, new FluidTankList(false));
123-
}
124-
125119
@Override
126120
protected void completeRecipe() {
127121
super.completeRecipe();

src/main/java/gregtech/api/metatileentity/multiblock/RecipeMapPrimitiveMultiblockController.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import gregtech.api.recipes.RecipeMap;
55
import net.minecraft.util.ResourceLocation;
66
import net.minecraftforge.fluids.FluidTank;
7-
import net.minecraftforge.items.ItemStackHandler;
87

98
import java.util.ArrayList;
109
import java.util.List;
@@ -21,19 +20,19 @@ public RecipeMapPrimitiveMultiblockController(ResourceLocation metaTileEntityId,
2120

2221
// just initialize inventories based on RecipeMap values by default
2322
protected void initializeAbilities() {
24-
this.importItems = new ItemStackHandler(recipeMapWorkable.recipeMap.getMaxInputs());
25-
this.importFluids = new FluidTankList(true, makeFluidTanks(recipeMapWorkable.recipeMap.getMaxFluidInputs()));
26-
this.exportItems = new ItemStackHandler(recipeMapWorkable.recipeMap.getMaxOutputs());
27-
this.exportFluids = new FluidTankList(false, makeFluidTanks(recipeMapWorkable.recipeMap.getMaxFluidOutputs()));
23+
this.importItems = new NotifiableItemStackHandler(recipeMapWorkable.recipeMap.getMaxInputs(), this, false);
24+
this.importFluids = new FluidTankList(true, makeFluidTanks(recipeMapWorkable.recipeMap.getMaxFluidInputs(), false));
25+
this.exportItems = new NotifiableItemStackHandler(recipeMapWorkable.recipeMap.getMaxOutputs(), this, true);
26+
this.exportFluids = new FluidTankList(false, makeFluidTanks(recipeMapWorkable.recipeMap.getMaxFluidOutputs(), true));
2827

2928
this.itemInventory = new ItemHandlerProxy(this.importItems, this.exportItems);
3029
this.fluidInventory = new FluidHandlerProxy(this.importFluids, this.exportFluids);
3130
}
3231

33-
private List<FluidTank> makeFluidTanks(int length) {
32+
private List<FluidTank> makeFluidTanks(int length, boolean isExport) {
3433
List<FluidTank> fluidTankList = new ArrayList<>(length);
3534
for (int i = 0; i < length; i++) {
36-
fluidTankList.add(new FluidTank(32000));
35+
fluidTankList.add(new NotifiableFluidTank(32000, this, isExport));
3736
}
3837
return fluidTankList;
3938
}

src/main/java/gregtech/api/unification/material/materials/FirstDegreeMaterials.java

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public static void register() {
200200
.color(0xC8FFFF).iconSet(DIAMOND)
201201
.flags(GENERATE_BOLT_SCREW, GENERATE_LENS, GENERATE_GEAR, NO_SMASHING, NO_SMELTING, FLAMMABLE,
202202
HIGH_SIFTER_OUTPUT, DISABLE_DECOMPOSITION, EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES)
203+
.components(Carbon, 1)
203204
.toolStats(8.0f, 3.0f, 1280, 15)
204205
.build();
205206

0 commit comments

Comments
 (0)