Commands Part 3
This commit is contained in:
parent
b7bd031028
commit
b82c13521d
1 changed files with 14 additions and 3 deletions
|
@ -30,7 +30,7 @@ public class CommandSN extends CommandBase
|
||||||
|
|
||||||
public void processCommand(ICommandSender icommandsender, String[] astring)
|
public void processCommand(ICommandSender icommandsender, String[] astring)
|
||||||
{
|
{
|
||||||
EntityPlayerMP targetPlayer = getPlayer(icommandsender, astring[1]);
|
EntityPlayerMP targetPlayer = getPlayer(icommandsender, astring[0]);
|
||||||
String owner = targetPlayer.getDisplayName();
|
String owner = targetPlayer.getDisplayName();
|
||||||
|
|
||||||
if (astring.length >= 2 && astring.length <= 3)
|
if (astring.length >= 2 && astring.length <= 3)
|
||||||
|
@ -48,7 +48,8 @@ public class CommandSN extends CommandBase
|
||||||
|
|
||||||
if (amount > SoulNetworkHandler.getCurrentEssence(owner))
|
if (amount > SoulNetworkHandler.getCurrentEssence(owner))
|
||||||
{
|
{
|
||||||
SoulNetworkHandler.syphonFromNetwork(owner, SoulNetworkHandler.getCurrentEssence(owner));
|
int lp = SoulNetworkHandler.getCurrentEssence(owner);
|
||||||
|
SoulNetworkHandler.syphonFromNetwork(owner, lp);
|
||||||
func_152373_a(icommandsender, this, "commands.soulnetwork.subtract.success", new Object[] {SoulNetworkHandler.getCurrentEssence(owner), owner});
|
func_152373_a(icommandsender, this, "commands.soulnetwork.subtract.success", new Object[] {SoulNetworkHandler.getCurrentEssence(owner), owner});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -59,7 +60,8 @@ public class CommandSN extends CommandBase
|
||||||
}
|
}
|
||||||
else if ("fill".equalsIgnoreCase(astring[1]))
|
else if ("fill".equalsIgnoreCase(astring[1]))
|
||||||
{
|
{
|
||||||
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, Integer.MAX_VALUE, Integer.MAX_VALUE);
|
int amount = Integer.MAX_VALUE - SoulNetworkHandler.getCurrentEssence(owner);
|
||||||
|
SoulNetworkHandler.addCurrentEssenceToMaximum(owner, amount, Integer.MAX_VALUE);
|
||||||
func_152373_a(icommandsender, this, "commands.soulnetwork.fill.success", new Object[] {owner});
|
func_152373_a(icommandsender, this, "commands.soulnetwork.fill.success", new Object[] {owner});
|
||||||
}
|
}
|
||||||
else if ("empty".equalsIgnoreCase(astring[1]))
|
else if ("empty".equalsIgnoreCase(astring[1]))
|
||||||
|
@ -67,6 +69,15 @@ public class CommandSN extends CommandBase
|
||||||
SoulNetworkHandler.syphonFromNetwork(owner, SoulNetworkHandler.getCurrentEssence(owner));
|
SoulNetworkHandler.syphonFromNetwork(owner, SoulNetworkHandler.getCurrentEssence(owner));
|
||||||
func_152373_a(icommandsender, this, "commands.soulnetwork.empty.success", new Object[] {owner});
|
func_152373_a(icommandsender, this, "commands.soulnetwork.empty.success", new Object[] {owner});
|
||||||
}
|
}
|
||||||
|
else if ("get".equalsIgnoreCase(astring[1]))
|
||||||
|
{
|
||||||
|
int amount = SoulNetworkHandler.getCurrentEssence(owner);
|
||||||
|
func_152373_a(icommandsender, this, "commands.soulnetwork.get.success", new Object[] {amount, owner});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new CommandException("commands.soulnetwork.notACommand", new Object[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (astring.length == 0)
|
else if (astring.length == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue