diff --git a/MCGalaxy/Levels/LevelEnv.cs b/MCGalaxy/Levels/LevelEnv.cs index 51eaa658c..de182bb05 100644 --- a/MCGalaxy/Levels/LevelEnv.cs +++ b/MCGalaxy/Levels/LevelEnv.cs @@ -47,7 +47,7 @@ namespace MCGalaxy { } string type = value == 0 ? "%SSun" : (value == 1 ? "&1Rain" : "&fSnow"); Player.Message(p, "Set weather for {0} %Sto {1} ({2}%S)", area, value, type); - } + } target = value; } @@ -76,7 +76,7 @@ namespace MCGalaxy { target = (short)defValue; } else { int value = 0; - if (!CommandParser.GetInt(p, input, variable, ref value, + if (!CommandParser.GetInt(p, input, variable, ref value, short.MinValue, short.MaxValue)) return; target = (short)value; @@ -139,6 +139,10 @@ namespace MCGalaxy { internal static void UpdateAppearance(Predicate selector, EnvProp prop, int value) { Player[] players = PlayerInfo.Online.Items; + if (prop == EnvProp.SidesBlock || prop == EnvProp.EdgeBlock) { + value = (byte)value; + } + foreach (Player pl in players) { if (!selector(pl)) continue; diff --git a/MCGalaxy/Player/Player.Handlers.cs b/MCGalaxy/Player/Player.Handlers.cs index a7dd9edd0..6773940bf 100644 --- a/MCGalaxy/Player/Player.Handlers.cs +++ b/MCGalaxy/Player/Player.Handlers.cs @@ -381,17 +381,18 @@ namespace MCGalaxy { for (EnvProp i = 0; i < EnvProp.Max; i++) { int value = level.Config.GetEnvProp(i); - if (i == EnvProp.SidesBlock || i == EnvProp.EdgeBlock) { + if (i == EnvProp.SidesBlock || i == EnvProp.EdgeBlock) { if (zone != null && zone.Config.GetEnvProp(i) != Block.Invalid) { value = zone.Config.GetEnvProp(i); } + value = (byte)value; if (!hasBlockDefs) value = level.RawFallback((byte)value); } else { if (zone != null && zone.Config.GetEnvProp(i) != -1) { value = zone.Config.GetEnvProp(i); } } - if (Supports(CpeExt.EnvMapAspect)) Send(Packet.EnvMapProperty(i, value)); + if (Supports(CpeExt.EnvMapAspect)) Send(Packet.EnvMapProperty(i, value)); } if (Supports(CpeExt.EnvWeatherType)) {