Skip to content

Commit

Permalink
Merge pull request Flare-Client#79 from Flare-Client/Improved-SDK
Browse files Browse the repository at this point in the history
Improved sdk
  • Loading branch information
EchoHackCmd authored Mar 13, 2020
2 parents 4b85f5d + cbad8c2 commit d3b2992
Show file tree
Hide file tree
Showing 84 changed files with 1,616 additions and 281 deletions.
4 changes: 2 additions & 2 deletions Flare Sharp/ClientBase/IO/FileMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Flare_Sharp.ClientBase.Modules;
using Flare_Sharp.ClientBase.Modules.Settings;
using Flare_Sharp.ClientBase.UI.VObjs;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -63,7 +63,7 @@ public void saveConfig()
z++;
}
}
foreach(string targetable in EntityList.targetable)
foreach(string targetable in VTargetsWindow.targetable)
{
root.targets.Add(targetable);
}
Expand Down
2 changes: 1 addition & 1 deletion Flare Sharp/ClientBase/Keybinds/KeybindHandler.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Modules;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using Flare_Sharp.UI;
using System;
using System.Collections.Generic;
Expand Down
3 changes: 1 addition & 2 deletions Flare Sharp/ClientBase/Modules/ModuleHandler.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Keybinds;
using Flare_Sharp.ClientBase.Modules.Modules;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -110,7 +110,6 @@ public void tickModuleThread()
}
}
}
new SDK();
}
public void startModuleThread()
{
Expand Down
23 changes: 12 additions & 11 deletions Flare Sharp/ClientBase/Modules/Modules/Aimbot.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -19,28 +20,28 @@ public Aimbot() : base("Aimbot", CategoryHandler.registry.categories[0], (char)0
public override void onTick()
{
base.onTick();
List<Entity> Entity = EntityList.getEntityList(true);
List<Mob> Entity = Minecraft.clientInstance.localPlayer.entityRegistry.targetableEntities;
List<double> distancesArr = new List<double>();

foreach(Entity e in Entity)
foreach(Mob e in Entity)
{
Double distance = e.distanceTo(SDK.instance.player);
Double distance = e.distanceTo(Minecraft.clientInstance.localPlayer);
if (distance <= sliderSettings[0].value / 10F) distancesArr.Add(distance);
}

if(distancesArr.Count() > 0)
{
distancesArr.Sort();

foreach(Entity e in Entity)
foreach(Mob e in Entity)
{
if(e.distanceTo(SDK.instance.player) == distancesArr[0])
if(e.distanceTo(Minecraft.clientInstance.localPlayer) == distancesArr[0])
{
float[] localPosition = { SDK.instance.player.currentX2, SDK.instance.player.currentY2, SDK.instance.player.currentZ2 };
float[] targetPosition = { e.currentX3, e.currentY3, e.currentZ3 };
List<float> calculationsArr = SDK.instance.getCalculationsToPos(localPosition, targetPosition);
Pointers.mousePitch = calculationsArr[0];
Pointers.mouseYaw = calculationsArr[1];
Utils.Vec3f localPosition = Minecraft.clientInstance.localPlayer.location;
Utils.Vec3f targetPosition = e.location;
Utils.Vec2f calculationsArr = Utils.getCalculationsToPos(localPosition, targetPosition);
Minecraft.clientInstance.localPlayer.level.firstPersonCamera.cameraPitch = calculationsArr.x;
Minecraft.clientInstance.localPlayer.level.firstPersonCamera.cameraYaw = calculationsArr.y;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Flare Sharp/ClientBase/Modules/Modules/AirAcceleration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Keybinds;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -20,7 +20,7 @@ public AirAcceleration() : base("AirAcceleration", CategoryHandler.registry.cate
public override void onTick()
{
base.onTick();
SDK.instance.player.airAcceleration = (float)sliderSettings[0].value / 100;
Minecraft.clientInstance.localPlayer.airAcceleration = (float)sliderSettings[0].value / 100;
}
}
}
4 changes: 2 additions & 2 deletions Flare Sharp/ClientBase/Modules/Modules/AirJump.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Keybinds;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -19,7 +19,7 @@ public AirJump() : base("AirJump", CategoryHandler.registry.categories[1], (char
public override void onTick()
{
base.onTick();
SDK.instance.player.onGround = 1;
Minecraft.clientInstance.localPlayer.onGround = 1;
}
}
}
6 changes: 3 additions & 3 deletions Flare Sharp/ClientBase/Modules/Modules/AntiSentinel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -21,9 +21,9 @@ public AntiSentinel():base("AntiSentinel", CategoryHandler.registry.categories[3
public override void onTick()
{
base.onTick();
if(SDK.instance.player.onGround_type2 < 1)
if(Minecraft.clientInstance.localPlayer.onGround_type2 < 1)
{
SDK.instance.player.teleport(SDK.instance.player.X1, SDK.instance.player.Y1 + fall, SDK.instance.player.Z1);
Minecraft.clientInstance.localPlayer.teleport(Minecraft.clientInstance.localPlayer.X1, Minecraft.clientInstance.localPlayer.Y1 + fall, Minecraft.clientInstance.localPlayer.Z1);
}
if (fall > 0)
{
Expand Down
17 changes: 12 additions & 5 deletions Flare Sharp/ClientBase/Modules/Modules/AutoRespawn.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -12,27 +12,34 @@ namespace Flare_Sharp.ClientBase.Modules.Modules
public class AutoRespawn : Module
{

public static byte savedImmediateSpawnGameRule;
public static bool savedImmediateSpawnGameRule;
public AutoRespawn() : base("AutoRespawn", CategoryHandler.registry.categories[2], (char)0x07, false)
{
}

public override void onEnable()
{
base.onEnable();
savedImmediateSpawnGameRule = Pointers.doImmediateRespawnGamerule;
List<Gamerule> gamerules = Minecraft.clientInstance.localPlayer.level.gamerules;
int i = 0;
foreach(Gamerule rule in gamerules)
{
Console.WriteLine(rule.name + "," + i.ToString());
i++;
}
savedImmediateSpawnGameRule = Minecraft.clientInstance.localPlayer.level.gamerules[23].toggle;
}

public override void onTick()
{
base.onTick();
Pointers.doImmediateRespawnGamerule = 1;
Minecraft.clientInstance.localPlayer.level.gamerules[23].toggle = true;
}

public override void onDisable()
{
base.onDisable();
Pointers.doImmediateRespawnGamerule = savedImmediateSpawnGameRule;
Minecraft.clientInstance.localPlayer.level.gamerules[23].toggle = savedImmediateSpawnGameRule;
}
}
}
6 changes: 3 additions & 3 deletions Flare Sharp/ClientBase/Modules/Modules/AutoSprint.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -19,13 +19,13 @@ public override void onEnable()
{
base.onEnable();
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x90 };
MCM.writeBaseBytes(Pointers.autoSprint, write);
MCM.writeBaseBytes(Statics.autoSprint, write);
}
public override void onDisable()
{
base.onDisable();
byte[] write = { 0x44,0x0F,0x2F,0x66,0x0C };
MCM.writeBaseBytes(Pointers.autoSprint, write);
MCM.writeBaseBytes(Statics.autoSprint, write);
}
}
}
16 changes: 8 additions & 8 deletions Flare Sharp/ClientBase/Modules/Modules/AutoSword.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -23,29 +23,29 @@ public override void onTick()
{
base.onTick();

List<PlayerEntity> Entity = EntityList.getPlayerList();
List<Mob> Entity = Minecraft.clientInstance.localPlayer.entityRegistry.targetableEntities;

foreach (PlayerEntity e in Entity)
foreach (Mob e in Entity)
{
double distance = e.distanceTo(SDK.instance.player);
double distance = e.distanceTo(Minecraft.clientInstance.localPlayer);

if (distance <= (float)sliderSettings[0].value / 10F)
{
autoSwordCounter += 1;

int heldItemID = SDK.instance.player.heldItemID;
int heldItemID = Minecraft.clientInstance.localPlayer.heldItemID;

if (autoSwordCounter > 4)
{
if (heldItemID != 276 && heldItemID != 283 && heldItemID != 267 && heldItemID != 272 && heldItemID != 268)
{
if (Pointers.selectedHotbarSlot < 8)
if (Minecraft.clientInstance.localPlayer.inventoryProxy.selectedHotbarSlot < 8)
{
Pointers.selectedHotbarSlot += 1;
Minecraft.clientInstance.localPlayer.inventoryProxy.selectedHotbarSlot += 1;
}
else
{
Pointers.selectedHotbarSlot = 0;
Minecraft.clientInstance.localPlayer.inventoryProxy.selectedHotbarSlot = 0;
}
}
autoSwordCounter = 0;
Expand Down
12 changes: 6 additions & 6 deletions Flare Sharp/ClientBase/Modules/Modules/BHOP.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Keybinds;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -20,9 +20,9 @@ public BHOP() : base("BHOP", CategoryHandler.registry.categories[1], (char)0x07,
public override void onTick()
{
base.onTick();
float playerYaw = SDK.instance.player.yaw;
float playerYaw = Minecraft.clientInstance.localPlayer.yaw;

if (SDK.instance.player.isInAir > 0) SDK.instance.player.velY = 0.3F;
if (Minecraft.clientInstance.localPlayer.onGround_type2 == 257) Minecraft.clientInstance.localPlayer.velY = 0.3F;

if (KeybindHandler.isKeyDown('W'))
{
Expand Down Expand Up @@ -59,9 +59,9 @@ public override void onTick()
if(KeybindHandler.isKeyDown('W') | KeybindHandler.isKeyDown('A') | KeybindHandler.isKeyDown('D') | KeybindHandler.isKeyDown('S'))
{
float calcYaw = (playerYaw) * ((float)Math.PI / 180F);
float calcPitch = (SDK.instance.player.pitch) * -((float)Math.PI / 180F);
SDK.instance.player.velX = (float)Math.Cos(calcYaw) * sliderSettings[0].value / 10F;
SDK.instance.player.velZ = (float)Math.Sin(calcYaw) * sliderSettings[0].value / 10F;
float calcPitch = (Minecraft.clientInstance.localPlayer.pitch) * -((float)Math.PI / 180F);
Minecraft.clientInstance.localPlayer.velX = (float)Math.Cos(calcYaw) * sliderSettings[0].value / 10F;
Minecraft.clientInstance.localPlayer.velZ = (float)Math.Sin(calcYaw) * sliderSettings[0].value / 10F;
}

}
Expand Down
10 changes: 5 additions & 5 deletions Flare Sharp/ClientBase/Modules/Modules/BoostHit.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Keybinds;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -22,12 +22,12 @@ public void keyHeldEvent(object sender, clientKeyEvent e)
{
if (enabled)
{
UInt64 facingEnt = SDK.instance.entityFacing.addr;
UInt64 facingEnt = Minecraft.clientInstance.localPlayer.level.lookingEntity.addr;
if(facingEnt > 0 && e.key == (char)0x01)
{
List<float> directionalVec = SDK.instance.directionalVector((SDK.instance.player.yaw + 90) * (float)Math.PI / 180, (float)Math.PI / 180);
SDK.instance.player.velX = (float)sliderSettings[0].value / 10F * directionalVec[0];
SDK.instance.player.velZ = (float)sliderSettings[0].value / 10F * directionalVec[2];
Utils.Vec3f directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + 90) * (float)Math.PI / 180, (float)Math.PI / 180);
Minecraft.clientInstance.localPlayer.velX = (float)sliderSettings[0].value / 10F * directionalVec.x;
Minecraft.clientInstance.localPlayer.velZ = (float)sliderSettings[0].value / 10F * directionalVec.z;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Flare Sharp/ClientBase/Modules/Modules/BounceFly.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Keybinds;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -19,7 +19,7 @@ public BounceFly() : base("BounceFly", CategoryHandler.registry.categories[2], (
public override void onTick()
{
base.onTick();
if (SDK.instance.player.velY <= -0.5F) SDK.instance.player.velY = 0.5F;
if (Minecraft.clientInstance.localPlayer.velY <= -0.5F) Minecraft.clientInstance.localPlayer.velY = 0.5F;
}
}
}
6 changes: 3 additions & 3 deletions Flare Sharp/ClientBase/Modules/Modules/ClickTP.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.ClientBase.Keybinds;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -23,9 +23,9 @@ public void DownKeyHeld(object sender, clientKeyEvent e)
{
if(e.key == (char)0x02)
{
if(Pointers.blockPosY > 0)
if(Minecraft.clientInstance.localPlayer.level.lookingBlockY > 0)
{
SDK.instance.player.teleport((float)Pointers.blockPosX, (float)Pointers.blockPosY + 1, (float)Pointers.blockPosZ);
Minecraft.clientInstance.localPlayer.teleport((float)Minecraft.clientInstance.localPlayer.level.lookingBlockX, (float)Minecraft.clientInstance.localPlayer.level.lookingBlockY + 1, (float)Minecraft.clientInstance.localPlayer.level.lookingBlockZ);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Flare Sharp/ClientBase/Modules/Modules/Coordinates.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Flare_Sharp.ClientBase.Categories;
using Flare_Sharp.Memory;
using Flare_Sharp.Memory.CraftSDK;
using Flare_Sharp.Memory.FlameSDK;
using System;
using System.Collections.Generic;
using System.Linq;
Expand All @@ -19,13 +19,13 @@ public override void onEnable()
{
base.onEnable();
byte[] write = { 0x90, 0x90, 0x90, 0x90, 0x74, 0x07 };
MCM.writeBaseBytes(Pointers.showCoordinates, write);
MCM.writeBaseBytes(Statics.showCoordinates, write);
}
public override void onDisable()
{
base.onDisable();
byte[] write = { 0x80, 0x78, 0x04, 0x00, 0x74, 0x07 };
MCM.writeBaseBytes(Pointers.showCoordinates, write);
MCM.writeBaseBytes(Statics.showCoordinates, write);
}
}
}
Loading

0 comments on commit d3b2992

Please sign in to comment.