-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed rank registry reloading & loading. (If you change the name of a rank put a new key called "old-name: NameHere")
- Loading branch information
Showing
9 changed files
with
159 additions
and
11 deletions.
There are no files selected for viewing
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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/github/sanctum/clans/commands/CommandReservoir.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.github.sanctum.clans.commands; | ||
|
||
import com.github.sanctum.clans.construct.api.Clan; | ||
import com.github.sanctum.clans.construct.api.ClanSubCommand; | ||
import com.github.sanctum.clans.construct.api.ClansAPI; | ||
import com.github.sanctum.clans.construct.api.GUI; | ||
import com.github.sanctum.clans.construct.util.StringLibrary; | ||
import com.github.sanctum.labyrinth.formatting.completion.SimpleTabCompletion; | ||
import com.github.sanctum.labyrinth.formatting.completion.TabCompletionIndex; | ||
import java.util.List; | ||
import org.bukkit.entity.Player; | ||
|
||
public class CommandReservoir extends ClanSubCommand { | ||
public CommandReservoir() { | ||
super("reservoir"); | ||
} | ||
|
||
@Override | ||
public boolean player(Player p, String label, String[] args) { | ||
StringLibrary lib = Clan.ACTION; | ||
Clan.Associate associate = ClansAPI.getInstance().getAssociate(p).orElse(null); | ||
|
||
if (args.length == 0) { | ||
if (associate != null) { | ||
GUI.RESERVOIR.get(associate.getClan()).open(p); | ||
} else { | ||
sendMessage(p, lib.notInClan()); | ||
} | ||
return true; | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public List<String> tab(Player p, String label, String[] args) { | ||
return SimpleTabCompletion.of(args) | ||
.then(TabCompletionIndex.ONE, getBaseCompletion(args)) | ||
.get(); | ||
} | ||
} |
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
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
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
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
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
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
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