From db1545b89cb501a91c8feb0d166828f0dbb8a1be Mon Sep 17 00:00:00 2001 From: Shevchik Date: Thu, 2 Jan 2014 19:54:52 +0400 Subject: [PATCH] Scan height should be 2 --- src/com/cnaude/chairs/ChairEffects.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/cnaude/chairs/ChairEffects.java b/src/com/cnaude/chairs/ChairEffects.java index 73df5f8..5e96340 100644 --- a/src/com/cnaude/chairs/ChairEffects.java +++ b/src/com/cnaude/chairs/ChairEffects.java @@ -82,14 +82,14 @@ public class ChairEffects { public void run() { for (Player p : Bukkit.getOnlinePlayers()) { if (plugin.getPlayerSitData().isSitting(p)) { - for (Entity entity : p.getNearbyEntities(1, 1, 1)) { + for (Entity entity : p.getNearbyEntities(1, 2, 1)) { if (entity instanceof Item) { if (p.getInventory().firstEmpty() != -1) { - Item item = Item.class.cast(entity); - if (item.getPickupDelay() == 0) { - p.getInventory().addItem(item.getItemStack()); + Item item = (Item) entity; + if (item.getPickupDelay() == 0) { + p.getInventory().addItem(item.getItemStack()); entity.remove(); - } + } } } }