MCPcopy Create free account
hub / github.com/BuildCraft/BuildCraft / canMerge

Method canMerge

common/buildcraft/lib/misc/StackUtil.java:19–26  ·  view source on GitHub ↗

Checks to see if the two input stacks are equal in all but stack size. Note that this doesn't check anything todo with stack size, so if you pass in two stacks of 64 cobblestone this will return true. If you pass in null (at all) then this will only return true if both are null.

(ItemStack a, ItemStack b)

Source from the content-addressed store, hash-verified

17 * todo with stack size, so if you pass in two stacks of 64 cobblestone this will return true. If you pass in null
18 * (at all) then this will only return true if both are null. */
19 public static boolean canMerge(ItemStack a, ItemStack b) {
20 // Checks item, damage
21 if (!ItemStack.areItemsEqual(a, b)) {
22 return false;
23 }
24 // checks tags and caps
25 return ItemStack.areItemStackTagsEqual(a, b);
26 }
27
28 /** Attempts to get an item stack that might place down the given blockstate. Obviously this isn't perfect, and so
29 * cannot be relied on for anything more than simple blocks. */

Callers 15

extractMethod · 0.95
rebuildCacheMethod · 0.95
canInsertItemMethod · 0.95
isRoomForOutputMethod · 0.95
outputStackMethod · 0.95
canBeGroupedWithMethod · 0.95
canBeGroupedWithMethod · 0.95
slotClickPhantomMethod · 0.95
shiftItemStackMethod · 0.95
tryPutMethod · 0.95
addToSlotMethod · 0.95
useAndAddMethod · 0.95

Calls 1

areItemsEqualMethod · 0.80

Tested by

no test coverage detected