@CommandHandler("spawn")
@Permission("craftoplugin.spawn.spawn")
@Description("Teleportiert dich zum Spawn")
public void spawnCommand(CommandSender cs, String[] args) {
if (!(cs instanceof Player)) { CraftoMessenger.sendFailure(cs, Messages.PLAYERS_ONLY); return; }
final Player sender = (Player)cs;
if (!this.module.spawnLoc.isPresent()) { CraftoMessenger.sendFailure(cs, "Es konnte keine Spawnposition gefunden werden."); return; }
final Location3w loc = new Location3w(this.module.spawnLoc.get());
final Optional<TeleportModule> teleportModule = this.module.getModule(TeleportModule.class);
if (teleportModule.isPresent()) {
teleportModule.get().teleport(sender, loc, TeleportCause.COMMAND);
}
else { sender.teleport(loc); }
}
SpawnComponent.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:CraftoPlugin
作者:
评论列表
文章目录