Scan height should be 2
This commit is contained in:
parent
768e111660
commit
db1545b89c
@ -82,14 +82,14 @@ public class ChairEffects {
|
|||||||
public void run() {
|
public void run() {
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
if (plugin.getPlayerSitData().isSitting(p)) {
|
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 (entity instanceof Item) {
|
||||||
if (p.getInventory().firstEmpty() != -1) {
|
if (p.getInventory().firstEmpty() != -1) {
|
||||||
Item item = Item.class.cast(entity);
|
Item item = (Item) entity;
|
||||||
if (item.getPickupDelay() == 0) {
|
if (item.getPickupDelay() == 0) {
|
||||||
p.getInventory().addItem(item.getItemStack());
|
p.getInventory().addItem(item.getItemStack());
|
||||||
entity.remove();
|
entity.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user