Fixed error on pickup item event in 1.8

This commit is contained in:
Brianna O'Keefe 2019-03-31 14:18:10 -04:00
parent 6d0ee6c5e0
commit 27f5d6bc44

View File

@ -16,6 +16,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.inventory.ItemStack;
import java.util.ArrayList;
@ -77,8 +78,7 @@ public class EntityListeners implements Listener {
}
@EventHandler
public void onPickup(EntityPickupItemEvent event) {
if (!(event.getEntity() instanceof Player)) return;
public void onPickup(PlayerPickupItemEvent event) {
event.getItem().setItemStack(instance.getStackingTask().setMax(event.getItem().getItemStack(), 0, true));
ItemStack item = event.getItem().getItemStack();