Created
August 14, 2017 17:44
-
-
Save Alvin-LB/1d5442aff41bd761c377f06bd0bef387 to your computer and use it in GitHub Desktop.
IgnoreHider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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