-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
135 additions
and
55 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
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
59 changes: 59 additions & 0 deletions
59
NWorldPermissions/src/top/nololiyt/worldpermissions/commands/marks/ListExecutor.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,59 @@ | ||
package top.nololiyt.worldpermissions.commands.marks; | ||
|
||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import top.nololiyt.worldpermissions.MarksManager; | ||
import top.nololiyt.worldpermissions.MessagesManager; | ||
import top.nololiyt.worldpermissions.RootPlugin; | ||
import top.nololiyt.worldpermissions.commands.Executor; | ||
import top.nololiyt.worldpermissions.entities.DotDividedStringBuilder; | ||
import top.nololiyt.worldpermissions.entities.StringPair; | ||
|
||
import java.io.IOException; | ||
|
||
public class ListExecutor extends Executor | ||
{ | ||
protected final static String layerName = "list"; | ||
|
||
@Override | ||
protected String permissionName() | ||
{ | ||
return null; | ||
} | ||
|
||
@Override | ||
protected String messageKey() | ||
{ | ||
return layerName; | ||
} | ||
|
||
@Override | ||
protected boolean run(int layer, RootPlugin rootPlugin, DotDividedStringBuilder permission, | ||
DotDividedStringBuilder messageKey, CommandSender commandSender, | ||
String[] args) | ||
{ | ||
MessagesManager messagesManager = rootPlugin.getMessagesManager(); | ||
|
||
StringBuilder message = new StringBuilder(); | ||
message.append(messagesManager.getItem( | ||
new DotDividedStringBuilder(messageKey).append("beginning"))); | ||
|
||
String separator = messagesManager.getItem( | ||
new DotDividedStringBuilder(messageKey).append("separator")); | ||
for (String name : rootPlugin.getMarksManager().allMarksName()) | ||
{ | ||
message.append(name); | ||
message.append(separator); | ||
} | ||
|
||
int ml = message.length(); | ||
message.delete(ml - separator.length(), ml); | ||
message.append(messagesManager.getItem( | ||
new DotDividedStringBuilder(messageKey).append("ending"))); | ||
|
||
messagesManager.sendMessage(new StringPair[]{ | ||
StringPair.senderName(commandSender.getName()) | ||
}, commandSender, message.toString()); | ||
return true; | ||
} | ||
} |
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
Oops, something went wrong.