Merge branch 'master' of https://github.com/aidancbrady/Mekanism
This commit is contained in:
commit
013a2a7aa4
3 changed files with 28 additions and 10 deletions
|
@ -42,12 +42,17 @@ public class GuiLogisticalSorter extends GuiMekanism
|
|||
|
||||
public int getScroll()
|
||||
{
|
||||
return Math.max(Math.min((int)(scroll*125), 125), 0);
|
||||
return Math.max(Math.min((int)(scroll*123), 123), 0);
|
||||
}
|
||||
|
||||
public int getFilterIndex()
|
||||
{
|
||||
return 0;
|
||||
if(tileEntity.filters.size() <= 4)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int)((tileEntity.filters.size()*scroll) - (4F/(float)tileEntity.filters.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -97,7 +102,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
|||
|
||||
if(isDragging)
|
||||
{
|
||||
scroll = (float)(yAxis-18-dragOffset)/123F;
|
||||
scroll = Math.min(Math.max((float)(yAxis-18-dragOffset)/123F, 0), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,12 @@ public class TransporterStack
|
|||
if(!tileEntity.worldObj.isRemote)
|
||||
{
|
||||
int index = pathToTarget.indexOf(Object3D.get(tileEntity))-1;
|
||||
|
||||
if(index < 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return pathToTarget.get(index);
|
||||
}
|
||||
else {
|
||||
|
@ -200,7 +206,14 @@ public class TransporterStack
|
|||
{
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -188,13 +188,13 @@ public final class TransporterUtils
|
|||
}
|
||||
else {
|
||||
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++)
|
||||
{
|
||||
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);
|
||||
|
||||
|
@ -267,13 +267,13 @@ public final class TransporterUtils
|
|||
}
|
||||
else {
|
||||
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++)
|
||||
{
|
||||
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);
|
||||
|
||||
|
@ -329,7 +329,7 @@ public final class TransporterUtils
|
|||
}
|
||||
else {
|
||||
ISidedInventory sidedInventory = (ISidedInventory)inventory;
|
||||
int[] slots = sidedInventory.getAccessibleSlotsFromSide(side);
|
||||
int[] slots = sidedInventory.getAccessibleSlotsFromSide(ForgeDirection.getOrientation(side).getOpposite().ordinal());
|
||||
|
||||
if(slots != null)
|
||||
{
|
||||
|
@ -341,7 +341,7 @@ public final class TransporterUtils
|
|||
{
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue