mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
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 <hiroscho.games@gmail.com> Co-authored-by: Dream Master <dream-master@gmx.net>
This commit is contained in:
3 files changed
+45
-12
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user