Initial commit of SurvivalPlus plugin
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package de.viper.survivalplus.commands;
|
||||
|
||||
import de.viper.survivalplus.SurvivalPlus;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class NightCommand implements CommandExecutor {
|
||||
private final SurvivalPlus plugin;
|
||||
|
||||
public NightCommand(SurvivalPlus plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player player)) {
|
||||
sender.sendMessage("§cNur Spieler können diesen Befehl ausführen!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!player.hasPermission("survivalplus.night")) {
|
||||
player.sendMessage(plugin.getLangConfig().getString("no-permission", "§cDu hast keine Berechtigung!"));
|
||||
return true;
|
||||
}
|
||||
|
||||
player.getWorld().setTime(13000); // Nacht setzen
|
||||
player.sendMessage("§aEs ist jetzt Nacht!");
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user