Terrain support for 1.19.1 / 1.19.2

This commit is contained in:
BruceChen 2022-08-28 23:04:55 +08:00
parent bc5298bf5f
commit c8cecabc5c

View file

@ -97,7 +97,7 @@ namespace MinecraftClient.Protocol.Handlers
this.log = handler.GetLogger(); this.log = handler.GetLogger();
this.randomGen = RandomNumberGenerator.Create(); this.randomGen = RandomNumberGenerator.Create();
if (handler.GetTerrainEnabled() && this.protocolVersion > MC_1_19_Version) if (handler.GetTerrainEnabled() && this.protocolVersion > MC_1_19_2_Version)
{ {
log.Error(Translations.Get("extra.terrainandmovement_disabled")); log.Error(Translations.Get("extra.terrainandmovement_disabled"));
handler.SetTerrainEnabled(false); handler.SetTerrainEnabled(false);
@ -116,14 +116,12 @@ namespace MinecraftClient.Protocol.Handlers
} }
// Block palette // Block palette
if (this.protocolVersion >= MC_1_13_Version) if (protocolVersion > MC_1_19_2_Version && handler.GetTerrainEnabled())
{
if (protocolVersion > MC_1_19_Version && handler.GetTerrainEnabled())
throw new NotImplementedException(Translations.Get("exception.palette.block")); throw new NotImplementedException(Translations.Get("exception.palette.block"));
if (this.protocolVersion == MC_1_19_Version) if (protocolVersion >= MC_1_19_Version)
Block.Palette = new Palette119(); Block.Palette = new Palette119();
else if (this.protocolVersion >= MC_1_17_Version) else if (protocolVersion >= MC_1_17_Version)
Block.Palette = new Palette117(); Block.Palette = new Palette117();
else if (protocolVersion >= MC_1_16_Version) else if (protocolVersion >= MC_1_16_Version)
Block.Palette = new Palette116(); Block.Palette = new Palette116();
@ -131,10 +129,10 @@ namespace MinecraftClient.Protocol.Handlers
Block.Palette = new Palette115(); Block.Palette = new Palette115();
else if (protocolVersion >= MC_1_14_Version) else if (protocolVersion >= MC_1_14_Version)
Block.Palette = new Palette114(); Block.Palette = new Palette114();
else else if(protocolVersion >= MC_1_13_Version)
Block.Palette = new Palette113(); Block.Palette = new Palette113();
} else
else Block.Palette = new Palette112(); Block.Palette = new Palette112();
// Entity palette // Entity palette
if (this.protocolVersion >= MC_1_13_Version) if (this.protocolVersion >= MC_1_13_Version)
@ -362,7 +360,8 @@ namespace MinecraftClient.Protocol.Handlers
} }
// Current dimension // Current dimension
// NBT Tag Compound: 1.16.2 and above // String: 1.19 and above
// NBT Tag Compound: [1.16.2 to 1.18.2]
// String identifier: 1.16 and 1.16.1 // String identifier: 1.16 and 1.16.1
// varInt: [1.9.1 to 1.15.2] // varInt: [1.9.1 to 1.15.2]
// byte: below 1.9.1 // byte: below 1.9.1