Compare commits

..
Author SHA1 Message Date
Firenoo eba00218cd apply spotless
too lazy to rebase
2023-05-01 19:04:39 +02:00
Firenoo 1fd5b9da51 Add more tooltip help and cell handler for void cell 2023-05-01 19:04:39 +02:00
Firenoo 61ada60c92 Add handlers for deprecated item cells
Now the placeholder should work automatically in a drive.

The void cell is still a WIP.
2023-05-01 19:04:39 +02:00
Firenoo d8ae1c1e94 Fixed some storage cell conversion issues
The placeholders did not transfer NBT data properly
2023-05-01 19:04:39 +02:00
Firenoo 4d4fcab496 Finish basic item replacement code
- parts work
- items are remapped properly, and converted when they enter the player inventory
2023-05-01 19:04:38 +02:00
Firenoo a0454d0e6b API changes to make room for Extra Cells fluid placeholder 2023-05-01 19:04:38 +02:00
Firenoo 93d4a7745e set config "replaceEC2" to default true 2023-05-01 19:04:38 +02:00
Firenoo f972ba8f90 EC2 Deprecation: Part 3 - Parts
Parts are deprecated.
2023-05-01 19:04:38 +02:00
Firenoo 256a038ec7 EC2 deprecation: Part 2 - Blocks 2023-05-01 19:04:38 +02:00
Firenoo 72bd124684 EC2 deprecation: Part 1 - Items
Laying the groundwork for absorbing EC2 mappings.
2023-05-01 19:04:37 +02:00
firenoo e13beef9c4 Add null check for tanks (#118)
* Add null check for tanks

Some IFluidHandlers return null for getTankInfo(), so a null check is needed.

* spotless apply
2023-05-01 19:04:37 +02:00
Firenoo 09f729945f Fix fluid export bus voiding fluids on crafting only mode
The Fluid Export Bus was voiding fluids on craft only mode because it
tried to craft it, and decided to continue with the normal export logic:
Extract fluid from ME system and fill the tank.

Unfortunately, there was a condition that prevented the extracted fluid
from going anywhere depending on craft only mode, so it got voided.

Commit fixes this by skipping the normal extract logic if set to craft
only.

The amount must be simulated before extracting from the ME system. This
helps prevent a scenario where we cannot insert the fluid back (such as
when we have a fluid storage bus on Extract Only).

Signed-off-by: Firenoo <[email protected]>
2023-04-30 15:13:30 -07:00
2 changed files with 8 additions and 2 deletions

No files matched your search

@@ -132,12 +132,17 @@ public class PartFluidExportBus extends FCSharedFluidBus implements ICraftingReq
this.source);
continue;
}
// Extract from the ME system.
final IAEFluidStack real = inv.extractItems(fluid, Actionable.MODULATE, this.source);
// Find out how much to push
final IAEFluidStack toPush = fluid.copy();
final int amtToInsert = fh.fill(this.getSide().getOpposite(), toPush.getFluidStack(), false);
toPush.setStackSize(amtToInsert);
// Extract from the ME system. This might not be the same amount we actually send...
final IAEFluidStack real = inv.extractItems(toPush, Actionable.MODULATE, this.source);
if (real != null) {
int realInserted = fh.fill(this.getSide().getOpposite(), real.getFluidStack(), true);
if (realInserted < real.getStackSize()) {
// Could not use the entirety of the amount we extracted, so put it back.
// This can result in voiding fluids if there's nowhere for the fluids to go.
fluid.setStackSize(real.getStackSize() - realInserted);
inv.injectItems(fluid, Actionable.MODULATE, this.source);
}
@@ -32,6 +32,7 @@ public class FluidCellInventoryHandler extends MEInventoryHandler<IAEFluidStack>
final ItemStack is = config.getStackInSlot(x);
if (Util.getFluidFromItem(is) != null) {
priorityList.add(AEFluidStack.create(Util.getFluidFromItem(is)));
break;
}
}
if (!priorityList.isEmpty()) {