Untitled diff
80 lines
package me.rigamortis.faurax.module.modules.movement;
package me.stormclientdev.storm.module.modules.movement;
import net.minecraft.network.*;
import net.minecraft.network.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.entity.*;
import me.rigamortis.faurax.module.*;
import com.mojang.authlib.*;
import com.mojang.authlib.*;
import me.stormclientdev.storm.events.*;
import me.stormclientdev.storm.module.*;
import net.minecraft.world.*;
import net.minecraft.world.*;
import net.minecraft.entity.*;
import net.minecraft.entity.*;
import java.util.*;
import java.util.*;
import com.darkmagician6.eventapi.*;
import com.darkmagician6.eventapi.*;
import me.rigamortis.faurax.events.*;
import net.minecraft.network.play.client.*;
import net.minecraft.network.play.client.*;
public class Blink extends Module
public class Blink extends Module
{
{
public ArrayList<Packet> packets;
public ArrayList<Packet> packets;
private EntityOtherPlayerMP fakePlayer;
private EntityOtherPlayerMP fakePlayer;
public Blink() {
public Blink() {
this.packets = new ArrayList<Packet>();
this.packets = new ArrayList<Packet>();
this.setName("Blink");
this.setName("Blink");
this.setKey("R");
this.setKey("R");
this.setType(ModuleType.MOVEMENT);
this.setType(ModuleType.MOVEMENT);
this.setColor(-13448726);
this.setColor(-13448726);
this.setModInfo("");
this.setModInfo("");
this.setVisible(true);
this.setVisible(true);
}
}
@Override
@Override
public void onEnabled() {
public void onEnabled() {
super.onEnabled();
super.onEnabled();
(this.fakePlayer = new EntityOtherPlayerMP(Blink.mc.theWorld, new GameProfile(Blink.mc.session.getProfile().getId(), Blink.mc.thePlayer.getName()))).setPositionAndRotation(Blink.mc.thePlayer.posX, Blink.mc.thePlayer.posY, Blink.mc.thePlayer.posZ, Blink.mc.thePlayer.rotationYaw, Blink.mc.thePlayer.rotationPitch);
(this.fakePlayer = new EntityOtherPlayerMP(Blink.mc.theWorld, new GameProfile(Blink.mc.session.getProfile().getId(), Blink.mc.thePlayer.getName()))).setPositionAndRotation(Blink.mc.thePlayer.posX, Blink.mc.thePlayer.posY, Blink.mc.thePlayer.posZ, Blink.mc.thePlayer.rotationYaw, Blink.mc.thePlayer.rotationPitch);
this.fakePlayer.rotationYawHead = Blink.mc.thePlayer.rotationYawHead;
this.fakePlayer.rotationYawHead = Blink.mc.thePlayer.rotationYawHead;
this.fakePlayer.inventory = Blink.mc.thePlayer.inventory;
this.fakePlayer.inventory = Blink.mc.thePlayer.inventory;
this.fakePlayer.setSneaking(Blink.mc.thePlayer.isSneaking());
this.fakePlayer.setSneaking(Blink.mc.thePlayer.isSneaking());
Blink.mc.theWorld.addEntityToWorld(-1338, this.fakePlayer);
Blink.mc.theWorld.addEntityToWorld(-1338, this.fakePlayer);
}
}
@Override
@Override
public void onDisabled() {
public void onDisabled() {
super.onDisabled();
super.onDisabled();
for (final Packet packet : this.packets) {
for (final Packet packet : this.packets) {
if (packet instanceof C02PacketUseEntity || packet instanceof C08PacketPlayerBlockPlacement || packet instanceof C07PacketPlayerDigging) {
if (packet instanceof C02PacketUseEntity || packet instanceof C08PacketPlayerBlockPlacement || packet instanceof C07PacketPlayerDigging) {
Blink.mc.thePlayer.swingItem();
Blink.mc.thePlayer.swingItem();
}
}
Blink.mc.thePlayer.sendQueue.addToSendQueue(packet);
Blink.mc.thePlayer.sendQueue.addToSendQueue(packet);
}
}
this.packets.clear();
this.packets.clear();
try {
try {
if (this.fakePlayer != null) {
if (this.fakePlayer != null) {
Blink.mc.theWorld.removeEntity(this.fakePlayer);
Blink.mc.theWorld.removeEntity(this.fakePlayer);
}
}
}
}
catch (Exception ex) {}
catch (Exception ex) {}
}
}
@EventTarget
@EventTarget
public void preTick(final EventPreTick e) {
public void preTick(final EventPreTick e) {
if (this.isToggled()) {
if (this.isToggled()) {
this.setModInfo(" §7" + this.packets.size());
this.setModInfo(" §7" + this.packets.size());
}
}
}
}
@EventTarget
@EventTarget
public void onSendPacket(final EventSendPacket e) {
public void onSendPacket(final EventSendPacket e) {
if (this.isToggled()) {
if (this.isToggled()) {
if (!(e.getPacket() instanceof C01PacketChatMessage) && !(e.getPacket() instanceof C16PacketClientStatus) && !(e.getPacket() instanceof C00PacketKeepAlive) && Blink.mc.theWorld != null) {
if (!(e.getPacket() instanceof C01PacketChatMessage) && !(e.getPacket() instanceof C16PacketClientStatus) && !(e.getPacket() instanceof C00PacketKeepAlive) && Blink.mc.theWorld != null) {
e.setCancelled(true);
e.setCancelled(true);
}
}
final boolean input = Blink.mc.gameSettings.keyBindForward.pressed || Blink.mc.gameSettings.keyBindBack.pressed || Blink.mc.gameSettings.keyBindRight.pressed || Blink.mc.gameSettings.keyBindLeft.pressed;
final boolean input = Blink.mc.gameSettings.keyBindForward.pressed || Blink.mc.gameSettings.keyBindBack.pressed || Blink.mc.gameSettings.keyBindRight.pressed || Blink.mc.gameSettings.keyBindLeft.pressed;
if (input && e.getPacket() instanceof C03PacketPlayer) {
if (input && e.getPacket() instanceof C03PacketPlayer) {
this.packets.add(e.getPacket());
this.packets.add(e.getPacket());
}
}
if (e.getPacket() instanceof C02PacketUseEntity || e.getPacket() instanceof C08PacketPlayerBlockPlacement || e.getPacket() instanceof C07PacketPlayerDigging) {
if (e.getPacket() instanceof C02PacketUseEntity || e.getPacket() instanceof C08PacketPlayerBlockPlacement || e.getPacket() instanceof C07PacketPlayerDigging) {
this.packets.add(e.getPacket());
this.packets.add(e.getPacket());
}
}
}
}
}
}
}
}