Compare commits

..
Author SHA1 Message Date
lc-1337 f3c3a81681 Use bigger inventory (#395) 2026-01-17 09:35:58 +01:00
lc-1337 1ea9b2e410 Fix replenisher void (#394) 2026-01-16 18:34:26 +01:00
Kogepan229 cf189f00a3 Revert part of "remove transformers (#389)" (#393) 2026-01-16 17:13:56 +01:00
UltraProdigy a121342a4b Change Artificial Universe Fluid Cell to 63 Types (#392) 2026-01-16 13:41:36 +01:00
lc-1337 e62215f02b remove transformers (#389) 2026-01-15 08:06:47 +01:00
danyadevandgithub-actions[bot] f4c6d8a3f0 fix NPE when trying to drain a tank in a tank tower (#390)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-13 11:54:36 -05:00
4 changed files with 13 additions and 38 deletions

No files matched your search

@@ -70,6 +70,10 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
return mainTank.drain(fluid, amount, doDrain, false);
}
if (this.getFluid() == null) {
return null;
}
FluidStack drainedFluid = this.tank.drain(amount, doDrain);
int drained = drainedFluid != null ? drainedFluid.amount : 0;
@@ -80,10 +84,10 @@ public class TileCertusQuartzTank extends TileEntity implements IFluidHandler {
if (drained < amount) {
TileCertusQuartzTank tankBelow = this.getTankBelow();
if (tankBelow != null) {
FluidStack externallyDrained = tankBelow.drain(fluid, amount - drained, doDrain, false);
FluidStack externallyDrained = tankBelow.drain(this.getFluid(), amount - drained, doDrain, false);
if (externallyDrained != null) {
return new FluidStack(fluid, drained + externallyDrained.amount);
return new FluidStack(this.getFluid(), drained + externallyDrained.amount);
}
}
}
@@ -49,6 +49,7 @@ import appeng.tile.events.TileEventType;
import appeng.tile.grid.AENetworkInvTile;
import appeng.tile.inventory.AppEngInternalAEInventory;
import appeng.tile.inventory.AppEngInternalInventory;
import appeng.tile.inventory.BiggerAppEngInventory;
import appeng.tile.inventory.InvOperation;
import appeng.util.item.AEFluidStack;
import appeng.util.item.AEItemStack;
@@ -58,7 +59,7 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
implements IAEFluidInventory, IFluidHandler, IPowerChannelState, IGridTickable, ITerminalHost {
private final AppEngInternalInventory cell = new AppEngInternalInventory(this, 1);
private final AppEngInternalInventory invItems = new AppEngInternalInventory(this, 63);
private final BiggerAppEngInventory invItems = new BiggerAppEngInventory(this, 63);
private final AEFluidInventory invFluids = new AEFluidInventory(this, 9, Integer.MAX_VALUE);
private final AppEngInternalAEInventory configFluids = new AppEngInternalAEInventory(this, 9);
private final AppEngInternalAEInventory configItems = new AppEngInternalAEInventory(this, 63);
@@ -171,6 +172,8 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
if (tempStack != null) {
tempStack.stackSize = tempStack.stackSize + (int) notInserted.getStackSize();
storedItemCount += notInserted.getStackSize();
saveChanges();
} else invItems.setInventorySlotContents(index, notInserted.getItemStack());
}
} catch (final GridAccessException ignored) {}
@@ -188,6 +191,8 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
if (tempStack != null) {
tempStack.stackSize = tempStack.stackSize + (int) extracted.getStackSize();
storedItemCount += extracted.getStackSize();
saveChanges();
} else invItems.setInventorySlotContents(index, extracted.getItemStack());
}
} catch (final GridAccessException ignored) {}
@@ -295,8 +300,6 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
} catch (GridAccessException e) {
AELog.error(e, "Couldn't wake up level emitter for delayed updates");
}
markForUpdate();
}
public void fullRefund() {
@@ -365,7 +368,6 @@ public class TileSuperStockReplenisher extends AENetworkInvTile
@Override
public void onFluidInventoryChanged(IAEFluidTank inv, int slot) {
saveChanges();
markForUpdate();
}
@Override
@@ -31,9 +31,6 @@ public class NEITransformer extends FCClassTransformer.ClassMapper {
case "getStackUnderMouse" -> new TransformStackUnderMouse(
api,
super.visitMethod(access, name, desc, signature, exceptions));
case "shouldShowTooltip" -> new TransformShowTooltip(
api,
super.visitMethod(access, name, desc, signature, exceptions));
default -> super.visitMethod(access, name, desc, signature, exceptions);
};
}
@@ -62,32 +59,4 @@ public class NEITransformer extends FCClassTransformer.ClassMapper {
super.visitInsn(opcode);
}
}
private static class TransformShowTooltip extends MethodVisitor {
int const_1 = 0;
TransformShowTooltip(int api, MethodVisitor mv) {
super(api, mv);
}
@Override
public void visitInsn(int opcode) {
if (opcode == Opcodes.ICONST_1 && const_1 == 2) {
super.visitVarInsn(Opcodes.ALOAD, 1);
super.visitMethodInsn(
Opcodes.INVOKESTATIC,
"com/glodblock/github/coremod/hooker/CoreModHooks",
"shouldShowTooltip",
"(Lnet/minecraft/client/gui/inventory/GuiContainer;)Z",
false);
const_1++;
return;
}
if (opcode == Opcodes.ICONST_1) {
const_1++;
}
super.visitInsn(opcode);
}
}
}
@@ -137,7 +137,7 @@ public class ItemAndBlockHolder {
NameConst.ITEM_ARTIFICIAL_UNIVERSE_STORAGE,
Long.MAX_VALUE / 2048,
16384,
5,
63,
600000D).register();
public static ItemFluidVoidStorageCell FLUID_VOID_CELL = new ItemFluidVoidStorageCell().register();
public static ItemCreativeFluidStorageCell CREATIVE_CELL = new ItemCreativeFluidStorageCell().register();