Rotating the items in the Item Frames around a Corporea Funnel now changes how many are pulled per request. (1, 16, 32 and 64 for each of the possible rotations)

This commit is contained in:
Lizbeth Rika committed 2015-05-01 00:40:24 +01:00
1 parent dec6a1b9da
commit 6c45975558
2 files changed
+10 -4

No files matched your search

@@ -43,7 +43,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase {
spark.onItemsRequested(stacks);
for(ItemStack reqStack : stacks)
if(stack != null) {
if(inv != null && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, stack, ForgeDirection.UP))
if(inv != null && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, reqStack, ForgeDirection.UP))
InventoryHelper.insertItemIntoInventory(inv, reqStack);
else {
EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, reqStack);
@@ -61,13 +61,19 @@ public class TileCorporeaFunnel extends TileCorporeaBase {
final int[] orientationToDir = new int[] {
3, 4, 2, 5
};
final int[] rotationToStackSize = new int[] {
1, 16, 32, 64
};
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
List<EntityItemFrame> frames = worldObj.getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, xCoord + dir.offsetX + 1, yCoord + dir.offsetY + 1, zCoord + dir.offsetZ + 1));
for(EntityItemFrame frame : frames) {
int orientation = frame.hangingDirection;
if(orientationToDir[orientation] == dir.ordinal())
filter.add(frame.getDisplayedItem());
if(orientationToDir[orientation] == dir.ordinal()) {
ItemStack copy = frame.getDisplayedItem().copy();
copy.stackSize = rotationToStackSize[frame.getRotation()];
filter.add(copy);
}
}
}