mirror of
https://github.com/Ne0nx3r0/BetterAlias.git
synced 2025-02-14 01:11:20 +01:00
fix code style
This commit is contained in:
parent
f06b24440f
commit
cf3d34a823
@ -9,14 +9,12 @@ import com.ne0nx3r0.betteralias.command.BetterAliasCommandExecutor;
|
||||
import com.ne0nx3r0.betteralias.config.PluginConfig;
|
||||
import com.ne0nx3r0.betteralias.listener.BetterAliasCommandListener;
|
||||
|
||||
public class BetterAlias extends JavaPlugin
|
||||
{
|
||||
public class BetterAlias extends JavaPlugin {
|
||||
public AliasManager aliasManager;
|
||||
public PluginConfig config;
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
{
|
||||
public void onEnable() {
|
||||
this.config = new PluginConfig(this);
|
||||
|
||||
if (this.config.isDebuggingAllowed() == true) {
|
||||
|
@ -5,24 +5,19 @@ import java.util.List;
|
||||
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
||||
public class Alias
|
||||
{
|
||||
public class Alias {
|
||||
public final String command;
|
||||
public final boolean caseSensitive;
|
||||
private final String permission;
|
||||
private final EventPriority priority;
|
||||
private final HashMap<Integer, List<AliasCommand>> parameters;
|
||||
|
||||
public Alias(String commandName, boolean caseSensitive, String permissionNode, String priority)
|
||||
{
|
||||
public Alias(String commandName, boolean caseSensitive, String permissionNode, String priority) {
|
||||
this.caseSensitive = caseSensitive;
|
||||
|
||||
if(this.caseSensitive)
|
||||
{
|
||||
if (this.caseSensitive) {
|
||||
this.command = commandName;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.command = commandName.toLowerCase();
|
||||
}
|
||||
|
||||
@ -62,27 +57,22 @@ public class Alias
|
||||
}
|
||||
|
||||
// get commands where length is number of arguments
|
||||
public boolean hasCommandFor(int length)
|
||||
{
|
||||
public boolean hasCommandFor(int length) {
|
||||
return this.parameters.containsKey(length) || this.parameters.containsKey(-1);
|
||||
}
|
||||
|
||||
public String getPermissionNode()
|
||||
{
|
||||
public String getPermissionNode() {
|
||||
return this.permission;
|
||||
}
|
||||
|
||||
public boolean hasPermission()
|
||||
{
|
||||
public boolean hasPermission() {
|
||||
return this.permission != null;
|
||||
}
|
||||
|
||||
Iterable<AliasCommand> getCommands(int length)
|
||||
{
|
||||
Iterable<AliasCommand> getCommands(int length) {
|
||||
List<AliasCommand> commands = this.parameters.get(length);
|
||||
|
||||
if(commands != null)
|
||||
{
|
||||
if (commands != null) {
|
||||
return commands;
|
||||
}
|
||||
|
||||
@ -90,8 +80,7 @@ public class Alias
|
||||
}
|
||||
|
||||
// organize aliases by number of arguments
|
||||
public void setCommandsFor(int length,List<AliasCommand> commandsList)
|
||||
{
|
||||
public void setCommandsFor(int length,List<AliasCommand> commandsList) {
|
||||
this.parameters.put(length, commandsList);
|
||||
}
|
||||
}
|
||||
|
@ -6,13 +6,11 @@ public class AliasCommand
|
||||
final AliasCommandTypes type;
|
||||
int waitTime;
|
||||
|
||||
public AliasCommand(String command, AliasCommandTypes type, int waitTime)
|
||||
{
|
||||
public AliasCommand(String command, AliasCommandTypes type, int waitTime) {
|
||||
this.command = command;
|
||||
this.type = type;
|
||||
|
||||
if(waitTime > 0)
|
||||
{
|
||||
if (waitTime > 0) {
|
||||
this.waitTime = waitTime;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.ne0nx3r0.betteralias.alias;
|
||||
|
||||
public enum AliasCommandTypes
|
||||
{
|
||||
public enum AliasCommandTypes {
|
||||
PLAYER,
|
||||
PLAYER_AS_OP,
|
||||
CONSOLE,
|
||||
|
@ -35,5 +35,4 @@ public class BetterAliasCommandExecutor implements CommandExecutor {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user