Fixed crash when corporea funnels or interceptors have empty item frames. Closes #897

This commit is contained in:
Lizbeth Rika committed 2015-05-12 16:18:55 +01:00
1 parent 559d51c529
commit 1d377b8889
2 files changed
+9 -3

No files matched your search

@@ -70,9 +70,12 @@ public class TileCorporeaFunnel extends TileCorporeaBase {
for(EntityItemFrame frame : frames) {
int orientation = frame.hangingDirection;
if(orientationToDir[orientation] == dir.ordinal()) {
ItemStack copy = frame.getDisplayedItem().copy();
copy.stackSize = rotationToStackSize[frame.getRotation()];
filter.add(copy);
ItemStack stack = frame.getDisplayedItem();
if(stack != null) {
ItemStack copy = stack.copy();
copy.stackSize = rotationToStackSize[frame.getRotation()];
filter.add(copy);
}
}
}
}
@@ -65,6 +65,9 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
}
public boolean requestMatches(Object request, ItemStack filter) {
if(filter == null)
return false;
if(request instanceof ItemStack) {
ItemStack stack = (ItemStack) request;
return stack != null && stack.isItemEqual(filter) && ItemStack.areItemStacksEqual(filter, stack);