Minor bug fix with aliases that have no spaces

This commit is contained in:
Ne0n x3r0 2013-02-08 10:07:15 -06:00
parent cca2b4cd63
commit 8c0b3ae954
3 changed files with 18 additions and 14 deletions

View File

@ -1,8 +1,8 @@
package com.ne0nx3r0.betteralias;
import com.ne0nx3r0.betteralias.alias.AliasManager;
import com.ne0nx3r0.betteralias.listener.BetterAliasCommandListener;
import com.ne0nx3r0.betteralias.command.BetterAliasCommandExecutor;
import com.ne0nx3r0.betteralias.listener.BetterAliasCommandListener;
import org.bukkit.plugin.java.JavaPlugin;
public class BetterAlias extends JavaPlugin

View File

@ -87,20 +87,24 @@ public class AliasManager
for(String sArgLine : sArgLines)
{
String sType = sArgLine.substring(0,sArgLine.indexOf(" "));
AliasCommandTypes type = AliasCommandTypes.PLAYER;
if(sType.equalsIgnoreCase("console"))
if(sArgLine.contains(" "))
{
type = AliasCommandTypes.CONSOLE;
sArgLine = sArgLine.substring(sArgLine.indexOf(" ")+1);
}
else if(sType.equalsIgnoreCase("reply"))
{
type = AliasCommandTypes.REPLY_MESSAGE;
sArgLine = sArgLine.substring(sArgLine.indexOf(" ")+1);
String sType = sArgLine.substring(0,sArgLine.indexOf(" "));
if(sType.equalsIgnoreCase("console"))
{
type = AliasCommandTypes.CONSOLE;
sArgLine = sArgLine.substring(sArgLine.indexOf(" ")+1);
}
else if(sType.equalsIgnoreCase("reply"))
{
type = AliasCommandTypes.REPLY_MESSAGE;
sArgLine = sArgLine.substring(sArgLine.indexOf(" ")+1);
}
}
sArgLine = this.replaceColorCodes(sArgLine);

View File

@ -1,6 +1,6 @@
name: BetterAlias
main: com.ne0nx3r0.betteralias.BetterAlias
version: '1.0'
version: '1.0.1'
database: false
description: Command alias system
commands: