From 6eaa738c0b833345232b54e6453ec389e1ef46a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Z=C3=BCnd?= Date: Mon, 20 May 2024 14:15:06 +0200 Subject: [PATCH] cleanup: Skip unnecessary NBT copying when checking for Item class We can take the underlying `Item` from an `ItemIdentifierStack` directly without converting to an `ItemStack` first. The temporary `ItemStack` is heavy-weight for fluids since the fluid/amount is stored in an NBT that has to be copied. --- .../java/logisticspipes/logistics/LogisticsFluidManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/logisticspipes/logistics/LogisticsFluidManager.java b/src/main/java/logisticspipes/logistics/LogisticsFluidManager.java index 038ff3bf6..87503480c 100644 --- a/src/main/java/logisticspipes/logistics/LogisticsFluidManager.java +++ b/src/main/java/logisticspipes/logistics/LogisticsFluidManager.java @@ -65,7 +65,7 @@ public ItemIdentifierStack getFluidContainer(FluidStack stack) { @Override public FluidStack getFluidFromContainer(ItemIdentifierStack stack) { - if (stack.makeNormalStack().getItem() instanceof LogisticsFluidContainer && stack.getItem().tag != null) { + if (stack.getItem().item instanceof LogisticsFluidContainer && stack.getItem().tag != null) { return FluidStack.loadFluidStackFromNBT(stack.getItem().tag); } return null;