mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
Formatted the code and removed logs from Auto Attack
This commit is contained in:
parent
a4ff7ae438
commit
c6ca3dc13d
117 changed files with 602 additions and 585 deletions
|
|
@ -19,7 +19,7 @@ namespace MinecraftClient.Mapping
|
|||
/// <summary>
|
||||
/// The dimension info of the world
|
||||
/// </summary>
|
||||
private static Dimension curDimension= new();
|
||||
private static Dimension curDimension = new();
|
||||
|
||||
private static readonly Dictionary<string, Dimension> dimensionList = new();
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ namespace MinecraftClient.Mapping
|
|||
public static void LoadDefaultDimensions1206Plus()
|
||||
{
|
||||
// TODO: Move this to a JSON file.
|
||||
|
||||
|
||||
var defaultRegistryCodec = new Dictionary<string, object>
|
||||
{
|
||||
{ "minecraft:dimension_type", new Dictionary<string, object>
|
||||
|
|
@ -314,29 +314,29 @@ namespace MinecraftClient.Mapping
|
|||
/// </summary>
|
||||
/// <param name="name"> The name of the dimension type</param>
|
||||
/// <param name="nbt">The dimension type (NBT Tag Compound)</param>
|
||||
public static void SetDimension(string name)
|
||||
{
|
||||
// Try to get the dimension using the name as is
|
||||
if (dimensionList.TryGetValue(name, out Dimension? dimension))
|
||||
{
|
||||
curDimension = dimension;
|
||||
return; // Dimension found
|
||||
}
|
||||
public static void SetDimension(string name)
|
||||
{
|
||||
// Try to get the dimension using the name as is
|
||||
if (dimensionList.TryGetValue(name, out Dimension? dimension))
|
||||
{
|
||||
curDimension = dimension;
|
||||
return; // Dimension found
|
||||
}
|
||||
|
||||
// If not found, check if name lacks 'minecraft:' prefix and try again
|
||||
if (!name.StartsWith("minecraft:"))
|
||||
{
|
||||
string prefixedName = "minecraft:" + name;
|
||||
if (dimensionList.TryGetValue(prefixedName, out dimension))
|
||||
{
|
||||
curDimension = dimension;
|
||||
return; // Dimension found with prefixed name
|
||||
}
|
||||
}
|
||||
// If not found, check if name lacks 'minecraft:' prefix and try again
|
||||
if (!name.StartsWith("minecraft:"))
|
||||
{
|
||||
string prefixedName = "minecraft:" + name;
|
||||
if (dimensionList.TryGetValue(prefixedName, out dimension))
|
||||
{
|
||||
curDimension = dimension;
|
||||
return; // Dimension found with prefixed name
|
||||
}
|
||||
}
|
||||
|
||||
// If still not found, dimension does not exist
|
||||
throw new KeyNotFoundException($"Dimension '{name}' not found in dimensions dictionary.");
|
||||
}
|
||||
// If still not found, dimension does not exist
|
||||
throw new KeyNotFoundException($"Dimension '{name}' not found in dimensions dictionary.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue