mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-12-24 09:47:38 +01:00
Add checks to BaseItemLine.onPickup()
This commit is contained in:
parent
55643651c9
commit
f470dddc40
@ -11,6 +11,7 @@ import me.filoghost.holographicdisplays.api.hologram.PickupHandler;
|
||||
import me.filoghost.holographicdisplays.common.hologram.StandardItemLine;
|
||||
import me.filoghost.holographicdisplays.plugin.hologram.tracking.ItemLineTracker;
|
||||
import me.filoghost.holographicdisplays.plugin.hologram.tracking.LineTrackerManager;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.MustBeInvokedByOverriders;
|
||||
@ -33,7 +34,12 @@ public abstract class BaseItemLine extends BaseTouchableLine implements Standard
|
||||
|
||||
@Override
|
||||
public void onPickup(Player player) {
|
||||
if (pickupHandler == null || !isVisibleTo(player)) {
|
||||
if (isDeleted()
|
||||
|| !player.isOnline()
|
||||
|| !isTrackedPlayer(player)
|
||||
|| player.getGameMode() == GameMode.SPECTATOR
|
||||
|| pickupHandler == null
|
||||
|| !isVisibleTo(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user