diff --git a/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs b/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs
index 64b1d7485..dc7ab306a 100644
--- a/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs
+++ b/ClassicalSharp/2D/Screens/Menu/HacksSettingsScreen.cs
@@ -86,9 +86,10 @@ namespace ClassicalSharp.Gui.Screens {
static string GetJump(Game g) { return g.LocalPlayer.JumpHeight.ToString("F3"); }
static void SetJump(Game g, string v) {
- g.LocalPlayer.physics.CalculateJumpVelocity(true, Utils.ParseDecimal(v));
- float jumpVel = g.LocalPlayer.physics.jumpVel;
- Options.Set(OptionsKey.JumpVelocity, jumpVel.ToString());
+ PhysicsComponent physics = g.LocalPlayer.physics;
+ physics.CalculateJumpVelocity(Utils.ParseDecimal(v));
+ physics.userJumpVel = physics.jumpVel;
+ Options.Set(OptionsKey.JumpVelocity, physics.jumpVel.ToString());
}
static string GetWOMHacks(Game g) { return GetBool(g.LocalPlayer.Hacks.WOMStyleHacks); }
diff --git a/ClassicalSharp/ClassicalSharp.csproj b/ClassicalSharp/ClassicalSharp.csproj
index 6dc9cf13c..50421ed3c 100644
--- a/ClassicalSharp/ClassicalSharp.csproj
+++ b/ClassicalSharp/ClassicalSharp.csproj
@@ -172,6 +172,7 @@
+
diff --git a/ClassicalSharp/Entities/Components/PhysicsComponent.cs b/ClassicalSharp/Entities/Components/PhysicsComponent.cs
index cd85f4486..bc55aec37 100644
--- a/ClassicalSharp/Entities/Components/PhysicsComponent.cs
+++ b/ClassicalSharp/Entities/Components/PhysicsComponent.cs
@@ -253,7 +253,7 @@ namespace ClassicalSharp.Entities {
/// Calculates the jump velocity required such that when a client presses
/// the jump binding they will be able to jump up to the given height.
- internal void CalculateJumpVelocity(bool userVel, float jumpHeight) {
+ internal void CalculateJumpVelocity(float jumpHeight) {
jumpVel = 0;
if (jumpHeight == 0) return;
@@ -262,7 +262,6 @@ namespace ClassicalSharp.Entities {
if (jumpHeight >= 768) jumpVel = 22.5f;
while (GetMaxHeight(jumpVel) <= jumpHeight) { jumpVel += 0.001f; }
- if (userVel) userJumpVel = jumpVel;
}
public static double GetMaxHeight(float u) {
diff --git a/ClassicalSharp/Map/Formats/MapDat2.Importer.cs b/ClassicalSharp/Map/Formats/MapDat2.Importer.cs
new file mode 100644
index 000000000..380177f72
--- /dev/null
+++ b/ClassicalSharp/Map/Formats/MapDat2.Importer.cs
@@ -0,0 +1,319 @@
+#if FALSEEE
+// Copyright 2014-2017 ClassicalSharp | Licensed under BSD-3
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Compression;
+using System.Net;
+using System.Text;
+using ClassicalSharp.Entities;
+using ClassicalSharp.Network;
+using OpenTK;
+
+namespace ClassicalSharp.Map {
+
+ /// Imports a world from a dat map file (original minecraft classic map)
+ public sealed class MapDat2Importer : IMapFormatImporter {
+
+ const byte TC_NULL = 0x70;
+ const byte TC_REFERENCE = 0x71;
+ const byte TC_CLASSDESC = 0x72;
+ const byte TC_OBJECT = 0x73;
+ const byte TC_STRING = 0x74;
+ const byte TC_ARRAY = 0x75;
+ const byte TC_CLASS = 0x76;
+ const byte TC_BLOCKDATA = 0x77;
+ const byte TC_ENDBLOCKDATA = 0x78;
+ const byte TC_RESET = 0x79;
+ const byte TC_BLOCKDATALONG = 0x7A;
+ const byte TC_EXCEPTION = 0x7B;
+ const byte TC_LONGSTRING = 0x7C;
+ const byte TC_PROXYCLASSDESC = 0x7D;
+ const byte TC_ENUM = 0x7E;
+ const int baseWireHandle = 0x7E0000;
+
+ const byte SC_WRITE_METHOD = 0x01, SC_SERIALIZABLE = 0x02;
+
+ byte ReadUInt8() { return reader.ReadByte(); }
+ short ReadInt16() { return IPAddress.HostToNetworkOrder(reader.ReadInt16()); }
+ ushort ReadUInt16() { return (ushort)IPAddress.HostToNetworkOrder(reader.ReadInt16()); }
+ int ReadInt32() { return IPAddress.HostToNetworkOrder(reader.ReadInt32()); }
+ long ReadInt64() { return IPAddress.HostToNetworkOrder(reader.ReadInt64()); }
+ string ReadUtf8() { return Encoding.UTF8.GetString(reader.ReadBytes(ReadUInt16())); }
+ BinaryReader reader;
+ List