Better client energy scales in universal cables, made Logistical Transporter pull mode take one item at a time to give L. Sorter an advantage
This commit is contained in:
parent
aca4b461b7
commit
e36e62b6be
5 changed files with 9 additions and 14 deletions
|
@ -394,12 +394,11 @@ public class EnergyNetwork extends DynamicNetwork<TileEntity, EnergyNetwork>
|
|||
{
|
||||
needsUpdate = true;
|
||||
}
|
||||
|
||||
lastPowerScale = currentPowerScale;
|
||||
|
||||
if(needsUpdate)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTransferEvent(this, currentPowerScale));
|
||||
lastPowerScale = currentPowerScale;
|
||||
needsUpdate = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import mekanism.common.PacketHandler.Transmission;
|
|||
import mekanism.common.network.PacketDataRequest;
|
||||
import mekanism.common.network.PacketTileEntity;
|
||||
import mekanism.common.tileentity.TileEntityLogisticalSorter;
|
||||
import mekanism.common.transporter.Finder.FreeFinder;
|
||||
import mekanism.common.transporter.Finder.FirstFinder;
|
||||
import mekanism.common.transporter.InvStack;
|
||||
import mekanism.common.transporter.TransporterManager;
|
||||
import mekanism.common.transporter.TransporterStack;
|
||||
|
@ -368,7 +368,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
|
|||
if(tile instanceof IInventory)
|
||||
{
|
||||
IInventory inv = (IInventory)tile;
|
||||
InvStack stack = InventoryUtils.takeTopStack(inv, side.ordinal(), new FreeFinder());
|
||||
InvStack stack = InventoryUtils.takeTopItem(inv, side.ordinal());
|
||||
|
||||
if(stack != null && stack.getStack() != null)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ import mekanism.common.PacketHandler;
|
|||
import mekanism.common.PacketHandler.Transmission;
|
||||
import mekanism.common.block.BlockMachine.MachineType;
|
||||
import mekanism.common.network.PacketTileEntity;
|
||||
import mekanism.common.transporter.Finder.FreeFinder;
|
||||
import mekanism.common.transporter.Finder.FirstFinder;
|
||||
import mekanism.common.transporter.InvStack;
|
||||
import mekanism.common.transporter.TItemStackFilter;
|
||||
import mekanism.common.transporter.TransporterFilter;
|
||||
|
@ -119,7 +119,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
|
|||
|
||||
if(!hasFilter && autoEject)
|
||||
{
|
||||
inInventory = InventoryUtils.takeTopStack(inventory, ForgeDirection.getOrientation(facing).getOpposite().ordinal(), new FreeFinder());
|
||||
inInventory = InventoryUtils.takeTopStack(inventory, ForgeDirection.getOrientation(facing).getOpposite().ordinal(), new FirstFinder());
|
||||
}
|
||||
|
||||
if(inInventory != null && inInventory.getStack() != null)
|
||||
|
|
|
@ -10,7 +10,7 @@ public abstract class Finder
|
|||
{
|
||||
public abstract boolean modifies(ItemStack stack);
|
||||
|
||||
public static class FreeFinder extends Finder
|
||||
public static class FirstFinder extends Finder
|
||||
{
|
||||
@Override
|
||||
public boolean modifies(ItemStack stack)
|
||||
|
|
|
@ -168,7 +168,7 @@ public final class InventoryUtils
|
|||
return toInsert;
|
||||
}
|
||||
|
||||
public static ItemStack takeTopItemFromInventory(IInventory inventory, int side)
|
||||
public static InvStack takeTopItem(IInventory inventory, int side)
|
||||
{
|
||||
inventory = checkChestInv(inventory);
|
||||
|
||||
|
@ -181,9 +181,7 @@ public final class InventoryUtils
|
|||
ItemStack toSend = inventory.getStackInSlot(i).copy();
|
||||
toSend.stackSize = 1;
|
||||
|
||||
inventory.decrStackSize(i, 1);
|
||||
|
||||
return toSend;
|
||||
return new InvStack(inventory, i, toSend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -204,9 +202,7 @@ public final class InventoryUtils
|
|||
|
||||
if(sidedInventory.canExtractItem(slotID, toSend, side))
|
||||
{
|
||||
sidedInventory.decrStackSize(slotID, 1);
|
||||
|
||||
return toSend;
|
||||
return new InvStack(inventory, slotID, toSend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue