Created
June 12, 2019 16:28
-
-
Save Neverboosted/79f548e902ff9f8e5c9c496ec8081d58 to your computer and use it in GitHub Desktop.
DelhomeCommand
This file contains 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 de.fly.main.commands; | |
import de.fly.main.Main; | |
import org.bukkit.command.Command; | |
import org.bukkit.command.CommandExecutor; | |
import org.bukkit.command.CommandSender; | |
import org.bukkit.entity.Player; | |
public class DelhomeCommand implements CommandExecutor { | |
@Override | |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { | |
if(label.equalsIgnoreCase("delhome")){ | |
if(sender instanceof Player){ | |
Player p = (Player) sender; | |
if(args.length == 0){ | |
p.sendMessage("§b[REDz] §cFalscher Syntax : §7/delhome (Name)"); | |
return false; | |
} | |
if(args.length == 1){ | |
if(Main.getInstance().getConfig().contains("home" + p.getUniqueId().toString() + "." + args[0])){ | |
Main.getInstance().getConfig().set("home." + p.getUniqueId().toString() + "." + args[0], null); | |
p.sendMessage("§b[REDz] §7Der Home §e " + args[0] + "§7wurde gelöscht!" ); | |
return false; | |
} else { | |
p.sendMessage("§b[REDz] §7 Der Home mit dem Namen §e " + args[0] + " §7 exsistiert nicht!"); | |
return false; | |
} | |
} | |
if(args.length >= 2) { | |
p.sendMessage("§b[REDz] §cFalscher Syntax : §7/delhome (Name)"); | |
return false; | |
} | |
} | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment