mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fixed the requested changes for Terrain Movement. Tested and working.
This commit is contained in:
parent
9f197d415e
commit
af6f655d5e
7 changed files with 60 additions and 72 deletions
|
|
@ -18,7 +18,7 @@ namespace MinecraftClient.Commands
|
||||||
|
|
||||||
if (args.Count < 1)
|
if (args.Count < 1)
|
||||||
{
|
{
|
||||||
string desc = GetCmdDescTranslated();
|
string desc = GetCmdDescTranslated();
|
||||||
|
|
||||||
if (handler.GetTerrainEnabled())
|
if (handler.GetTerrainEnabled())
|
||||||
handler.Log.Info(getChunkLoadingStatus(handler.GetWorld()));
|
handler.Log.Info(getChunkLoadingStatus(handler.GetWorld()));
|
||||||
|
|
@ -64,12 +64,10 @@ namespace MinecraftClient.Commands
|
||||||
case "north": direction = Direction.North; break;
|
case "north": direction = Direction.North; break;
|
||||||
case "south": direction = Direction.South; break;
|
case "south": direction = Direction.South; break;
|
||||||
case "center":
|
case "center":
|
||||||
{
|
Location current = handler.GetCurrentLocation();
|
||||||
Location current = handler.GetCurrentLocation();
|
Location currentCenter = new Location(Math.Floor(current.X) + 0.5, current.Y, Math.Floor(current.Z) + 0.5);
|
||||||
Location currentCenter = new Location(Math.Floor(current.X) + 0.5, current.Y, Math.Floor(current.Z) + 0.5);
|
handler.MoveTo(currentCenter, allowDirectTeleport: true);
|
||||||
handler.MoveTo(currentCenter, allowDirectTeleport: true);
|
return Translations.Get("cmd.move.walk", currentCenter, current);
|
||||||
return Translations.Get("cmd.move.walk", currentCenter, current);
|
|
||||||
}
|
|
||||||
case "get": return handler.GetCurrentLocation().ToString();
|
case "get": return handler.GetCurrentLocation().ToString();
|
||||||
default: return Translations.Get("cmd.look.unknown", args[0]);
|
default: return Translations.Get("cmd.look.unknown", args[0]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,17 +20,17 @@ namespace MinecraftClient.Mapping
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether piglins shake and transform to zombified piglins.
|
/// Whether piglins shake and transform to zombified piglins.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool piglinSafe;
|
public readonly bool piglinSafe = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
|
/// When false, compasses spin randomly. When true, nether portals can spawn zombified piglins.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool natural;
|
public readonly bool natural = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// How much light the dimension has.
|
/// How much light the dimension has.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly float ambientLight;
|
public readonly float ambientLight = 0.0f;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -42,35 +42,36 @@ namespace MinecraftClient.Mapping
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A resource location defining what block tag to use for infiniburn.
|
/// A resource location defining what block tag to use for infiniburn.
|
||||||
/// Value: "" or minecraft resource "minecraft:...".
|
/// Value above 1.18.2: "#" or minecraft resource "#minecraft:...".
|
||||||
|
/// Value below 1.18.1: "" or minecraft resource "minecraft:...".
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly string infiniburn;
|
public readonly string infiniburn = "#minecraft:infiniburn_overworld";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether players can charge and use respawn anchors.
|
/// Whether players can charge and use respawn anchors.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool respawnAnchorWorks;
|
public readonly bool respawnAnchorWorks = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the dimension has skylight access or not.
|
/// Whether the dimension has skylight access or not.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool hasSkylight;
|
public readonly bool hasSkylight = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether players can use a bed to sleep.
|
/// Whether players can use a bed to sleep.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool bedWorks;
|
public readonly bool bedWorks = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// unknown
|
/// unknown
|
||||||
/// Values: "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
|
/// Values: "minecraft:overworld", "minecraft:the_nether", "minecraft:the_end" or something else.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly string effects;
|
public readonly string effects = "minecraft:overworld";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether players with the Bad Omen effect can cause a raid.
|
/// Whether players with the Bad Omen effect can cause a raid.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool hasRaids;
|
public readonly bool hasRaids = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minimum Y level.
|
/// The minimum Y level.
|
||||||
|
|
@ -78,7 +79,7 @@ namespace MinecraftClient.Mapping
|
||||||
public readonly int minY = 0;
|
public readonly int minY = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minimum Y level.
|
/// The maximum Y level.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly int maxY = 256;
|
public readonly int maxY = 256;
|
||||||
|
|
||||||
|
|
@ -90,30 +91,36 @@ namespace MinecraftClient.Mapping
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum height to which chorus fruits and nether portals can bring players within this dimension.
|
/// The maximum height to which chorus fruits and nether portals can bring players within this dimension.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly int logicalHeight;
|
public readonly int logicalHeight = 256;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The multiplier applied to coordinates when traveling to the dimension.
|
/// The multiplier applied to coordinates when traveling to the dimension.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly double coordinateScale;
|
public readonly double coordinateScale = 1.0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
|
/// Whether the dimensions behaves like the nether (water evaporates and sponges dry) or not. Also causes lava to spread thinner.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool ultrawarm;
|
public readonly bool ultrawarm = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
|
/// Whether the dimension has a bedrock ceiling or not. When true, causes lava to spread faster.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly bool hasCeiling;
|
public readonly bool hasCeiling = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default value used in version below 1.17
|
||||||
|
/// </summary>
|
||||||
|
public Dimension()
|
||||||
|
{
|
||||||
|
this.Name = "minecraft:overworld";
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create from the "Dimension Codec" NBT Tag Compound
|
/// Create from the "Dimension Codec" NBT Tag Compound
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="chunkX">ChunkColumn X</param>
|
/// <param name="name">Dimension name</param>
|
||||||
/// <param name="chunkY">ChunkColumn Y</param>
|
/// <param name="nbt">The dimension type (NBT Tag Compound)</param>
|
||||||
/// <returns>chunk at the given location</returns>
|
|
||||||
public Dimension(string name, Dictionary<string, object> nbt)
|
public Dimension(string name, Dictionary<string, object> nbt)
|
||||||
{
|
{
|
||||||
if (name == null)
|
if (name == null)
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace MinecraftClient.Mapping
|
||||||
/// The X Coordinate
|
/// The X Coordinate
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double X;
|
public double X;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Y Coordinate (vertical)
|
/// The Y Coordinate (vertical)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -25,11 +25,6 @@ namespace MinecraftClient.Mapping
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double Z;
|
public double Z;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Current world: to get the lowest Y coordinate
|
|
||||||
/// </summary>
|
|
||||||
public static World world;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get location with zeroed coordinates
|
/// Get location with zeroed coordinates
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -84,10 +79,7 @@ namespace MinecraftClient.Mapping
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (world.GetDimension() == null)
|
return (int)Math.Floor((Y - World.GetDimension().minY) / Chunk.SizeY);
|
||||||
return (int)Math.Floor(Y / Chunk.SizeY); // below 1.16.2, Y coordinate always start from zero
|
|
||||||
else
|
|
||||||
return (int)Math.Floor((Y - world.GetDimension().minY) / Chunk.SizeY);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,7 @@ namespace MinecraftClient.Mapping
|
||||||
}
|
}
|
||||||
if (!IsOnGround(world, location) && !IsSwimming(world, location))
|
if (!IsOnGround(world, location) && !IsSwimming(world, location))
|
||||||
{
|
{
|
||||||
while (!IsOnGround(world, belowFoots) &&
|
while (!IsOnGround(world, belowFoots) && belowFoots.Y >= 1 + World.GetDimension().minY)
|
||||||
belowFoots.Y >= 1 + (world.GetDimension() == null ? 0 : world.GetDimension().minY))
|
|
||||||
belowFoots = Move(belowFoots, Direction.Down);
|
belowFoots = Move(belowFoots, Direction.Down);
|
||||||
location = Move2Steps(location, belowFoots, ref motionY, true).Dequeue();
|
location = Move2Steps(location, belowFoots, ref motionY, true).Dequeue();
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +61,7 @@ namespace MinecraftClient.Mapping
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach (Direction dir in new []{ Direction.East, Direction.West, Direction.North, Direction.South })
|
foreach (Direction dir in new[] { Direction.East, Direction.West, Direction.North, Direction.South })
|
||||||
if (CanMove(world, location, dir) && IsOnGround(world, Move(location, dir)) && (allowUnsafe || IsSafe(world, Move(location, dir))))
|
if (CanMove(world, location, dir) && IsOnGround(world, Move(location, dir)) && (allowUnsafe || IsSafe(world, Move(location, dir))))
|
||||||
availableMoves.Add(Move(location, dir));
|
availableMoves.Add(Move(location, dir));
|
||||||
availableMoves.Add(Move(location, Direction.Down));
|
availableMoves.Add(Move(location, Direction.Down));
|
||||||
|
|
@ -168,7 +167,7 @@ namespace MinecraftClient.Mapping
|
||||||
|
|
||||||
if (minOffset > maxOffset)
|
if (minOffset > maxOffset)
|
||||||
throw new ArgumentException("minOffset must be lower or equal to maxOffset", "minOffset");
|
throw new ArgumentException("minOffset must be lower or equal to maxOffset", "minOffset");
|
||||||
|
|
||||||
// We always use distance squared so our limits must also be squared.
|
// We always use distance squared so our limits must also be squared.
|
||||||
minOffset *= minOffset;
|
minOffset *= minOffset;
|
||||||
maxOffset *= maxOffset;
|
maxOffset *= maxOffset;
|
||||||
|
|
@ -193,8 +192,8 @@ namespace MinecraftClient.Mapping
|
||||||
: new KeyValuePair<Location, int>(location, int.MaxValue))
|
: new KeyValuePair<Location, int>(location, int.MaxValue))
|
||||||
.OrderBy(pair => pair.Value).
|
.OrderBy(pair => pair.Value).
|
||||||
// Sort for h-score (f-score - g-score) to get smallest distance to goal if f-scores are equal
|
// Sort for h-score (f-score - g-score) to get smallest distance to goal if f-scores are equal
|
||||||
ThenBy(pair => f_score[pair.Key]-g_score[pair.Key]).First().Key;
|
ThenBy(pair => f_score[pair.Key] - g_score[pair.Key]).First().Key;
|
||||||
|
|
||||||
// Only assert a value if it is of actual use later
|
// Only assert a value if it is of actual use later
|
||||||
if (maxOffset > 0 && ClosedSet.Count > 0)
|
if (maxOffset > 0 && ClosedSet.Count > 0)
|
||||||
// Get the block that currently is closest to the goal
|
// Get the block that currently is closest to the goal
|
||||||
|
|
@ -229,7 +228,7 @@ namespace MinecraftClient.Mapping
|
||||||
}
|
}
|
||||||
|
|
||||||
// Goal could not be reached. Set the path to the closest location if close enough
|
// Goal could not be reached. Set the path to the closest location if close enough
|
||||||
if (maxOffset == int.MaxValue || goal.DistanceSquared(closestGoal) <= maxOffset)
|
if (maxOffset == int.MaxValue || goal.DistanceSquared(closestGoal) <= maxOffset)
|
||||||
return ReconstructPath(Came_From, closestGoal);
|
return ReconstructPath(Came_From, closestGoal);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -290,7 +289,7 @@ namespace MinecraftClient.Mapping
|
||||||
public static bool IsSafe(World world, Location location)
|
public static bool IsSafe(World world, Location location)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
//No block that can harm the player
|
//No block that can harm the player
|
||||||
!world.GetBlock(location).Type.CanHarmPlayers()
|
!world.GetBlock(location).Type.CanHarmPlayers()
|
||||||
&& !world.GetBlock(Move(location, Direction.Up)).Type.CanHarmPlayers()
|
&& !world.GetBlock(Move(location, Direction.Up)).Type.CanHarmPlayers()
|
||||||
&& !world.GetBlock(Move(location, Direction.Down)).Type.CanHarmPlayers()
|
&& !world.GetBlock(Move(location, Direction.Down)).Type.CanHarmPlayers()
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace MinecraftClient.Mapping
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The dimension info of the world
|
/// The dimension info of the world
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private Dimension dimension;
|
private static Dimension dimension = new Dimension();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Lock for thread safety
|
/// Lock for thread safety
|
||||||
|
|
@ -29,8 +29,8 @@ namespace MinecraftClient.Mapping
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Chunk data parsing progress
|
/// Chunk data parsing progress
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint chunkCnt = 0;
|
public int chunkCnt = 0;
|
||||||
public uint chunkLoadNotCompleted = 0;
|
public int chunkLoadNotCompleted = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Read, set or unload the specified chunk column
|
/// Read, set or unload the specified chunk column
|
||||||
|
|
@ -89,28 +89,24 @@ namespace MinecraftClient.Mapping
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public World()
|
|
||||||
{
|
|
||||||
Location.world = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set dimension type
|
/// Set dimension type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name"> The name of the dimension type</param>
|
/// <param name="name"> The name of the dimension type</param>
|
||||||
/// <param name="nbt">The dimension type (NBT Tag Compound)</param>
|
/// <param name="nbt">The dimension type (NBT Tag Compound)</param>
|
||||||
public void SetDimension(string name, Dictionary<string, object> nbt)
|
public static void SetDimension(string name, Dictionary<string, object> nbt)
|
||||||
{
|
{
|
||||||
this.dimension = new Dimension(name, nbt);
|
// will change in 1.19 and above
|
||||||
|
dimension = new Dimension(name, nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get dimension type
|
/// Get current dimension
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The chunk column</returns>
|
/// <returns>Current dimension</returns>
|
||||||
public Dimension GetDimension()
|
public static Dimension GetDimension()
|
||||||
{
|
{
|
||||||
return this.dimension;
|
return dimension;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -211,7 +207,6 @@ namespace MinecraftClient.Mapping
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
chunks = new Dictionary<int, Dictionary<int, ChunkColumn>>();
|
chunks = new Dictionary<int, Dictionary<int, ChunkColumn>>();
|
||||||
dimension = null;
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
currentDimensionName = dataTypes.ReadNextString(packetData); // Dimension Name (World Name) - 1.16 and above
|
currentDimensionName = dataTypes.ReadNextString(packetData); // Dimension Name (World Name) - 1.16 and above
|
||||||
|
|
||||||
if (protocolversion >= MC1162Version)
|
if (protocolversion >= MC1162Version)
|
||||||
handler.GetWorld().SetDimension(currentDimensionName, currentDimensionType);
|
World.SetDimension(currentDimensionName, currentDimensionType);
|
||||||
|
|
||||||
if (protocolversion >= MC115Version)
|
if (protocolversion >= MC115Version)
|
||||||
dataTypes.ReadNextLong(packetData); // Hashed world seed - 1.15 and above
|
dataTypes.ReadNextLong(packetData); // Hashed world seed - 1.15 and above
|
||||||
|
|
@ -391,10 +391,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
dimensionNameInRespawn = dataTypes.ReadNextString(packetData); // Dimension Name (World Name) - 1.16 and above
|
dimensionNameInRespawn = dataTypes.ReadNextString(packetData); // Dimension Name (World Name) - 1.16 and above
|
||||||
|
|
||||||
if (protocolversion >= MC1162Version)
|
if (protocolversion >= MC1162Version)
|
||||||
new Task(() =>
|
World.SetDimension(dimensionNameInRespawn, dimensionTypeInRespawn);
|
||||||
{
|
|
||||||
handler.GetWorld().SetDimension(dimensionNameInRespawn, dimensionTypeInRespawn);
|
|
||||||
}).Start();
|
|
||||||
|
|
||||||
if (protocolversion < MC114Version)
|
if (protocolversion < MC114Version)
|
||||||
dataTypes.ReadNextByte(packetData); // Difficulty - 1.13 and below
|
dataTypes.ReadNextByte(packetData); // Difficulty - 1.13 and below
|
||||||
|
|
@ -470,12 +467,13 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
}
|
}
|
||||||
|
|
||||||
int dataSize = dataTypes.ReadNextVarInt(packetData); // Size
|
int dataSize = dataTypes.ReadNextVarInt(packetData); // Size
|
||||||
|
|
||||||
|
Interlocked.Increment(ref handler.GetWorld().chunkCnt);
|
||||||
|
Interlocked.Increment(ref handler.GetWorld().chunkLoadNotCompleted);
|
||||||
new Task(() =>
|
new Task(() =>
|
||||||
{
|
{
|
||||||
handler.GetWorld().chunkCnt++;
|
|
||||||
handler.GetWorld().chunkLoadNotCompleted++;
|
|
||||||
pTerrain.ProcessChunkColumnData(chunkX, chunkZ, verticalStripBitmask, packetData);
|
pTerrain.ProcessChunkColumnData(chunkX, chunkZ, verticalStripBitmask, packetData);
|
||||||
handler.GetWorld().chunkLoadNotCompleted--;
|
Interlocked.Decrement(ref handler.GetWorld().chunkLoadNotCompleted);
|
||||||
}).Start();
|
}).Start();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -752,7 +750,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
int chunkZ = dataTypes.ReadNextInt(packetData);
|
int chunkZ = dataTypes.ReadNextInt(packetData);
|
||||||
|
|
||||||
if (handler.GetWorld()[chunkX, chunkZ] != null)
|
if (handler.GetWorld()[chunkX, chunkZ] != null)
|
||||||
handler.GetWorld().chunkCnt--;
|
Interlocked.Decrement(ref handler.GetWorld().chunkCnt);
|
||||||
|
// Warning: It is legal to include unloaded chunks in the UnloadChunk packet. Since chunks that have not been loaded are not recorded, this may result in loading chunks that should be unloaded and inaccurate statistics.
|
||||||
|
|
||||||
handler.GetWorld()[chunkX, chunkZ] = null;
|
handler.GetWorld()[chunkX, chunkZ] = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,10 +147,8 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
public void ProcessChunkColumnData(int chunkX, int chunkZ, ulong[] verticalStripBitmask, Queue<byte> cache)
|
public void ProcessChunkColumnData(int chunkX, int chunkZ, ulong[] verticalStripBitmask, Queue<byte> cache)
|
||||||
{
|
{
|
||||||
var world = handler.GetWorld();
|
var world = handler.GetWorld();
|
||||||
if (world.GetDimension() == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
int chunkColumnSize = (world.GetDimension().height + 15) / 16;
|
int chunkColumnSize = (World.GetDimension().height + 15) / 16; // Round up
|
||||||
|
|
||||||
if (protocolversion >= Protocol18Handler.MC117Version)
|
if (protocolversion >= Protocol18Handler.MC117Version)
|
||||||
{
|
{
|
||||||
|
|
@ -223,7 +221,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
/// <param name="cache">Cache for reading chunk data</param>
|
/// <param name="cache">Cache for reading chunk data</param>
|
||||||
public void ProcessChunkColumnData(int chunkX, int chunkZ, ushort chunkMask, ushort chunkMask2, bool hasSkyLight, bool chunksContinuous, int currentDimension, Queue<byte> cache)
|
public void ProcessChunkColumnData(int chunkX, int chunkZ, ushort chunkMask, ushort chunkMask2, bool hasSkyLight, bool chunksContinuous, int currentDimension, Queue<byte> cache)
|
||||||
{
|
{
|
||||||
const int chunkColumnSize = 16;
|
const int chunkColumnSize = 16;
|
||||||
if (protocolversion >= Protocol18Handler.MC19Version)
|
if (protocolversion >= Protocol18Handler.MC19Version)
|
||||||
{
|
{
|
||||||
// 1.9 and above chunk format
|
// 1.9 and above chunk format
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue