2020-09-14 04:08:15 +00:00
|
|
|
package xyz.etztech.minealert;
|
|
|
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.metadata.FixedMetadataValue;
|
|
|
|
|
|
|
|
public enum MuteType {
|
2020-12-06 23:08:53 +00:00
|
|
|
OREALERT_MUTE("minealert.ignore.ore"),
|
|
|
|
GRIEFALERT_MUTE("minealert.ignore.grief");
|
2020-09-14 04:08:15 +00:00
|
|
|
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|