-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
244 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package net.kore.mixins; | ||
|
||
import net.kore.Kore; | ||
import net.kore.utils.SkyblockUtils; | ||
import net.minecraft.network.play.server.S12PacketEntityVelocity; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import net.minecraft.client.entity.EntityPlayerSP; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.Explosion; | ||
import net.minecraft.util.IThreadListener; | ||
import net.minecraft.network.INetHandler; | ||
import net.minecraft.network.Packet; | ||
import net.minecraft.network.PacketThreadUtil; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import net.minecraft.network.play.server.S27PacketExplosion; | ||
import org.spongepowered.asm.mixin.Final; | ||
import net.minecraft.network.NetworkManager; | ||
import net.minecraft.client.multiplayer.WorldClient; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.network.NetHandlerPlayClient; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
@Mixin(value = { NetHandlerPlayClient.class }, priority = 1) | ||
public abstract class MixinPlayHandler | ||
{ | ||
@Shadow | ||
private Minecraft gameController; | ||
@Shadow | ||
private WorldClient clientWorldController; | ||
@Shadow | ||
private boolean doneLoadingTerrain; | ||
@Shadow | ||
@Final | ||
private NetworkManager netManager; | ||
|
||
@Inject(method = { "handleExplosion" }, at = { @At("HEAD") }, cancellable = true) | ||
private void handleExplosion(final S27PacketExplosion packetIn, final CallbackInfo ci) { | ||
if (Kore.velocity.isToggled()) { | ||
PacketThreadUtil.checkThreadAndEnqueue((Packet)packetIn, (INetHandler)Kore.mc.getNetHandler(), (IThreadListener)this.gameController); | ||
final Explosion explosion = new Explosion((World)this.gameController.theWorld, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); | ||
explosion.doExplosionB(true); | ||
final boolean shouldTakeKB = Kore.velocity.skyblockKB.isEnabled() && (Minecraft.getMinecraft().thePlayer.isInLava() || SkyblockUtils.getDisplayName(Minecraft.getMinecraft().thePlayer.getHeldItem()).contains("Bonzo's Staff") || SkyblockUtils.getDisplayName(Minecraft.getMinecraft().thePlayer.getHeldItem()).contains("Jerry-chine Gun")); | ||
if ((shouldTakeKB || Kore.velocity.hModifier.getValue() != 0.0 || Kore.velocity.vModifier.getValue() != 0.0)) { | ||
final EntityPlayerSP thePlayer = this.gameController.thePlayer; | ||
thePlayer.motionX += packetIn.func_149149_c() * (shouldTakeKB ? 1.0 : Kore.velocity.hModifier.getValue()); | ||
final EntityPlayerSP thePlayer2 = this.gameController.thePlayer; | ||
thePlayer2.motionY += packetIn.func_149144_d() * (shouldTakeKB ? 1.0 : Kore.velocity.vModifier.getValue()); | ||
final EntityPlayerSP thePlayer3 = this.gameController.thePlayer; | ||
thePlayer3.motionZ += packetIn.func_149147_e() * (shouldTakeKB ? 1.0 : Kore.velocity.hModifier.getValue()); | ||
} | ||
ci.cancel(); | ||
} | ||
} | ||
|
||
@Inject(method = { "handleEntityVelocity" }, at = { @At("HEAD") }, cancellable = true) | ||
public void handleEntityVelocity(final S12PacketEntityVelocity packetIn, final CallbackInfo ci) { | ||
if (Kore.velocity.isToggled()) { | ||
PacketThreadUtil.checkThreadAndEnqueue((Packet)packetIn, (INetHandler)Kore.mc.getNetHandler(), (IThreadListener)this.gameController); | ||
final Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityID()); | ||
if (entity != null) { | ||
if (entity.equals((Object)Kore.mc.thePlayer)) { | ||
final boolean shouldTakeKB = Kore.velocity.skyblockKB.isEnabled() && (Minecraft.getMinecraft().thePlayer.isInLava() || SkyblockUtils.getDisplayName(Minecraft.getMinecraft().thePlayer.getHeldItem()).contains("Bonzo's Staff") || SkyblockUtils.getDisplayName(Minecraft.getMinecraft().thePlayer.getHeldItem()).contains("Jerry-chine Gun")); | ||
if ((shouldTakeKB || Kore.velocity.hModifier.getValue() != 0.0 || Kore.velocity.vModifier.getValue() != 0.0)) { | ||
entity.setVelocity(packetIn.getMotionX() * (shouldTakeKB ? 1.0 : Kore.velocity.hModifier.getValue()) / 8000.0, packetIn.getMotionY() * (shouldTakeKB ? 1.0 : Kore.velocity.vModifier.getValue()) / 8000.0, packetIn.getMotionZ() * (shouldTakeKB ? 1.0 : Kore.velocity.hModifier.getValue()) / 8000.0); | ||
} | ||
} | ||
else { | ||
entity.setVelocity(packetIn.getMotionX() / 8000.0, packetIn.getMotionY() / 8000.0, packetIn.getMotionZ() / 8000.0); | ||
} | ||
} | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package net.kore.modules.combat; | ||
|
||
import net.kore.Kore; | ||
import net.kore.events.MotionUpdateEvent; | ||
import net.kore.events.PacketReceivedEvent; | ||
import net.kore.events.PacketSentEvent; | ||
import net.kore.modules.Module; | ||
import net.kore.settings.ModeSetting; | ||
import net.kore.settings.NumberSetting; | ||
import net.kore.utils.MilliTimer; | ||
import net.kore.utils.PacketUtils; | ||
import net.minecraft.network.play.client.C09PacketHeldItemChange; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.network.play.client.C0BPacketEntityAction; | ||
import net.minecraft.network.Packet; | ||
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import net.minecraft.item.ItemSword; | ||
import net.minecraft.network.play.server.S30PacketWindowItems; | ||
|
||
public class NoSlow extends Module | ||
{ | ||
public NumberSetting eatingSlowdown; | ||
public NumberSetting swordSlowdown; | ||
public NumberSetting bowSlowdown; | ||
public ModeSetting mode; | ||
private final MilliTimer blockDelay; | ||
|
||
public NoSlow() { | ||
super("NoSlow", 0, Category.COMBAT); | ||
this.eatingSlowdown = new NumberSetting("Eating slow", 1.0, 0.2, 1.0, 0.1); | ||
this.swordSlowdown = new NumberSetting("Sword slow", 1.0, 0.2, 1.0, 0.1); | ||
this.bowSlowdown = new NumberSetting("Bow slow", 1.0, 0.2, 1.0, 0.1); | ||
this.mode = new ModeSetting("Mode", "Hypixel", new String[] { "Hypixel", "Vanilla" }); | ||
this.blockDelay = new MilliTimer(); | ||
this.addSettings(this.mode, this.swordSlowdown, this.bowSlowdown, this.eatingSlowdown); | ||
} | ||
|
||
@Override | ||
public void assign() | ||
{ | ||
Kore.noSlow = this; | ||
} | ||
|
||
@SubscribeEvent | ||
public void onPacket(final PacketReceivedEvent event) { | ||
if (event.packet instanceof S30PacketWindowItems && Kore.mc.thePlayer != null && this.isToggled() && this.mode.is("Hypixel") && Kore.mc.thePlayer.isUsingItem() && Kore.mc.thePlayer.getItemInUse().getItem() instanceof ItemSword) { | ||
event.setCanceled(true); | ||
} | ||
} | ||
|
||
@SubscribeEvent | ||
public void unUpdate(final MotionUpdateEvent.Post event) { | ||
if (this.isToggled() && Kore.mc.thePlayer.isUsingItem() && this.mode.is("Hypixel")) { | ||
if (this.blockDelay.hasTimePassed(250L) && Kore.mc.thePlayer.getItemInUse().getItem() instanceof ItemSword) { | ||
Kore.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C08PacketPlayerBlockPlacement(Kore.mc.thePlayer.getHeldItem())); | ||
Kore.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C0BPacketEntityAction((Entity)Kore.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING)); | ||
Kore.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C0BPacketEntityAction((Entity)Kore.mc.thePlayer, C0BPacketEntityAction.Action.START_SPRINTING)); | ||
this.blockDelay.reset(); | ||
} | ||
PacketUtils.sendPacketNoEvent((Packet<?>)new C09PacketHeldItemChange(Kore.mc.thePlayer.inventory.currentItem)); | ||
} | ||
} | ||
|
||
@SubscribeEvent | ||
public void onPacket(final PacketSentEvent event) { | ||
if (this.isToggled() && this.mode.is("Hypixel") && event.packet instanceof C08PacketPlayerBlockPlacement && ((C08PacketPlayerBlockPlacement)event.packet).getStack() != null && ((C08PacketPlayerBlockPlacement)event.packet).getStack().getItem() instanceof ItemSword) { | ||
this.blockDelay.reset(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.kore.modules.player; | ||
|
||
import net.kore.Kore; | ||
import net.kore.modules.Module; | ||
import net.kore.settings.BooleanSetting; | ||
import net.kore.settings.NumberSetting; | ||
|
||
public class Velocity extends Module | ||
{ | ||
public NumberSetting vModifier; | ||
public NumberSetting hModifier; | ||
public BooleanSetting skyblockKB; | ||
|
||
public Velocity() { | ||
super("Velocity", 0, Category.PLAYER); | ||
this.vModifier = new NumberSetting("Vertical", 0.0, -2.0, 2.0, 0.05); | ||
this.hModifier = new NumberSetting("Horizontal", 0.0, -2.0, 2.0, 0.05); | ||
this.skyblockKB = new BooleanSetting("Skyblock kb", true); | ||
this.addSettings(this.hModifier, this.vModifier, this.skyblockKB); | ||
this.setFlagType(FlagType.DETECTED); | ||
} | ||
|
||
@Override | ||
public void assign() | ||
{ | ||
Kore.velocity = this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters