mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Merge from master
This commit is contained in:
commit
afdf2f9e2c
28 changed files with 1453 additions and 1114 deletions
|
|
@ -21,7 +21,9 @@ namespace MinecraftClient.Mapping
|
|||
/// <summary>
|
||||
/// The dimension info of the world
|
||||
/// </summary>
|
||||
private static Dimension dimension = new();
|
||||
private static Dimension curDimension = new Dimension();
|
||||
|
||||
private static Dictionary<string, Dimension>? dimensionList = null;
|
||||
|
||||
/// <summary>
|
||||
/// Chunk data parsing progress
|
||||
|
|
@ -52,24 +54,42 @@ namespace MinecraftClient.Mapping
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set dimension type
|
||||
/// Storage of all dimensional data - 1.19.1 and above
|
||||
/// </summary>
|
||||
/// <param name="registryCodec">Registry Codec nbt data</param>
|
||||
public static void StoreDimensionList(Dictionary<string, object> registryCodec)
|
||||
{
|
||||
dimensionList = new();
|
||||
var dimensionListNbt = (object[])(((Dictionary<string, object>)registryCodec["minecraft:dimension_type"])["value"]);
|
||||
foreach (Dictionary<string, object> dimensionNbt in dimensionListNbt)
|
||||
{
|
||||
string dimensionName = (string)dimensionNbt["name"];
|
||||
Dictionary<string, object> element = (Dictionary<string, object>)dimensionNbt["element"];
|
||||
dimensionList.Add(dimensionName, new Dimension(dimensionName, element));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set current dimension - 1.16 and above
|
||||
/// </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, Dictionary<string, object> nbt)
|
||||
public static void SetDimension(string name)
|
||||
{
|
||||
// will change in 1.19 and above
|
||||
dimension = new Dimension(name, nbt);
|
||||
curDimension = dimensionList![name]; // Should not fail
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get current dimension
|
||||
/// </summary>
|
||||
/// <returns>Current dimension</returns>
|
||||
public static Dimension GetDimension()
|
||||
{
|
||||
return dimension;
|
||||
return curDimension;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue