MC 1.17/1.18 Terrain/Entity/Inventory (#1943)

Merge branch 'master' of github.com:milutinke/Minecraft-Console-Client into milutinke-master

Manually fix merge conflicts
Additional changes:
 - WindowItems: Fix data type for "elements" below 1.17
 - DestroyEntities: Fix packet palettes and remove DestroyEntity
 - EntityMetadata: Throw exception if health field mapping is not updated

Co-authored-by: Milutinke <bgteam@live.com>
Co-authored-by: BruceChen <MrChen131217@gmail.com>
This commit is contained in:
ORelio 2022-08-19 16:35:55 +02:00
commit 1ce7850193
34 changed files with 5983 additions and 920 deletions

View file

@ -32,7 +32,7 @@ namespace MinecraftClient.Mapping
}
if (!IsOnGround(world, location) && !IsSwimming(world, location))
{
while (!IsOnGround(world, belowFoots) && belowFoots.Y >= 1)
while (!IsOnGround(world, belowFoots) && belowFoots.Y >= 1 + World.GetDimension().minY)
belowFoots = Move(belowFoots, Direction.Down);
location = Move2Steps(location, belowFoots, ref motionY, true).Dequeue();
}
@ -446,6 +446,9 @@ namespace MinecraftClient.Mapping
/// <returns>True if the specified location is on the ground</returns>
public static bool IsOnGround(World world, Location location)
{
if (world.GetChunkColumn(location) == null || world.GetChunkColumn(location).FullyLoaded == false)
return true; // avoid moving downward in a not loaded chunk
return world.GetBlock(Move(location, Direction.Down)).Type.IsSolid()
&& (location.Y <= Math.Truncate(location.Y) + 0.0001);
}