mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Fixed crate item movement prevention applying to all held items (let me move this coal powder)
This commit is contained in:
parent
b90741f640
commit
ca8a7a72f9
@ -1,5 +1,6 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.items.block.ItemBlockStorageCrate;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@ -18,8 +19,15 @@ public class ContainerCrateBase extends ContainerBase {
|
||||
@Override
|
||||
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
|
||||
// prevents the player from moving around the currently open box
|
||||
if(mode == 2 && button == player.inventory.currentItem) return null;
|
||||
if(index == player.inventory.currentItem + 27 + this.tile.getSizeInventory()) return null;
|
||||
if(player.inventory.getStackInSlot(player.inventory.currentItem) != null &&
|
||||
player.inventory.getStackInSlot(player.inventory.currentItem).getItem() instanceof ItemBlockStorageCrate) {
|
||||
if (mode == 2 && button == player.inventory.currentItem) {
|
||||
return null;
|
||||
}
|
||||
if (index == player.inventory.currentItem + 27 + this.tile.getSizeInventory()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return super.slotClick(index, button, mode, player);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user