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; package com.ne0nx3r0.betteralias;
import com.ne0nx3r0.betteralias.alias.AliasManager; import com.ne0nx3r0.betteralias.alias.AliasManager;
import com.ne0nx3r0.betteralias.listener.BetterAliasCommandListener;
import com.ne0nx3r0.betteralias.command.BetterAliasCommandExecutor; import com.ne0nx3r0.betteralias.command.BetterAliasCommandExecutor;
import com.ne0nx3r0.betteralias.listener.BetterAliasCommandListener;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
public class BetterAlias extends JavaPlugin public class BetterAlias extends JavaPlugin

View File

@ -87,9 +87,12 @@ public class AliasManager
for(String sArgLine : sArgLines) for(String sArgLine : sArgLines)
{ {
String sType = sArgLine.substring(0,sArgLine.indexOf(" "));
AliasCommandTypes type = AliasCommandTypes.PLAYER; AliasCommandTypes type = AliasCommandTypes.PLAYER;
if(sArgLine.contains(" "))
{
String sType = sArgLine.substring(0,sArgLine.indexOf(" "));
if(sType.equalsIgnoreCase("console")) if(sType.equalsIgnoreCase("console"))
{ {
type = AliasCommandTypes.CONSOLE; type = AliasCommandTypes.CONSOLE;
@ -102,6 +105,7 @@ public class AliasManager
sArgLine = sArgLine.substring(sArgLine.indexOf(" ")+1); sArgLine = sArgLine.substring(sArgLine.indexOf(" ")+1);
} }
}
sArgLine = this.replaceColorCodes(sArgLine); sArgLine = this.replaceColorCodes(sArgLine);

View File

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