Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed inventory exploit.

  • Loading branch information...
commit cb39b97c8065b77c9f62c5f42c9b74a08ab69e11 1 parent 44a3d07
@garbagemule garbagemule authored
View
BIN  MobArena.jar
Binary file not shown
View
10 src/com/garbagemule/MobArena/util/inventory/InventoryManager.java
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.