mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 13:30:04 +00:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
273c91b816 | ||
|
|
acfdd9087c | ||
|
|
54bdeabd99 | ||
|
|
df045ec1a8 | ||
|
|
4e1983b87f | ||
|
|
50c4015d54 | ||
|
|
b7b68515f1 | ||
|
|
3245de6ba1 | ||
|
|
3e2a0482e9 | ||
|
|
6b9e500655 | ||
|
|
709805b4c6 | ||
|
|
bfaec12011 | ||
|
|
7ad5b9d297 | ||
|
|
68c0abba95 | ||
|
|
682489de18 |
No files matched your search
@@ -131,19 +131,12 @@ public class BlockCertusQuartzTank extends BaseBlockContainer implements IRegist
|
||||
if (liquid != null) {
|
||||
int amountFilled = tank.fill(ForgeDirection.UNKNOWN, liquid, true);
|
||||
if (amountFilled != 0 && !entityplayer.capabilities.isCreativeMode && current.getItem() != null) {
|
||||
ItemStack empty;
|
||||
if (FluidContainerRegistry.isContainer(current)) {
|
||||
empty = FluidContainerRegistry.drainFluidContainer(current);
|
||||
} else {
|
||||
// Try this as a fallback.
|
||||
entityplayer.inventory.addItemStackToInventory(current.getItem().getContainerItem(current));
|
||||
empty = current.getItem().getContainerItem(current);
|
||||
}
|
||||
if (current.stackSize > 1) {
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem].stackSize -= 1;
|
||||
entityplayer.inventory.addItemStackToInventory(empty);
|
||||
entityplayer.inventory.addItemStackToInventory(current.getItem().getContainerItem(current));
|
||||
} else {
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = empty;
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = current.getItem()
|
||||
.getContainerItem(current);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -132,17 +132,12 @@ public class PartFluidExportBus extends FCSharedFluidBus implements ICraftingReq
|
||||
this.source);
|
||||
continue;
|
||||
}
|
||||
// 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);
|
||||
// Extract from the ME system.
|
||||
final IAEFluidStack real = inv.extractItems(fluid, 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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user