Minecraft-Console-Client/MinecraftClient/Commands/Useblock.cs
ReinforceZwei 2017d5d652
Add support of language files (#1273)
* 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
2020-10-17 13:41:31 +02:00

33 lines
1.2 KiB
C#

using MinecraftClient.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.Commands
{
class Useblock : Command
{
public override string CmdName { get { return "useblock"; } }
public override string CmdUsage { get { return "useblock <x> <y> <z>"; } }
public override string CmdDesc { get { return "cmd.useblock.desc"; } }
public override string Run(McClient handler, string command, Dictionary<string, object> localVars)
{
if (!handler.GetTerrainEnabled()) return Translations.Get("extra.terrainandmovement_required");
if (hasArg(command))
{
string[] args = getArgs(command);
if (args.Length >= 3)
{
int x = Convert.ToInt32(args[0]);
int y = Convert.ToInt32(args[1]);
int z = Convert.ToInt32(args[2]);
handler.PlaceBlock(new Location(x, y, z), Direction.Down);
}
else { return GetCmdDescTranslated(); }
}
return GetCmdDescTranslated();
}
}
}