Add in messages for when a player specified in the command arguments does not exist on the server currently

This commit is contained in:
pahimar 2015-02-07 17:22:25 -05:00
parent 08553d57a8
commit 100d2e7208
2 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,7 @@ import com.pahimar.ee3.reference.Names;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;
import net.minecraft.entity.player.EntityPlayer;
import java.util.List;
@ -42,6 +43,10 @@ public class CommandPlayerForgetEverything extends CommandBase
TransmutationKnowledgeRegistry.getInstance().makePlayerForgetEverything(entityPlayer);
func_152373_a(commandSender, this, Messages.Commands.PLAYER_FORGET_EVERYTHING_SUCCESS, new Object[]{commandSender.getCommandSenderName(), entityPlayer.getCommandSenderName()});
}
else
{
throw new WrongUsageException(Messages.Commands.PLAYER_NOT_FOUND_ERROR);
}
}
}

View file

@ -6,6 +6,7 @@ import com.pahimar.ee3.reference.Names;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;
import net.minecraft.entity.player.EntityPlayer;
import java.util.List;
@ -42,6 +43,10 @@ public class CommandPlayerLearnEverything extends CommandBase
TransmutationKnowledgeRegistry.getInstance().teachPlayerEverything(entityPlayer);
func_152373_a(commandSender, this, Messages.Commands.PLAYER_LEARN_EVERYTHING_SUCCESS, new Object[]{commandSender.getCommandSenderName(), entityPlayer.getCommandSenderName()});
}
else
{
throw new WrongUsageException(Messages.Commands.PLAYER_NOT_FOUND_ERROR);
}
}
}