mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
* Basic support of language file Only mapped main part of MCC. * Translations function imporve * Change translation file naming * Fix default translation file naming * Complete translation file mapping for main part Command and ChatBot not done yet * Complete translation mapping for commands Except Entitycmd * Complete translation mapping for ChatBots * Add new method for replacing translation key Just for Entitycmd. Be proud of yourself. We have a convenient method now. * Complete all translation mapping * Add default config and translation file to resource * Remove untranslatable messages from default translation file
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace MinecraftClient.Commands
|
|
{
|
|
class ChangeSlot : Command
|
|
{
|
|
public override string CmdName { get { return "changeslot"; } }
|
|
public override string CmdUsage { get { return "changeslot <1-9>"; } }
|
|
public override string CmdDesc { get { return "cmd.changeSlot.desc"; } }
|
|
|
|
public override string Run(McClient handler, string command, Dictionary<string, object> localVars)
|
|
{
|
|
if (!handler.GetInventoryEnabled())
|
|
return Translations.Get("extra.inventory_required");
|
|
|
|
if (hasArg(command))
|
|
{
|
|
short slot;
|
|
try
|
|
{
|
|
slot = Convert.ToInt16(getArg(command));
|
|
}
|
|
catch (FormatException)
|
|
{
|
|
return Translations.Get("cmd.changeSlot.nan");
|
|
}
|
|
if (slot >= 1 && slot <= 9)
|
|
{
|
|
if (handler.ChangeSlot(slot-=1))
|
|
{
|
|
return Translations.Get("cmd.changeSlot.changed", (slot+=1));
|
|
}
|
|
else
|
|
{
|
|
return Translations.Get("cmd.changeSlot.fail");
|
|
}
|
|
}
|
|
}
|
|
return GetCmdDescTranslated();
|
|
}
|
|
}
|
|
}
|