From f056fad7657a7d2dd6cbb6379cc3492ea7b08244 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Wed, 9 Mar 2011 16:58:31 +0000 Subject: [PATCH] Fixed crash with bad holding slot --- src/main/java/net/minecraft/server/InventoryPlayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/InventoryPlayer.java b/src/main/java/net/minecraft/server/InventoryPlayer.java index 30d3ca26eb..0ad40a0e40 100644 --- a/src/main/java/net/minecraft/server/InventoryPlayer.java +++ b/src/main/java/net/minecraft/server/InventoryPlayer.java @@ -24,7 +24,11 @@ public class InventoryPlayer implements IInventory { } public ItemStack b() { - return this.a[this.c]; + if (this.c < this.a.length) { + return this.a[this.c]; + } else { + return null; + } } private int d(int i) {