Mimic Vanilla behavior with shift clicking.
This commit is contained in:
@@ -38,7 +38,6 @@ import appeng.client.render.BlockRenderInfo;
|
|||||||
import appeng.client.render.WorldRender;
|
import appeng.client.render.WorldRender;
|
||||||
import appeng.client.texture.FlipableIcon;
|
import appeng.client.texture.FlipableIcon;
|
||||||
import appeng.client.texture.MissingIcon;
|
import appeng.client.texture.MissingIcon;
|
||||||
import appeng.core.CommonHelper;
|
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.features.AEFeatureHandler;
|
import appeng.core.features.AEFeatureHandler;
|
||||||
import appeng.core.features.IAEFeature;
|
import appeng.core.features.IAEFeature;
|
||||||
|
|||||||
@@ -669,6 +669,14 @@ public abstract class AEBaseContainer extends Container
|
|||||||
|
|
||||||
protected void bindPlayerInventory(InventoryPlayer inventoryPlayer, int offset_x, int offset_y)
|
protected void bindPlayerInventory(InventoryPlayer inventoryPlayer, int offset_x, int offset_y)
|
||||||
{
|
{
|
||||||
|
for (int i = 0; i < 9; i++)
|
||||||
|
{
|
||||||
|
if ( locked.contains( i ) )
|
||||||
|
addSlotToContainer( new SlotDisabled( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
|
||||||
|
else
|
||||||
|
addSlotToContainer( new SlotPlayerHotBar( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < 9; j++)
|
for (int j = 0; j < 9; j++)
|
||||||
@@ -679,14 +687,6 @@ public abstract class AEBaseContainer extends Container
|
|||||||
addSlotToContainer( new SlotPlayerInv( inventoryPlayer, j + i * 9 + 9, 8 + j * 18 + offset_x, offset_y + i * 18 ) );
|
addSlotToContainer( new SlotPlayerInv( inventoryPlayer, j + i * 9 + 9, 8 + j * 18 + offset_x, offset_y + i * 18 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 9; i++)
|
|
||||||
{
|
|
||||||
if ( locked.contains( i ) )
|
|
||||||
addSlotToContainer( new SlotDisabled( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
|
|
||||||
else
|
|
||||||
addSlotToContainer( new SlotPlayerHotBar( inventoryPlayer, i, 8 + i * 18 + offset_x, 58 + offset_y ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack shiftStoreItem(ItemStack input)
|
public ItemStack shiftStoreItem(ItemStack input)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package appeng.debug;
|
|||||||
|
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|||||||
@@ -491,7 +491,6 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer
|
|||||||
|
|
||||||
public void onNeighborChanged()
|
public void onNeighborChanged()
|
||||||
{
|
{
|
||||||
TileEntity te = getTile();
|
|
||||||
hasRedstone = YesNo.UNDECIDED;
|
hasRedstone = YesNo.UNDECIDED;
|
||||||
|
|
||||||
for (ForgeDirection s : ForgeDirection.values())
|
for (ForgeDirection s : ForgeDirection.values())
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public abstract class InventoryAdaptor implements Iterable<ItemSlot>
|
|||||||
|
|
||||||
if ( te instanceof EntityPlayer )
|
if ( te instanceof EntityPlayer )
|
||||||
{
|
{
|
||||||
return new AdaptorIInventory( new AdaptorPlayerInventory( ((EntityPlayer) te).inventory ) );
|
return new AdaptorIInventory( new AdaptorPlayerInventory( ((EntityPlayer) te).inventory, false ) );
|
||||||
}
|
}
|
||||||
else if ( te instanceof ArrayList )
|
else if ( te instanceof ArrayList )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,21 +1,24 @@
|
|||||||
package appeng.util.inv;
|
package appeng.util.inv;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class AdaptorPlayerInventory implements IInventory
|
public class AdaptorPlayerInventory implements IInventory
|
||||||
{
|
{
|
||||||
|
|
||||||
private InventoryPlayer src;
|
private final IInventory src;
|
||||||
private int min;
|
private final int min=0;
|
||||||
private int size;
|
private final int size=36;
|
||||||
|
|
||||||
public AdaptorPlayerInventory(InventoryPlayer a) {
|
public AdaptorPlayerInventory(IInventory playerInv, boolean swap)
|
||||||
src = a;
|
{
|
||||||
min = 0; // a.getStartInventorySide( d );
|
|
||||||
size = 36; // a.getSizeInventorySide( d );
|
if ( swap )
|
||||||
|
src = new WrapperChainedInventory( new WrapperInventoryRange( playerInv, 9, size-9, false ), new WrapperInventoryRange( playerInv, 0, 9, false ) );
|
||||||
|
else
|
||||||
|
src = playerInv;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -24,7 +26,7 @@ public class WrapperChainedInventory implements IInventory
|
|||||||
private List<IInventory> l;
|
private List<IInventory> l;
|
||||||
private HashMap<Integer, InvOffset> offsets;
|
private HashMap<Integer, InvOffset> offsets;
|
||||||
|
|
||||||
public WrapperChainedInventory(IInventory ilist) {
|
public WrapperChainedInventory(IInventory... ilist) {
|
||||||
setInventory( ilist );
|
setInventory( ilist );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,10 +69,9 @@ public class WrapperChainedInventory implements IInventory
|
|||||||
fullSize = offset;
|
fullSize = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInventory(IInventory a)
|
public void setInventory(IInventory... a)
|
||||||
{
|
{
|
||||||
l = new ArrayList();
|
l = ImmutableList.copyOf( a );
|
||||||
l.add( a );
|
|
||||||
calculateSizes();
|
calculateSizes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user