Skip to content

Commit

Permalink
📌[main/guild] basic guild implement
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepymalc committed Aug 28, 2021
1 parent 6e446b3 commit 0304340
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"bukkit",
"cmdlable",
"minecraft"
],
"cSpell.ignoreWords": [
"member",
"nums"
]
}
21 changes: 19 additions & 2 deletions src/main/java/com/linyuanlin/minecraft/Manager/GuildManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;

import net.md_5.bungee.api.chat.TextComponent;

import java.io.*;
import java.util.*;

import javax.swing.text.DefaultStyledDocument.ElementSpec;

public class GuildManager implements CommandExecutor {
public static App getPlugin() {
return JavaPlugin.getPlugin(App.class);
Expand All @@ -35,7 +39,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
case "getInvitationPaper":
return this.getInvitationPaper(p);
case "useInvitationPaper":
return this.useInvitationPaper(p);
return this.useInvitationPaper(p, args);
case "second":
return this.second(p, args);
default:
Expand All @@ -62,8 +66,21 @@ private boolean getInvitationPaper(PlayerData senderPlayer) {
return true;
}

private boolean useInvitationPaper(PlayerData sendPlayer) {
private boolean useInvitationPaper(PlayerData sendPlayer, String[] args) {
if (args.length == 0) {
sendPlayer.player().sendMessage("請至少邀請一人");
return false;
}

for (String name : args) {
Player receiverPlayer = Bukkit.getPlayer(name);
if (receiverPlayer == null) {
sendPlayer.player()
.sendMessage("邀請對象" + ChatColor.GOLD + name + ChatColor.WHITE + "不存在");
} else {
receiverPlayer.sendMessage("err");
}
}
return true;
}

Expand Down

0 comments on commit 0304340

Please sign in to comment.