Files
HuskHomes/src/main/java/me/william278/huskhomes2/commands/SetspawnCommand.java
T
Daniil Z 65aa367d98 Simplify CommandBase's onCommand
Added some TODOs to do
Replaced "dynamic" regex with cached Patterns
2021-03-01 22:24:16 +03:00

22 lines
774 B
Java

package me.william278.huskhomes2.commands;
import me.william278.huskhomes2.HuskHomes;
import me.william278.huskhomes2.MessageManager;
import me.william278.huskhomes2.teleport.SettingHandler;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
public class SetspawnCommand extends CommandBase {
@Override
protected void onCommand(Player p, Command command, String label, String[] args) {
if (HuskHomes.getSettings().doSpawnCommand()) {
SettingHandler.setSpawnLocation(p.getLocation());
p.getLocation().getWorld().setSpawnLocation(p.getLocation());
MessageManager.sendMessage(p, "set_spawn_success");
} else {
MessageManager.sendMessage(p, "error_command_disabled");
}
}
}