Update BlockBlockUseEvent to use MaterialTags for spawn egg checks
This commit is contained in:
parent
05fd3beb9c
commit
c016db5969
|
|
@ -2,6 +2,7 @@ package com.alttd.playerutils.event_listeners;
|
|||
|
||||
import com.alttd.playerutils.config.Messages;
|
||||
import com.alttd.playerutils.util.Logger;
|
||||
import com.destroystokyo.paper.MaterialTags;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Tag;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -62,7 +63,10 @@ public class BlockBlockUseEvent implements Listener {
|
|||
}
|
||||
|
||||
public boolean isNotBlocked(Material type) {
|
||||
return !type.equals(Material.BEDROCK) && !type.equals(Material.SPAWNER) && !type.equals(Material.BARRIER) && !type.translationKey().endsWith("_spawn_egg");
|
||||
return !type.equals(Material.BEDROCK)
|
||||
&& !type.equals(Material.SPAWNER)
|
||||
&& !type.equals(Material.BARRIER)
|
||||
&& MaterialTags.SPAWN_EGGS.isTagged(type);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user