mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Implement command completion suggestions.
This commit is contained in:
parent
5d2589b10f
commit
84cf749344
115 changed files with 4684 additions and 2695 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MinecraftClient.Protocol.Handlers;
|
||||
using MinecraftClient.Protocol.Message;
|
||||
|
||||
namespace MinecraftClient.Inventory
|
||||
{
|
||||
|
|
@ -158,7 +159,7 @@ namespace MinecraftClient.Inventory
|
|||
|
||||
public static string GetEnchantmentName(Enchantment enchantment)
|
||||
{
|
||||
string? trans = Protocol.ChatParser.TranslateString("enchantment.minecraft." + enchantment.ToString().ToUnderscoreCase());
|
||||
string? trans = ChatParser.TranslateString("enchantment.minecraft." + enchantment.ToString().ToUnderscoreCase());
|
||||
if (string.IsNullOrEmpty(trans))
|
||||
return "Unknown Enchantment with ID: " + ((short)enchantment) + " (Probably not named in the code yet)";
|
||||
else
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using MinecraftClient.Protocol.Message;
|
||||
|
||||
namespace MinecraftClient.Inventory
|
||||
{
|
||||
|
|
@ -64,7 +65,7 @@ namespace MinecraftClient.Inventory
|
|||
{
|
||||
string? displayName = displayProperties["Name"] as string;
|
||||
if (!String.IsNullOrEmpty(displayName))
|
||||
return MinecraftClient.Protocol.ChatParser.ParseText(displayProperties["Name"].ToString() ?? string.Empty);
|
||||
return ChatParser.ParseText(displayProperties["Name"].ToString() ?? string.Empty);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
@ -85,7 +86,7 @@ namespace MinecraftClient.Inventory
|
|||
{
|
||||
object[] displayName = (object[])displayProperties["Lore"];
|
||||
lores.AddRange(from string st in displayName
|
||||
let str = MinecraftClient.Protocol.ChatParser.ParseText(st.ToString())
|
||||
let str = ChatParser.ParseText(st.ToString())
|
||||
select str);
|
||||
return lores.ToArray();
|
||||
}
|
||||
|
|
@ -117,10 +118,10 @@ namespace MinecraftClient.Inventory
|
|||
{
|
||||
string type_str = type.ToString();
|
||||
string type_renamed = type_str.ToUnderscoreCase();
|
||||
string? res1 = Protocol.ChatParser.TranslateString("item.minecraft." + type_renamed);
|
||||
string? res1 = ChatParser.TranslateString("item.minecraft." + type_renamed);
|
||||
if (!string.IsNullOrEmpty(res1))
|
||||
return res1;
|
||||
string? res2 = Protocol.ChatParser.TranslateString("block.minecraft." + type_renamed);
|
||||
string? res2 = ChatParser.TranslateString("block.minecraft." + type_renamed);
|
||||
if (!string.IsNullOrEmpty(res2))
|
||||
return res2;
|
||||
return type_str;
|
||||
|
|
@ -145,8 +146,8 @@ namespace MinecraftClient.Inventory
|
|||
short level = (short)enchantment["lvl"];
|
||||
string id = ((string)enchantment["id"]).Replace(':', '.');
|
||||
sb.AppendFormat(" | {0} {1}",
|
||||
Protocol.ChatParser.TranslateString("enchantment." + id) ?? id,
|
||||
Protocol.ChatParser.TranslateString("enchantment.level." + level) ?? level.ToString());
|
||||
ChatParser.TranslateString("enchantment." + id) ?? id,
|
||||
ChatParser.TranslateString("enchantment.level." + level) ?? level.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MinecraftClient.Scripting;
|
||||
|
||||
namespace MinecraftClient.Inventory
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
namespace MinecraftClient.Mapping
|
||||
namespace MinecraftClient.Inventory
|
||||
{
|
||||
/// <summary>
|
||||
/// Properties of a villager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue