Skip to content

Commit 88313fe

Browse files
szuendDream-Master
authored andcommitted
cleanup: Skip unnecessary NBT copying when checking for Item class (#46)
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. (cherry picked from commit 4960669)
1 parent 89abaad commit 88313fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/logisticspipes/logistics/LogisticsFluidManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public ItemIdentifierStack getFluidContainer(FluidStack stack) {
6565

6666
@Override
6767
public FluidStack getFluidFromContainer(ItemIdentifierStack stack) {
68-
if (stack.makeNormalStack().getItem() instanceof LogisticsFluidContainer && stack.getItem().tag != null) {
68+
if (stack.getItem().item instanceof LogisticsFluidContainer && stack.getItem().tag != null) {
6969
return FluidStack.loadFluidStackFromNBT(stack.getItem().tag);
7070
}
7171
return null;

0 commit comments

Comments
 (0)