fixed manipulator interaction issue
This commit is contained in:
parent
2f43204498
commit
2fdb142ab7
3 changed files with 9 additions and 15 deletions
|
@ -40,7 +40,7 @@ public class InvInteractionHelper
|
|||
}
|
||||
|
||||
/** Throws the items from the manipulator into the world.
|
||||
*
|
||||
*
|
||||
* @param outputPosition
|
||||
* @param items */
|
||||
public void throwItem(Vector3 outputPosition, ItemStack items)
|
||||
|
@ -57,7 +57,7 @@ public class InvInteractionHelper
|
|||
}
|
||||
|
||||
/** Tries to place an itemStack in a specific position if it is an inventory.
|
||||
*
|
||||
*
|
||||
* @return The ItemStack remained after place attempt */
|
||||
public ItemStack tryPlaceInPosition(ItemStack itemStack, Vector3 position, ForgeDirection dir)
|
||||
{
|
||||
|
@ -194,7 +194,7 @@ public class InvInteractionHelper
|
|||
}
|
||||
|
||||
/** Tries to get an item from a position
|
||||
*
|
||||
*
|
||||
* @param position - location of item
|
||||
* @param direction - direction this item is from the original
|
||||
* @param ammount - amount up to one stack to grab
|
||||
|
@ -220,7 +220,7 @@ public class InvInteractionHelper
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (tileEntity instanceof TileEntityChest)
|
||||
else if (tileEntity.getClass() == TileEntityChest.class)
|
||||
{
|
||||
TileEntityChest[] chests = { (TileEntityChest) tileEntity, null };
|
||||
|
||||
|
@ -262,9 +262,7 @@ public class InvInteractionHelper
|
|||
else if (tileEntity instanceof ISidedInventory)
|
||||
{
|
||||
ISidedInventory inventory = (ISidedInventory) tileEntity;
|
||||
/*TODO something might be wrong with taking items out of machines */
|
||||
int[] slots = inventory.getAccessibleSlotsFromSide(direction.ordinal());
|
||||
|
||||
for (int i = 0; i < slots.length; i++)
|
||||
{
|
||||
int slot = slots[i];
|
||||
|
|
|
@ -18,7 +18,7 @@ import dark.core.interfaces.IExternalInv;
|
|||
import dark.core.network.PacketHandler;
|
||||
import dark.core.prefab.TileEntityInv;
|
||||
|
||||
public class TileEntityCrate extends TileEntityInv implements IPacketReceiver, IExternalInv
|
||||
public class TileEntityCrate extends TileEntityInv implements IPacketReceiver
|
||||
{
|
||||
/** Collective total stack of all inv slots */
|
||||
private ItemStack sampleStack;
|
||||
|
|
|
@ -126,17 +126,13 @@ public class TileEntityManipulator extends TileEntityFilterable implements IRota
|
|||
{
|
||||
this.isRedstonePowered = false;
|
||||
/** input location up */
|
||||
Vector3 inputUp = new Vector3(this);
|
||||
inputUp.modifyPositionFromSide(ForgeDirection.UP);
|
||||
Vector3 inputUp = new Vector3(this).modifyPositionFromSide(ForgeDirection.UP);
|
||||
/** input location down */
|
||||
Vector3 inputDown = new Vector3(this);
|
||||
inputDown.modifyPositionFromSide(ForgeDirection.DOWN);
|
||||
Vector3 inputDown = new Vector3(this).modifyPositionFromSide(ForgeDirection.DOWN);
|
||||
/** input location facing */
|
||||
Vector3 inputPosition = new Vector3(this);
|
||||
inputPosition.modifyPositionFromSide(this.getDirection().getOpposite());
|
||||
Vector3 inputPosition = new Vector3(this).modifyPositionFromSide(this.getDirection().getOpposite());
|
||||
/** output location facing */
|
||||
Vector3 outputPosition = new Vector3(this);
|
||||
outputPosition.modifyPositionFromSide(this.getDirection());
|
||||
Vector3 outputPosition = new Vector3(this).modifyPositionFromSide(this.getDirection());
|
||||
|
||||
ItemStack itemStack = invHelper().tryGrabFromPosition(inputUp, ForgeDirection.UP, 1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue