From 17de69c6714f68bd95e0d37c70a9554afeccc73c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 10 Mar 2018 19:42:17 +1100 Subject: [PATCH] Add rope/lader collide type 7 --- MCGalaxy/Blocks/DefaultSet.cs | 1 + MCGalaxy/Commands/CPE/CmdEnvironment.cs | 8 ++++---- MCGalaxy/Commands/CPE/CustomBlockCommand.cs | 4 ++-- MCGalaxy/Network/Player.Networking.cs | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/MCGalaxy/Blocks/DefaultSet.cs b/MCGalaxy/Blocks/DefaultSet.cs index ed35874eb..39b89af51 100644 --- a/MCGalaxy/Blocks/DefaultSet.cs +++ b/MCGalaxy/Blocks/DefaultSet.cs @@ -225,6 +225,7 @@ namespace MCGalaxy.Blocks { public const byte SlipperyIce = 4; // Solid and fully slidable on. public const byte LiquidWater = 5; // Water style 'swimming'/'bobbing' public const byte LiquidLava = 6; // Lava style 'swimming'/'bobbing' + public const byte ClimbRope = 7; // Rope style 'climbing' public static bool IsSolid(byte collide) { return collide >= Solid && collide <= SlipperyIce; diff --git a/MCGalaxy/Commands/CPE/CmdEnvironment.cs b/MCGalaxy/Commands/CPE/CmdEnvironment.cs index b19b0a617..09a8c1278 100644 --- a/MCGalaxy/Commands/CPE/CmdEnvironment.cs +++ b/MCGalaxy/Commands/CPE/CmdEnvironment.cs @@ -173,11 +173,11 @@ namespace MCGalaxy.Commands.CPE { Predicate selector = pl => pl.level == lvl; LevelConfig cfg = lvl.Config; - cfg.SkyColor = preset.Sky; LevelEnv.UpdateColor(selector, 0, cfg.SkyColor); - cfg.CloudColor = preset.Clouds; LevelEnv.UpdateColor(selector, 1, cfg.CloudColor); - cfg.FogColor = preset.Fog; LevelEnv.UpdateColor(selector, 2, cfg.FogColor); + cfg.SkyColor = preset.Sky; LevelEnv.UpdateColor(selector, 0, cfg.SkyColor); + cfg.CloudColor = preset.Clouds; LevelEnv.UpdateColor(selector, 1, cfg.CloudColor); + cfg.FogColor = preset.Fog; LevelEnv.UpdateColor(selector, 2, cfg.FogColor); cfg.ShadowColor = preset.Shadow; LevelEnv.UpdateColor(selector, 3, cfg.ShadowColor); - cfg.LightColor = preset.Sun; LevelEnv.UpdateColor(selector, 4, cfg.LightColor); + cfg.LightColor = preset.Sun; LevelEnv.UpdateColor(selector, 4, cfg.LightColor); Level.SaveSettings(p.level); return true; diff --git a/MCGalaxy/Commands/CPE/CustomBlockCommand.cs b/MCGalaxy/Commands/CPE/CustomBlockCommand.cs index c0b727aeb..e2411744a 100644 --- a/MCGalaxy/Commands/CPE/CustomBlockCommand.cs +++ b/MCGalaxy/Commands/CPE/CustomBlockCommand.cs @@ -255,7 +255,7 @@ namespace MCGalaxy.Commands.CPE { step++; bd.Shape = bd.MaxY; } else if (step == 9) { - if (CommandParser.GetByte(p, value, "Collide type", ref bd.CollideType, 0, 6)) + if (CommandParser.GetByte(p, value, "Collide type", ref bd.CollideType, 0, 7)) step++; } else if (step == 10) { if (Utils.TryParseDecimal(value, out bd.Speed) && bd.Speed >= 0.25f && bd.Speed <= 3.96f) @@ -671,7 +671,7 @@ namespace MCGalaxy.Commands.CPE { "0 - block is walk-through (e.g. air).", "1 - block is swim-through/climbable (e.g. rope).", "2 - block is solid (e.g. dirt).", "3 - block is solid, but slippery like ice", "4 - block is solid, but even slipperier than ice", "5 - block is swim-through like water", - "6 - block is swim-through like lava" } }, + "6 - block is swim-through like lava", "7 - block is climbable like rope" } }, { "speed", new string[] { "Type a number between '0.25' (25% speed) and '3.96' (396% speed).", "This speed is used when inside or walking on the block. Default speed is 1" } }, diff --git a/MCGalaxy/Network/Player.Networking.cs b/MCGalaxy/Network/Player.Networking.cs index 8e3232a59..53f6b815a 100644 --- a/MCGalaxy/Network/Player.Networking.cs +++ b/MCGalaxy/Network/Player.Networking.cs @@ -270,7 +270,7 @@ namespace MCGalaxy { } else { raw = Block.Convert(block); if (raw >= Block.CpeCount) raw = Block.Orange; - } + } if (raw > MaxRawBlock) raw = level.RawFallback(block); // Custom block replaced a core block