26 lines
867 B
Java
26 lines
867 B
Java
package cn.citycraft.ResExtras.flags;
|
|
|
|
import org.bukkit.entity.LivingEntity;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.EventPriority;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
|
|
|
import com.bekvon.bukkit.residence.Residence;
|
|
import com.bekvon.bukkit.residence.protection.FlagPermissions;
|
|
|
|
public class Blaze implements Listener {
|
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
|
public void onBlaze(final CreatureSpawnEvent event) {
|
|
final FlagPermissions FlagPermissions = Residence.getPermsByLoc(event.getLocation());
|
|
final LivingEntity Entity = event.getEntity();
|
|
if (FlagPermissions == null)
|
|
return;
|
|
if (Entity instanceof org.bukkit.entity.Blaze) {
|
|
if (FlagPermissions.has("blaze", true))
|
|
return;
|
|
event.setCancelled(true);
|
|
}
|
|
}
|
|
}
|