
Added 2 new options in config for disabling vanish and unvanish chat messages to all players and also added option to disable pvp for vanished players.
35 lines
798 B
Java
35 lines
798 B
Java
package pl.sloudpl.simplevanish.events;
|
|
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|
import pl.sloudpl.simplevanish.SimpleVanish;
|
|
|
|
public class onPlayerDamage implements Listener {
|
|
|
|
SimpleVanish plugin;
|
|
|
|
public onPlayerDamage(SimpleVanish plugin){
|
|
this.plugin = plugin;
|
|
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
|
}
|
|
|
|
@EventHandler
|
|
public void PlayerDamage(EntityDamageByEntityEvent e){
|
|
|
|
if(e.getDamager() instanceof Player){
|
|
|
|
Player damager = (Player) e.getDamager();
|
|
|
|
if(plugin.inVanishList.contains(damager)){
|
|
|
|
e.setCancelled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|