Permalink
Browse files

Fixed inventory exploit.

  • Loading branch information...
1 parent 44a3d07 commit cb39b97c8065b77c9f62c5f42c9b74a08ab69e11 @garbagemule garbagemule committed Sep 18, 2012
Showing with 10 additions and 0 deletions.
  1. BIN MobArena.jar
  2. +10 −0 src/com/garbagemule/MobArena/util/inventory/InventoryManager.java
View
Binary file not shown.
@@ -5,6 +5,8 @@
import java.util.Map;
import org.bukkit.entity.Player;
+import org.bukkit.inventory.Inventory;
+import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
@@ -86,6 +88,14 @@ public void clearInventory(Player p) {
inv.setChestplate(null);
inv.setLeggings(null);
inv.setBoots(null);
+ InventoryView view = p.getOpenInventory();
+ if (view != null) {
+ view.setCursor(null);
+ Inventory i = view.getTopInventory();
+ if (i != null) {
+ i.clear();
+ }
+ }
}
private boolean saveToFile(Player p) {

0 comments on commit cb39b97

Please sign in to comment.