32 lines
850 B
Java
32 lines
850 B
Java
package xyz.etztech.minealert;
|
|
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.metadata.FixedMetadataValue;
|
|
|
|
public enum MuteType {
|
|
OREALERT_MUTE("minealert.ignore.ore"),
|
|
GRIEFALERT_MUTE("minealert.ignore.grief");
|
|
|
|
private final String metadataValue;
|
|
|
|
MuteType(String s) {
|
|
this.metadataValue = s;
|
|
}
|
|
|
|
public String getMetadataValue() {
|
|
return metadataValue;
|
|
}
|
|
|
|
public void setMuteStatus(Player player, MineAlert plugin) {
|
|
player.setMetadata(getMetadataValue(), new FixedMetadataValue(plugin, getMetadataValue()));
|
|
}
|
|
|
|
public void removeMuteStatus(Player player, MineAlert plugin) {
|
|
player.removeMetadata(getMetadataValue(), plugin);
|
|
}
|
|
|
|
public boolean hasMuteStatus(Player player, MineAlert plugin) {
|
|
return player.hasMetadata(this.getMetadataValue());
|
|
}
|
|
}
|