Fixed index out of bounds error on custom GUI slot clicks.

This commit is contained in:
Luis C.M committed 2023-05-31 20:21:00 -05:00
1 parent 0c25d7ec1c
commit 0e9ddd75b6
1 file changed
+5
@@ -108,6 +108,11 @@ public class ContainerCustomGui extends Container {
public ItemStack slotClick(int slotId, int dragType, int clickTypeIn, EntityPlayer player) {
if(slotId < 0)
return super.slotClick(slotId, dragType, clickTypeIn, player);
if (slotId >= this.inventorySlots.size()) {
return null;
}
Slot mcSlot = (Slot)this.inventorySlots.get(slotId);
if(!player.worldObj.isRemote && mcSlot != null) {
IItemSlot slot = null;