use of net.minecraft.inventory.container.Slot in project BluePower by Qmunity.
the class ContainerFilter method quickMoveStack.
@Override
public ItemStack quickMoveStack(PlayerEntity player, int par2) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = (Slot) slots.get(par2);
if (slot != null && slot.hasItem()) {
ItemStack itemstack1 = slot.getItem();
itemstack = itemstack1.copy();
if (par2 < 9) {
if (!moveItemStackTo(itemstack1, 9, 45, true))
return ItemStack.EMPTY;
} else if (!moveItemStackTo(itemstack1, 0, 9, false)) {
return ItemStack.EMPTY;
}
if (itemstack1.getCount() == 0) {
slot.set(ItemStack.EMPTY);
} else {
slot.setChanged();
}
if (itemstack1.getCount() != itemstack.getCount()) {
slot.onQuickCraft(itemstack, itemstack1);
} else {
return ItemStack.EMPTY;
}
}
return itemstack;
}
Aggregations