MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / getEmpty

Method getEmpty

src/main/java/gregapi/data/FL.java:1014–1025  ·  view source on GitHub ↗
(ItemStack aStack, boolean aCheckIFluidContainerItems)

Source from the content-addressed store, hash-verified

1012 }
1013
1014 public static ItemStack getEmpty(ItemStack aStack, boolean aCheckIFluidContainerItems) {
1015 if (ST.invalid(aStack)) return NI;
1016 FluidContainerData tData = FULL_TO_DATA.get(new ItemStackContainer(aStack));
1017 if (tData != null) return ST.amount(1, tData.emptyContainer);
1018 if (aCheckIFluidContainerItems && aStack.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)aStack.getItem()).getCapacity(aStack) > 0) {
1019 ((IFluidContainerItem)aStack.getItem()).drain(aStack = ST.amount(1, aStack), Integer.MAX_VALUE, T);
1020 if (aStack.getTagCompound() == null) return aStack;
1021 if (aStack.getTagCompound().hasNoTags()) aStack.setTagCompound(null);
1022 return aStack;
1023 }
1024 return NI;
1025 }
1026
1027
1028

Callers

nothing calls this directly

Calls 6

invalidMethod · 0.95
amountMethod · 0.95
getMethod · 0.65
getItemMethod · 0.65
drainMethod · 0.65
getCapacityMethod · 0.45

Tested by

no test coverage detected