Fixed that pesky crash, thanks Vaygrim!
This commit is contained in:
parent
001ce431dc
commit
df896ec3f3
2 changed files with 20 additions and 7 deletions
|
@ -168,6 +168,12 @@ public class TransporterStack
|
||||||
if(!tileEntity.worldObj.isRemote)
|
if(!tileEntity.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
int index = pathToTarget.indexOf(Object3D.get(tileEntity))-1;
|
int index = pathToTarget.indexOf(Object3D.get(tileEntity))-1;
|
||||||
|
|
||||||
|
if(index < 0)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return pathToTarget.get(index);
|
return pathToTarget.get(index);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -200,7 +206,14 @@ public class TransporterStack
|
||||||
{
|
{
|
||||||
return Object3D.get(tileEntity).sideDifference(getPrev(tileEntity)).ordinal();
|
return Object3D.get(tileEntity).sideDifference(getPrev(tileEntity)).ordinal();
|
||||||
}
|
}
|
||||||
else if(progress >= 50)
|
else if(progress == 50)
|
||||||
|
{
|
||||||
|
if(getNext(tileEntity) != null)
|
||||||
|
{
|
||||||
|
return getNext(tileEntity).sideDifference(Object3D.get(tileEntity)).ordinal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(progress > 50)
|
||||||
{
|
{
|
||||||
return getNext(tileEntity).sideDifference(Object3D.get(tileEntity)).ordinal();
|
return getNext(tileEntity).sideDifference(Object3D.get(tileEntity)).ordinal();
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,13 +187,13 @@ public final class TransporterUtils
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ISidedInventory sidedInventory = (ISidedInventory) inventory;
|
ISidedInventory sidedInventory = (ISidedInventory) inventory;
|
||||||
int[] slots = sidedInventory.getAccessibleSlotsFromSide(side);
|
int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.getOrientation(side).getOpposite().ordinal());
|
||||||
|
|
||||||
for(int get = 0; get <= slots.length - 1; get++)
|
for(int get = 0; get <= slots.length - 1; get++)
|
||||||
{
|
{
|
||||||
int slotID = slots[get];
|
int slotID = slots[get];
|
||||||
|
|
||||||
if(sidedInventory.isItemValidForSlot(slotID, itemStack) && sidedInventory.canInsertItem(slotID, itemStack, side))
|
if(sidedInventory.isItemValidForSlot(slotID, itemStack) && sidedInventory.canInsertItem(slotID, itemStack, ForgeDirection.getOrientation(side).getOpposite().ordinal()))
|
||||||
{
|
{
|
||||||
ItemStack inSlot = inventory.getStackInSlot(slotID);
|
ItemStack inSlot = inventory.getStackInSlot(slotID);
|
||||||
|
|
||||||
|
@ -266,13 +266,13 @@ public final class TransporterUtils
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ISidedInventory sidedInventory = (ISidedInventory) inventory;
|
ISidedInventory sidedInventory = (ISidedInventory) inventory;
|
||||||
int[] slots = sidedInventory.getAccessibleSlotsFromSide(side);
|
int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.getOrientation(side).getOpposite().ordinal());
|
||||||
|
|
||||||
for(int get = 0; get <= slots.length - 1; get++)
|
for(int get = 0; get <= slots.length - 1; get++)
|
||||||
{
|
{
|
||||||
int slotID = slots[get];
|
int slotID = slots[get];
|
||||||
|
|
||||||
if(sidedInventory.isItemValidForSlot(slotID, itemStack) && sidedInventory.canInsertItem(slotID, itemStack, side))
|
if(sidedInventory.isItemValidForSlot(slotID, itemStack) && sidedInventory.canInsertItem(slotID, itemStack, ForgeDirection.getOrientation(side).getOpposite().ordinal()))
|
||||||
{
|
{
|
||||||
ItemStack inSlot = inventory.getStackInSlot(slotID);
|
ItemStack inSlot = inventory.getStackInSlot(slotID);
|
||||||
|
|
||||||
|
@ -328,7 +328,7 @@ public final class TransporterUtils
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ISidedInventory sidedInventory = (ISidedInventory)inventory;
|
ISidedInventory sidedInventory = (ISidedInventory)inventory;
|
||||||
int[] slots = sidedInventory.getAccessibleSlotsFromSide(side);
|
int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.getOrientation(side).getOpposite().ordinal());
|
||||||
|
|
||||||
if(slots != null)
|
if(slots != null)
|
||||||
{
|
{
|
||||||
|
@ -340,7 +340,7 @@ public final class TransporterUtils
|
||||||
{
|
{
|
||||||
ItemStack toSend = sidedInventory.getStackInSlot(slotID);
|
ItemStack toSend = sidedInventory.getStackInSlot(slotID);
|
||||||
|
|
||||||
if(sidedInventory.canExtractItem(slotID, toSend, side))
|
if(sidedInventory.canExtractItem(slotID, toSend, ForgeDirection.getOrientation(side).getOpposite().ordinal()))
|
||||||
{
|
{
|
||||||
sidedInventory.setInventorySlotContents(slotID, null);
|
sidedInventory.setInventorySlotContents(slotID, null);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue