Fixed shift clicking from Grid when player inventory is full throwing items in the world, fixes #355
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
### 1.0.5
|
### 1.0.5
|
||||||
- Fixed crafting a complex item causes the process to flow off the Crafting Monitor's GUI (raoulvdberge)
|
- Fixed crafting a complex item causes the process to flow off the Crafting Monitor's GUI (raoulvdberge)
|
||||||
|
- Fixed shift clicking from Grid when player inventory is full throwing items in the world (raoulvdberge)
|
||||||
|
|
||||||
### 1.0.4
|
### 1.0.4
|
||||||
- Fixed lag caused by Crafter (raoulvdberge)
|
- Fixed lag caused by Crafter (raoulvdberge)
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package refinedstorage.apiimpl.network.grid;
|
package refinedstorage.apiimpl.network.grid;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.inventory.InventoryHelper;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
|
import net.minecraftforge.items.ItemHandlerHelper;
|
||||||
import refinedstorage.RefinedStorage;
|
import refinedstorage.RefinedStorage;
|
||||||
import refinedstorage.api.autocrafting.ICraftingPattern;
|
import refinedstorage.api.autocrafting.ICraftingPattern;
|
||||||
import refinedstorage.api.autocrafting.task.ICraftingTask;
|
import refinedstorage.api.autocrafting.task.ICraftingTask;
|
||||||
@@ -60,8 +62,10 @@ public class ItemGridHandler implements IItemGridHandler {
|
|||||||
|
|
||||||
if (took != null) {
|
if (took != null) {
|
||||||
if ((flags & EXTRACT_SHIFT) == EXTRACT_SHIFT) {
|
if ((flags & EXTRACT_SHIFT) == EXTRACT_SHIFT) {
|
||||||
if (!player.inventory.addItemStackToInventory(took.copy())) {
|
ItemStack remainder = ItemHandlerHelper.insertItem(player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.UP), took, false);
|
||||||
InventoryHelper.spawnItemStack(player.worldObj, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ(), took);
|
|
||||||
|
if (remainder != null) {
|
||||||
|
network.insertItem(remainder, remainder.stackSize, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (single && held != null) {
|
if (single && held != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user