Finish EnvMapAppearance v3 (now EnvMapAspect to avoid breaking backwards compatibility.)

This commit is contained in:
UnknownShadow200 2016-05-12 17:50:45 +10:00
parent 5498c5e4fa
commit 05a8f5f598
3 changed files with 6 additions and 3 deletions

View File

@ -69,6 +69,7 @@ namespace ClassicalSharp.Network {
"EnvColors", "SelectionCuboid", "BlockPermissions", "ChangeModel", "EnvMapAppearance", "EnvColors", "SelectionCuboid", "BlockPermissions", "ChangeModel", "EnvMapAppearance",
"EnvWeatherType", "HackControl", "MessageTypes", "PlayerClick", "FullCP437", "EnvWeatherType", "HackControl", "MessageTypes", "PlayerClick", "FullCP437",
"LongerMessages", "BlockDefinitions", "BlockDefinitionsExt", "BulkBlockUpdate", "TextColors", "LongerMessages", "BlockDefinitions", "BlockDefinitionsExt", "BulkBlockUpdate", "TextColors",
"EnvMapAspect",
}; };
} }
} }

View File

@ -278,7 +278,7 @@ namespace ClassicalSharp.Network {
} }
internal void HandleEnvSetMapAppearance() { internal void HandleEnvSetMapAppearance() {
HandleSetEnvMapUrl(); HandleSetMapEnvUrl();
game.World.Env.SetSidesBlock( (Block)reader.ReadUInt8() ); game.World.Env.SetSidesBlock( (Block)reader.ReadUInt8() );
game.World.Env.SetEdgeBlock( (Block)reader.ReadUInt8() ); game.World.Env.SetEdgeBlock( (Block)reader.ReadUInt8() );
game.World.Env.SetEdgeLevel( reader.ReadInt16() ); game.World.Env.SetEdgeLevel( reader.ReadInt16() );
@ -362,7 +362,7 @@ namespace ClassicalSharp.Network {
game.Events.RaiseColourCodesChanged(); game.Events.RaiseColourCodesChanged();
} }
internal void HandleSetEnvMapUrl() { internal void HandleSetMapEnvUrl() {
string url = reader.ReadAsciiString(); string url = reader.ReadAsciiString();
if( !game.AllowServerTextures ) return; if( !game.AllowServerTextures ) return;
@ -374,7 +374,7 @@ namespace ClassicalSharp.Network {
Utils.LogDebug( "Image url: " + url ); Utils.LogDebug( "Image url: " + url );
} }
internal void HandleSetEnvMapProperty() { internal void HandleSetMapEnvProperty() {
byte type = reader.ReadUInt8(); byte type = reader.ReadUInt8();
int value = reader.ReadInt32(); int value = reader.ReadInt32();
WorldEnv env = game.World.Env; WorldEnv env = game.World.Env;

View File

@ -202,6 +202,8 @@ namespace ClassicalSharp.Network {
Set( Opcode.CpeDefineBlockExt, HandleDefineBlockExt, 85 ); Set( Opcode.CpeDefineBlockExt, HandleDefineBlockExt, 85 );
Set( Opcode.CpeBulkBlockUpdate, HandleBulkBlockUpdate, 1282 ); Set( Opcode.CpeBulkBlockUpdate, HandleBulkBlockUpdate, 1282 );
Set( Opcode.CpeSetTextColor, HandleSetTextColor, 6 ); Set( Opcode.CpeSetTextColor, HandleSetTextColor, 6 );
Set( Opcode.CpeSetMapEnvUrl, HandleSetMapEnvUrl, 65 );
Set( Opcode.CpeSetMapEnvProperty, HandleSetMapEnvProperty, 6 );
} }
void OnNewMap( object sender, EventArgs e ) { void OnNewMap( object sender, EventArgs e ) {