Skip to content

Instantly share code, notes, and snippets.

@Alvin-LB
Created August 14, 2017 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alvin-LB/1d5442aff41bd761c377f06bd0bef387 to your computer and use it in GitHub Desktop.
Save Alvin-LB/1d5442aff41bd761c377f06bd0bef387 to your computer and use it in GitHub Desktop.
IgnoreHider
package com.bringholm.ignorehider;
import net.ess3.api.events.IgnoreStatusChangeEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public class IgnoreHider extends JavaPlugin implements Listener {
@Override
public void onEnable() {
if (!this.getServer().getPluginManager().isPluginEnabled("Essentials")) {
throw new IllegalArgumentException("IgnoreHider could not find Essentials, are you sure you have it installed?");
}
this.getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onIgnore(IgnoreStatusChangeEvent e) {
if (e.getValue()) {
e.getController().getBase().hidePlayer(e.getAffected().getBase());
} else {
e.getController().getBase().showPlayer(e.getAffected().getBase());
}
}
}
name: IgnoreHider
version: 1.0
main: com.bringholm.ignorehider.IgnoreHider
author: AlvinB
softdepend: [Essentials]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment