Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Save New Duplicate & Edit Just Text Twitter
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- package takahatashun.antidote;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.entity.Player;
- import org.bukkit.event.Listener;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.potion.PotionEffectType;
- import org.bukkit.command.CommandSender;
- import org.bukkit.command.Command;
- public final class main extends JavaPlugin implements Listener {
- @Override
- public void onEnable() {
- getConfig().options().copyDefaults(true);
- saveConfig();
- Bukkit.getServer().getLogger().info("Antidote đã được bật");
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String arg2, String[] args) {
- if (cmd.getName().equalsIgnoreCase("antidote")) {
- if (!(sender instanceof Player)) {
- sender.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("Msg.OnlyPlayer")));
- }
- Player p = (Player) sender;
- if (!(p.hasPermission("Antidote.use"))) {
- p.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("Msg.Prefix")) + ChatColor.translateAlternateColorCodes('&', getConfig().getString("Msg.NoPerm")));
- return true;
- }
- p.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("Msg.Used")));
- if (p.hasPotionEffect(PotionEffectType.BLINDNESS) == true) {
- p.removePotionEffect(PotionEffectType.BLINDNESS);
- }
- if (p.hasPotionEffect(PotionEffectType.CONFUSION) == true) {
- p.removePotionEffect(PotionEffectType.CONFUSION);
- }
- if (p.hasPotionEffect(PotionEffectType.HUNGER) == true) {
- p.removePotionEffect(PotionEffectType.HUNGER);
- }
- if (p.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE) == true) {
- p.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- }
- if (p.hasPotionEffect(PotionEffectType.POISON) == true) {
- p.removePotionEffect(PotionEffectType.POISON);
- }
- if (p.hasPotionEffect(PotionEffectType.SLOW) == true) {
- p.removePotionEffect(PotionEffectType.SLOW);
- }
- if (p.hasPotionEffect(PotionEffectType.SLOW_DIGGING) == true) {
- p.removePotionEffect(PotionEffectType.SLOW_DIGGING);
- }
- if (p.hasPotionEffect(PotionEffectType.WEAKNESS) == true) {
- p.removePotionEffect(PotionEffectType.WEAKNESS);
- }
- return true;
- }
- if (cmd.getName().equalsIgnoreCase("antidotereload")) {
- Player p2 = (Player) sender;
- if (!(p2.hasPermission("Antidote.reload"))) {
- p2.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("Msg.Prefix")) + ChatColor.translateAlternateColorCodes('&', getConfig().getString("Msg.NoPerm")));
- return true;
- }
- reloadConfig();
- saveConfig();
- p2.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("Msg.Reloaded")));
- return true;
- }
- return false;
- }
- @Override
- public void onDisable () {
- Bukkit.getServer().getLogger().info("Antidote đã bị tắt");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement