Fix fluid autocrafting (#221)

* Fix fluid autocrafting

Depends on https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial/pull/545

* update

* update

* rename

* Add FluidCraftingInventoryHandler so that fluid crafting isn't handled in Pass 2

* update deps

---------

Co-authored-by: hiroscho <[email protected]>
Co-authored-by: Dream Master <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-08-18 14:29:36 +02:00
1 parent e09525bc88
commit c6c5d162a1
3 files changed
+45 -12

No files matched your search

+10 -10
View File
@@ -34,28 +34,28 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.6.19-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-423-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.6.25-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-428:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.8.1:dev')
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.5:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.11.6:dev")
compileOnly("com.github.GTNewHorizons:GTNHLib:0.3.3:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:GTNHLib:0.4.3:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.7:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.17:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.48.123:dev') {
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.49.04:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.18-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.21-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.38:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.20-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.22-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.42:dev") { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.2:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.3.3:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.4.3:dev")
}
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.25'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.26'
}
@@ -264,9 +264,42 @@ public class TileFluidDiscretizer extends AENetworkTile implements IPriorityHost
}
}
private class FluidCraftingInventoryHandler extends MEInventoryHandler<IAEFluidStack> {
public FluidCraftingInventoryHandler(IMEInventory<IAEFluidStack> i, StorageChannel channel) {
super(i, channel);
}
@Override
public boolean isPrioritized(IAEFluidStack input) {
return true;
}
@Override
public boolean canAccept(IAEFluidStack input) {
ICraftingGrid craftingGrid;
try {
craftingGrid = getProxy().getGrid().getCache(ICraftingGrid.class);
} catch (GridAccessException e) {
return false;
}
if (craftingGrid instanceof CraftingGridCache craftingGridCache) {
return craftingGridCache.canAccept(ItemFluidDrop.newAeStack(input));
}
return false;
}
@Override
public boolean isAutoCraftingInventory() {
return true;
}
}
private class FluidCraftingInventory implements IMEInventory<IAEFluidStack> {
private final MEInventoryHandler<IAEFluidStack> invHandler = new MEInventoryHandler<>(this, getChannel());
private final MEInventoryHandler<IAEFluidStack> invHandler = new FluidCraftingInventoryHandler(
this,
getChannel());
FluidCraftingInventory() {
invHandler.setPriority(Integer.MAX_VALUE);