too many changes
This commit is contained in:
parent
b28b590ced
commit
1fd84df7a7
|
|
@ -35,7 +35,7 @@ minecraft {
|
|||
version = "1.8.9-11.15.1.2318-1.8.9"
|
||||
runDir = "run"
|
||||
|
||||
mappings = "stable_20"
|
||||
mappings = "stable_22"
|
||||
makeObfSourceJar = false
|
||||
clientJvmArgs += '-Dfml.coreMods.load=keystrokesmod.mixins.MixinLoader'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import keystrokesmod.keystroke.keystrokeCommand;
|
|||
import keystrokesmod.module.Module;
|
||||
import keystrokesmod.clickgui.ClickGui;
|
||||
import keystrokesmod.module.ModuleManager;
|
||||
import keystrokesmod.script.classes.Entity;
|
||||
import keystrokesmod.script.classes.NetworkPlayer;
|
||||
import keystrokesmod.utility.ModuleUtils;
|
||||
import keystrokesmod.script.ScriptManager;
|
||||
import keystrokesmod.utility.*;
|
||||
|
|
@ -84,6 +86,10 @@ public class Raven {
|
|||
public void onTick(ClientTickEvent e) {
|
||||
if (e.phase == Phase.END) {
|
||||
if (Utils.nullCheck()) {
|
||||
if (mc.thePlayer.ticksExisted % 6000 == 0) { // reset cache every 5 minutes
|
||||
Entity.clearCache();
|
||||
NetworkPlayer.clearCache();
|
||||
}
|
||||
if (Reflection.sendMessage) {
|
||||
Utils.sendMessage("&cThere was an error, relaunch the game.");
|
||||
Reflection.sendMessage = false;
|
||||
|
|
@ -119,10 +125,14 @@ public class Raven {
|
|||
|
||||
@SubscribeEvent
|
||||
public void onEntityJoinWorld(EntityJoinWorldEvent e) {
|
||||
if (e.entity == mc.thePlayer && !firstLoad) {
|
||||
if (e.entity == mc.thePlayer) {
|
||||
if (!firstLoad) {
|
||||
firstLoad = true;
|
||||
scriptManager.loadScripts();
|
||||
}
|
||||
Entity.clearCache();
|
||||
NetworkPlayer.clearCache();
|
||||
}
|
||||
}
|
||||
|
||||
public static ModuleManager getModuleManager() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
package keystrokesmod.clickgui.components;
|
||||
|
||||
public class Component {
|
||||
|
||||
public boolean isVisible = true;
|
||||
|
||||
public boolean isVisible() {
|
||||
|
||||
return isVisible;
|
||||
}
|
||||
|
||||
public void render() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ public class BindComponent extends Component {
|
|||
}
|
||||
|
||||
public void render() {
|
||||
if (!isVisible()) {
|
||||
this.o = this.o - 12;
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
if (keySetting == null) {
|
||||
|
|
@ -136,4 +139,10 @@ public class BindComponent extends Component {
|
|||
public void onGuiClosed() {
|
||||
this.isBinding = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return keySetting == null || keySetting.isVisible;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -29,6 +29,9 @@ public class ButtonComponent extends Component {
|
|||
}
|
||||
|
||||
public void render() {
|
||||
if (!isVisible()) {
|
||||
this.o = this.o - 12;
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScaled(0.5D, 0.5D, 0.5D);
|
||||
Minecraft.getMinecraft().fontRendererObj.drawString((this.buttonSetting.isMethodButton ? "[=] " : (this.buttonSetting.isToggled() ? "[+] " : "[-] ")) + this.buttonSetting.getName(), (float) ((this.p.categoryComponent.getX() + 4) * 2), (float) ((this.p.categoryComponent.getY() + this.o + 4) * 2), this.buttonSetting.isToggled() ? this.c : -1, false);
|
||||
|
|
@ -62,4 +65,10 @@ public class ButtonComponent extends Component {
|
|||
public boolean i(int x, int y) {
|
||||
return x > this.x && x < this.x + this.p.categoryComponent.getWidth() && y > this.y && y < this.y + 11;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return buttonSetting == null || buttonSetting.isVisible;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -51,24 +51,36 @@ public class ModuleComponent extends Component {
|
|||
if (v instanceof SliderSetting) {
|
||||
SliderSetting n = (SliderSetting) v;
|
||||
SliderComponent s = new SliderComponent(n, this, y);
|
||||
if (!s.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
this.settings.add(s);
|
||||
y += 12;
|
||||
}
|
||||
else if (v instanceof ButtonSetting) {
|
||||
ButtonSetting b = (ButtonSetting) v;
|
||||
ButtonComponent c = new ButtonComponent(mod, b, this, y);
|
||||
if (!c.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
this.settings.add(c);
|
||||
y += 12;
|
||||
}
|
||||
else if (v instanceof DescriptionSetting) {
|
||||
DescriptionSetting d = (DescriptionSetting) v;
|
||||
DescriptionComponent m = new DescriptionComponent(d, this, y);
|
||||
if (!m.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
this.settings.add(m);
|
||||
y += 12;
|
||||
}
|
||||
else if (v instanceof KeySetting) {
|
||||
KeySetting setting = (KeySetting) v;
|
||||
BindComponent keyComponent = new BindComponent(this, setting, y);
|
||||
if (!keyComponent.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
this.settings.add(keyComponent);
|
||||
y += 12;
|
||||
}
|
||||
|
|
@ -85,6 +97,9 @@ public class ModuleComponent extends Component {
|
|||
while (true) {
|
||||
while (var3.hasNext()) {
|
||||
Component co = (Component) var3.next();
|
||||
if (!co.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
co.updateHeight(y);
|
||||
if (co instanceof SliderComponent) {
|
||||
y += 16;
|
||||
|
|
@ -190,6 +205,9 @@ public class ModuleComponent extends Component {
|
|||
|
||||
if (this.isOpened || smoothTimer != null) {
|
||||
for (Component settingComponent : this.settings) {
|
||||
if (!settingComponent.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
settingComponent.render();
|
||||
}
|
||||
}
|
||||
|
|
@ -214,6 +232,9 @@ public class ModuleComponent extends Component {
|
|||
while (true) {
|
||||
while (var2.hasNext()) {
|
||||
Component c = (Component) var2.next();
|
||||
if (!c.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
if (c instanceof SliderComponent) {
|
||||
h += 16;
|
||||
}
|
||||
|
|
@ -234,6 +255,9 @@ public class ModuleComponent extends Component {
|
|||
while (true) {
|
||||
while (var2.hasNext()) {
|
||||
Component c = (Component) var2.next();
|
||||
if (!c.isVisible()) {
|
||||
continue;
|
||||
}
|
||||
if (c instanceof SliderComponent) {
|
||||
h += 16;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public class SliderComponent extends Component {
|
|||
}
|
||||
|
||||
public void render() {
|
||||
if (!isVisible()) {
|
||||
this.o = this.o - 12;
|
||||
}
|
||||
RenderUtils.drawRoundedRectangle(this.moduleComponent.categoryComponent.getX() + 4, this.moduleComponent.categoryComponent.getY() + this.o + 11, this.moduleComponent.categoryComponent.getX() + 4 + this.moduleComponent.categoryComponent.getWidth() - 8, this.moduleComponent.categoryComponent.getY() + this.o + 15, 4, -12302777);
|
||||
int l = this.moduleComponent.categoryComponent.getX() + 4;
|
||||
int r = this.moduleComponent.categoryComponent.getX() + 4 + (int) this.w;
|
||||
|
|
@ -129,4 +132,10 @@ public class SliderComponent extends Component {
|
|||
public void onGuiClosed() {
|
||||
this.heldDown = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return sliderSetting == null || sliderSetting.isVisible;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,26 +4,13 @@ import keystrokesmod.module.ModuleManager;
|
|||
import keystrokesmod.module.impl.combat.Reduce;
|
||||
import keystrokesmod.module.impl.movement.KeepSprint;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.entity.boss.EntityDragonPart;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.server.S12PacketEntityVelocity;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.stats.AchievementList;
|
||||
import net.minecraft.stats.StatBase;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.*;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(EntityPlayer.class)
|
||||
|
|
@ -31,144 +18,26 @@ public abstract class MixinEntityPlayer extends EntityLivingBase {
|
|||
public MixinEntityPlayer(World p_i1594_1_) {
|
||||
super(p_i1594_1_);
|
||||
}
|
||||
|
||||
@Shadow
|
||||
public abstract ItemStack getHeldItem();
|
||||
|
||||
@Shadow
|
||||
public abstract void onCriticalHit(Entity p_onCriticalHit_1_);
|
||||
|
||||
@Shadow
|
||||
public abstract void onEnchantmentCritical(Entity p_onEnchantmentCritical_1_);
|
||||
|
||||
@Shadow
|
||||
public abstract void triggerAchievement(StatBase p_triggerAchievement_1_);
|
||||
|
||||
@Shadow
|
||||
public abstract ItemStack getCurrentEquippedItem();
|
||||
|
||||
@Shadow
|
||||
public abstract void destroyCurrentEquippedItem();
|
||||
|
||||
@Shadow
|
||||
public abstract void addStat(StatBase p_addStat_1_, int p_addStat_2_);
|
||||
|
||||
@Shadow
|
||||
public abstract void addExhaustion(float p_addExhaustion_1_);
|
||||
@Shadow
|
||||
private ItemStack itemInUse;
|
||||
@Shadow
|
||||
public abstract boolean isUsingItem();
|
||||
|
||||
@Overwrite
|
||||
public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCurrentItem_1_) {
|
||||
if (ForgeHooks.onPlayerAttackTarget(((EntityPlayer) (Object) this), p_attackTargetEntityWithCurrentItem_1_)) {
|
||||
if (p_attackTargetEntityWithCurrentItem_1_.canAttackWithItem() && !p_attackTargetEntityWithCurrentItem_1_.hitByEntity(this)) {
|
||||
float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
|
||||
int i = 0;
|
||||
float f1 = 0.0F;
|
||||
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) {
|
||||
f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), ((EntityLivingBase) p_attackTargetEntityWithCurrentItem_1_).getCreatureAttribute());
|
||||
} else {
|
||||
f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), EnumCreatureAttribute.UNDEFINED);
|
||||
}
|
||||
|
||||
i += EnchantmentHelper.getKnockbackModifier(this);
|
||||
if (this.isSprinting()) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (f > 0.0F || f1 > 0.0F) {
|
||||
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase;
|
||||
if (flag && f > 0.0F) {
|
||||
f *= 1.5F;
|
||||
}
|
||||
|
||||
f += f1;
|
||||
boolean flag1 = false;
|
||||
int j = EnchantmentHelper.getFireAspectModifier(this);
|
||||
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase && j > 0 && !p_attackTargetEntityWithCurrentItem_1_.isBurning()) {
|
||||
flag1 = true;
|
||||
p_attackTargetEntityWithCurrentItem_1_.setFire(1);
|
||||
}
|
||||
|
||||
double d0 = p_attackTargetEntityWithCurrentItem_1_.motionX;
|
||||
double d1 = p_attackTargetEntityWithCurrentItem_1_.motionY;
|
||||
double d2 = p_attackTargetEntityWithCurrentItem_1_.motionZ;
|
||||
boolean flag2 = p_attackTargetEntityWithCurrentItem_1_.attackEntityFrom(DamageSource.causePlayerDamage(((EntityPlayer) (Object) this)), f);
|
||||
if (flag2) {
|
||||
if (i > 0) {
|
||||
p_attackTargetEntityWithCurrentItem_1_.addVelocity((double) (-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1, (double) (MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F));
|
||||
@ModifyConstant(method = "attackTargetEntityWithCurrentItem", constant = @Constant(doubleValue = 0.6))
|
||||
private double multiplyMotion(final double originalValue) {
|
||||
if (ModuleManager.reduce != null && ModuleManager.reduce.isEnabled()) {
|
||||
Reduce.reduce(p_attackTargetEntityWithCurrentItem_1_);
|
||||
return Reduce.getReduceMotion();
|
||||
}
|
||||
else if (ModuleManager.keepSprint != null && ModuleManager.keepSprint.isEnabled()) {
|
||||
KeepSprint.keepSprint(p_attackTargetEntityWithCurrentItem_1_);
|
||||
}
|
||||
else {
|
||||
this.motionX *= 0.6D;
|
||||
this.motionZ *= 0.6D;
|
||||
this.setSprinting(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityPlayerMP && p_attackTargetEntityWithCurrentItem_1_.velocityChanged) {
|
||||
((EntityPlayerMP) p_attackTargetEntityWithCurrentItem_1_).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(p_attackTargetEntityWithCurrentItem_1_));
|
||||
p_attackTargetEntityWithCurrentItem_1_.velocityChanged = false;
|
||||
p_attackTargetEntityWithCurrentItem_1_.motionX = d0;
|
||||
p_attackTargetEntityWithCurrentItem_1_.motionY = d1;
|
||||
p_attackTargetEntityWithCurrentItem_1_.motionZ = d2;
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
this.onCriticalHit(p_attackTargetEntityWithCurrentItem_1_);
|
||||
}
|
||||
|
||||
if (f1 > 0.0F) {
|
||||
this.onEnchantmentCritical(p_attackTargetEntityWithCurrentItem_1_);
|
||||
}
|
||||
|
||||
if (f >= 18.0F) {
|
||||
this.triggerAchievement(AchievementList.overkill);
|
||||
}
|
||||
|
||||
this.setLastAttacker(p_attackTargetEntityWithCurrentItem_1_);
|
||||
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) {
|
||||
EnchantmentHelper.applyThornEnchantments((EntityLivingBase) p_attackTargetEntityWithCurrentItem_1_, this);
|
||||
}
|
||||
|
||||
EnchantmentHelper.applyArthropodEnchantments(this, p_attackTargetEntityWithCurrentItem_1_);
|
||||
ItemStack itemstack = this.getCurrentEquippedItem();
|
||||
Entity entity = p_attackTargetEntityWithCurrentItem_1_;
|
||||
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityDragonPart) {
|
||||
IEntityMultiPart ientitymultipart = ((EntityDragonPart) p_attackTargetEntityWithCurrentItem_1_).entityDragonObj;
|
||||
if (ientitymultipart instanceof EntityLivingBase) {
|
||||
entity = (EntityLivingBase) ientitymultipart;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemstack != null && entity instanceof EntityLivingBase) {
|
||||
itemstack.hitEntity((EntityLivingBase) entity, ((EntityPlayer) (Object) this));
|
||||
if (itemstack.stackSize <= 0) {
|
||||
this.destroyCurrentEquippedItem();
|
||||
}
|
||||
}
|
||||
|
||||
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityLivingBase) {
|
||||
this.addStat(StatList.damageDealtStat, Math.round(f * 10.0F));
|
||||
if (j > 0) {
|
||||
p_attackTargetEntityWithCurrentItem_1_.setFire(j * 4);
|
||||
}
|
||||
}
|
||||
|
||||
this.addExhaustion(0.3F);
|
||||
} else if (flag1) {
|
||||
p_attackTargetEntityWithCurrentItem_1_.extinguish();
|
||||
}
|
||||
return KeepSprint.getKeepSprintMotion();
|
||||
}
|
||||
return originalValue;
|
||||
}
|
||||
|
||||
@Redirect(method = "attackTargetEntityWithCurrentItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;setSprinting(Z)V"))
|
||||
public void setSprinting(final EntityPlayer entityPlayer, final boolean sprinting) {
|
||||
if (ModuleManager.keepSprint != null && ModuleManager.keepSprint.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
entityPlayer.setSprinting(sprinting);
|
||||
}
|
||||
|
||||
@Inject(method = "isBlocking", at = @At("RETURN"), cancellable = true)
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ public abstract class MixinEntityPlayerSP extends AbstractClientPlayer {
|
|||
this.setSprinting(true);
|
||||
}
|
||||
|
||||
if (this.isSprinting() && (!ModuleManager.sprint.omniSprint() && !NoSlow.groundSpeed() && (this.movementInput.moveForward < f || !flag3)) || this.isCollidedHorizontally || this.mc.gameSettings.keyBindSneak.isKeyDown() || (ModuleManager.scaffold != null && ModuleManager.scaffold.isEnabled && (!ModuleManager.scaffold.sprint() || ModuleManager.tower.canTower())) || (ModuleManager.wTap.isEnabled() && WTap.stopSprint)) {
|
||||
if (this.isSprinting() && (!ModuleManager.sprint.omniSprint() && !NoSlow.groundSpeed() && (this.movementInput.moveForward < f || !flag3)) || this.isCollidedHorizontally || ModuleManager.sprint.disableBack || this.mc.gameSettings.keyBindSneak.isKeyDown() || (ModuleManager.scaffold != null && ModuleManager.scaffold.isEnabled && (!ModuleManager.scaffold.sprint() || ModuleManager.tower.canTower())) || (ModuleManager.wTap.isEnabled() && WTap.stopSprint)) {
|
||||
this.setSprinting(false);
|
||||
WTap.stopSprint = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class KillAura extends Module {
|
|||
private ButtonSetting silentSwing;
|
||||
private ButtonSetting weaponOnly;
|
||||
|
||||
private String[] autoBlockModes = new String[] { "Manual", "Vanilla", "Partial", "Interact A", "Interact B", "Hypixel", "Hypixel 2" };
|
||||
private String[] autoBlockModes = new String[] { "Manual", "Vanilla", "Partial", "Interact A", "Interact B", "Hypixel A", "Hypixel B" };
|
||||
private String[] rotationModes = new String[] { "Silent", "Lock view", "None" };
|
||||
private String[] sortModes = new String[] { "Distance", "Health", "Hurttime", "Yaw" };
|
||||
|
||||
|
|
@ -90,6 +90,8 @@ public class KillAura extends Module {
|
|||
private int partialTicks;
|
||||
private int firstEdge;
|
||||
private boolean blocked;
|
||||
private boolean canUse;
|
||||
private boolean canBlockServerside;
|
||||
|
||||
// blink related
|
||||
private ConcurrentLinkedQueue<Packet> blinkedPackets = new ConcurrentLinkedQueue<>();
|
||||
|
|
@ -110,6 +112,7 @@ public class KillAura extends Module {
|
|||
private boolean lastPressedLeft;
|
||||
private boolean lastPressedRight;
|
||||
private boolean sendDig = true;
|
||||
private boolean usedWhileTargeting;
|
||||
|
||||
public KillAura() {
|
||||
super("KillAura", category.combat);
|
||||
|
|
@ -178,10 +181,39 @@ public class KillAura extends Module {
|
|||
|
||||
@SubscribeEvent
|
||||
public void onPreUpdate(PreUpdateEvent e) {
|
||||
if (sendDig && !isTargeting) {
|
||||
sendDigPacket();
|
||||
sendDig = false;
|
||||
|
||||
if (blinkAutoBlock()) {
|
||||
EntityLivingBase g = Utils.raytrace(3);
|
||||
if ((g != null || BlockUtils.isInteractable(mc.objectMouseOver)) && Utils.holdingSword()) {
|
||||
canUse = Mouse.isButtonDown(1);
|
||||
}
|
||||
else if (canUse) {
|
||||
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false);
|
||||
canUse = false;
|
||||
}
|
||||
if (Utils.holdingSword()) {
|
||||
if (Mouse.isButtonDown(1) && Utils.tabbedIn()) {
|
||||
Reflection.setItemInUse(this.blockingClient = true);
|
||||
canBlockServerside = (target == null);
|
||||
}
|
||||
else if (canBlockServerside) {
|
||||
Reflection.setItemInUse(this.blockingClient = false);
|
||||
canBlockServerside = false;
|
||||
}
|
||||
}
|
||||
if (target == null) {
|
||||
if (usedWhileTargeting) {
|
||||
if (!Utils.holdingSword()) KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), Mouse.isButtonDown(1));
|
||||
usedWhileTargeting = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false);
|
||||
usedWhileTargeting = Mouse.isButtonDown(1);
|
||||
canBlockServerside = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (mc.currentScreen == null || mc.currentScreen.allowUserInput) {
|
||||
boolean pressedLeft = Mouse.isButtonDown(0);
|
||||
if (pressedLeft && !lastPressedLeft) {
|
||||
|
|
@ -202,6 +234,10 @@ public class KillAura extends Module {
|
|||
}
|
||||
lastPressedLeft = pressedLeft;
|
||||
}
|
||||
if (sendDig && !isTargeting && !ModuleManager.bedAura.stopAutoblock) {
|
||||
sendDigPacket();
|
||||
sendDig = false;
|
||||
}
|
||||
/*if (sendUnBlock) {
|
||||
Reflection.setItemInUse(blockingClient = false);
|
||||
sendDigPacket();
|
||||
|
|
@ -378,7 +414,7 @@ public class KillAura extends Module {
|
|||
}
|
||||
}
|
||||
if (blinking.get() && !e.isCanceled()) { // blink
|
||||
if (packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) {
|
||||
if (packet instanceof C00PacketKeepAlive || packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) {
|
||||
return;
|
||||
}
|
||||
blinkedPackets.add(packet);
|
||||
|
|
@ -389,12 +425,16 @@ public class KillAura extends Module {
|
|||
@SubscribeEvent
|
||||
public void onMouse(MouseEvent e) {
|
||||
if (e.button == 0 || e.button == 1) {
|
||||
if (e.button == 1) {
|
||||
EntityLivingBase g = Utils.raytrace(3);
|
||||
if (blinkAutoBlock() && Utils.holdingSword() && g == null && !BlockUtils.isInteractable(mc.objectMouseOver)) {
|
||||
e.setCanceled(true);
|
||||
}
|
||||
}
|
||||
if (!Utils.holdingWeapon() || target == null) {
|
||||
return;
|
||||
}
|
||||
e.setCanceled(true);
|
||||
KeyBinding.setKeyBindState(mc.gameSettings.keyBindUseItem.getKeyCode(), false);
|
||||
//hypixUtils.print("Set false?");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -467,7 +507,7 @@ public class KillAura extends Module {
|
|||
private void setTarget(Entity entity) {
|
||||
if (entity == null || !(entity instanceof EntityLivingBase)) {
|
||||
if (blockingClient) {
|
||||
Reflection.setItemInUse(blockingClient = false);
|
||||
//Reflection.setItemInUse(blockingClient = false);
|
||||
sendUnBlock = true;
|
||||
}
|
||||
if (blinking.get() || lag) {
|
||||
|
|
@ -665,11 +705,11 @@ public class KillAura extends Module {
|
|||
}
|
||||
return;
|
||||
}
|
||||
if (this.blockingClient == blockState && autoBlockMode.getInput() != 3) {
|
||||
if (blinkAutoBlock() && target == null) {
|
||||
return;
|
||||
}
|
||||
if (autoBlockMode.getInput() != previousAutoBlockMode) {
|
||||
if (previousAutoBlockMode == 4 || previousAutoBlockMode == 5 || previousAutoBlockMode == 6) { // if == interact
|
||||
if (previousAutoBlockMode == 3 || previousAutoBlockMode == 4 || previousAutoBlockMode == 5 || previousAutoBlockMode == 6) { // if == interact
|
||||
resetBlinkState(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -698,8 +738,8 @@ public class KillAura extends Module {
|
|||
break;
|
||||
case 3: // interact a
|
||||
case 4: // interact b
|
||||
case 5: // hypixel
|
||||
case 6: // hypixel 2
|
||||
case 5: // hypixel a
|
||||
case 6: // hypixel b
|
||||
Reflection.setItemInUse(this.blockingClient = blockState);
|
||||
break;
|
||||
}
|
||||
|
|
@ -724,7 +764,7 @@ public class KillAura extends Module {
|
|||
}
|
||||
|
||||
public boolean blinkAutoBlock() {
|
||||
return (autoBlockMode.getInput() == 4 || autoBlockMode.getInput() == 5 || autoBlockMode.getInput() == 6);
|
||||
return (autoBlockMode.getInput() == 3 || autoBlockMode.getInput() == 4 || autoBlockMode.getInput() == 5 || autoBlockMode.getInput() == 6);
|
||||
}
|
||||
|
||||
private float unwrapYaw(float yaw, float prevYaw) {
|
||||
|
|
@ -763,13 +803,13 @@ public class KillAura extends Module {
|
|||
interactTicks++;
|
||||
switch (interactTicks) {
|
||||
case 1:
|
||||
blinking.set(true);
|
||||
if (lag) {
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
|
||||
blocked = false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
blinking.set(true);
|
||||
handleInteractAndAttack(distance, true, true, swung);
|
||||
sendBlockPacket();
|
||||
blocked = true;
|
||||
|
|
@ -785,17 +825,18 @@ public class KillAura extends Module {
|
|||
interactTicks++;
|
||||
switch (interactTicks) {
|
||||
case 1:
|
||||
blinking.set(true);
|
||||
if (lag) {
|
||||
setSwapSlot();
|
||||
swapped = blocked = false;
|
||||
blocked = false;
|
||||
swapped = true;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (lag) {
|
||||
setCurrentSlot();
|
||||
swapped = true;
|
||||
swapped = false;
|
||||
}
|
||||
blinking.set(true);
|
||||
handleInteractAndAttack(distance, true, true, swung);
|
||||
sendBlockPacket();
|
||||
blocked = true;
|
||||
|
|
@ -804,20 +845,20 @@ public class KillAura extends Module {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case 5: // hypixel
|
||||
case 5: // hypixel a
|
||||
if (interactTicks >= 3) {
|
||||
interactTicks = 0;
|
||||
}
|
||||
interactTicks++;
|
||||
switch (interactTicks) {
|
||||
case 1:
|
||||
blinking.set(true);
|
||||
if (lag) {
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
|
||||
blocked = false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
blinking.set(true);
|
||||
handleInteractAndAttack(distance, true, true, swung);
|
||||
sendBlockPacket();
|
||||
blocked = true;
|
||||
|
|
@ -826,7 +867,7 @@ public class KillAura extends Module {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case 6: // hypixel 2
|
||||
case 6: // hypixel b
|
||||
if (interactTicks >= 3) {
|
||||
interactTicks = 0;
|
||||
}
|
||||
|
|
@ -834,13 +875,13 @@ public class KillAura extends Module {
|
|||
if (!firstCycle) {
|
||||
switch (interactTicks) {
|
||||
case 1:
|
||||
blinking.set(true);
|
||||
if (lag) {
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
|
||||
blocked = false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
blinking.set(true);
|
||||
handleInteractAndAttack(distance, true, true, swung);
|
||||
sendBlockPacket();
|
||||
blocked = true;
|
||||
|
|
@ -848,27 +889,33 @@ public class KillAura extends Module {
|
|||
lag = true;
|
||||
break;
|
||||
case 3:
|
||||
++firstEdge;
|
||||
if (firstEdge > 1) {
|
||||
firstCycle = true;
|
||||
if (firstEdge > 5) {
|
||||
firstEdge = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (interactTicks) {
|
||||
case 1:
|
||||
blinking.set(true);
|
||||
if (lag) {
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, DOWN));
|
||||
blocked = false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
blinking.set(true);
|
||||
handleInteractAndAttack(distance, true, true, swung);
|
||||
sendBlockPacket();
|
||||
blocked = true;
|
||||
releasePackets(); // release
|
||||
lag = true;
|
||||
firstCycle = false;
|
||||
interactTicks = 0;
|
||||
firstCycle = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1096,18 +1143,19 @@ public class KillAura extends Module {
|
|||
public void resetBlinkState(boolean unblock) {
|
||||
//Utils.print("blink state reset");
|
||||
blockingServer = false;
|
||||
interactTicks = 0;
|
||||
blinking.set(false);
|
||||
releasePackets();
|
||||
if (Raven.packetsHandler.playerSlot.get() != mc.thePlayer.inventory.currentItem && swapped) {
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem));
|
||||
Raven.packetsHandler.playerSlot.set(mc.thePlayer.inventory.currentItem);
|
||||
}
|
||||
else if (unblock && lag && !ModuleManager.scaffold.isEnabled && blocked) {
|
||||
else if (unblock && lag && !ModuleManager.scaffold.isEnabled) {
|
||||
sendDig = true;
|
||||
}
|
||||
swapped = blocked = false;
|
||||
lag = false;
|
||||
firstEdge = interactTicks = 0;
|
||||
firstCycle = false;
|
||||
}
|
||||
|
||||
public void sendDigPacket() {
|
||||
|
|
@ -1175,6 +1223,7 @@ public class KillAura extends Module {
|
|||
golems.put(entityCreature.getEntityId(), isTeam);
|
||||
return !isTeam;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return !golems.getOrDefault(entityCreature.getEntityId(), false);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package keystrokesmod.module.impl.combat;
|
|||
import keystrokesmod.module.Module;
|
||||
import keystrokesmod.module.setting.impl.DescriptionSetting;
|
||||
import keystrokesmod.module.setting.impl.SliderSetting;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class Reduce extends Module {
|
||||
private static SliderSetting chance;
|
||||
|
|
@ -17,17 +16,13 @@ public class Reduce extends Module {
|
|||
this.closetModule = true;
|
||||
}
|
||||
|
||||
public static void reduce(Entity entity) {
|
||||
public static double getReduceMotion() {
|
||||
if (chance.getInput() == 0) {
|
||||
return;
|
||||
return 0.6;
|
||||
}
|
||||
if (chance.getInput() != 100.0 && Math.random() >= chance.getInput() / 100.0) {
|
||||
mc.thePlayer.motionX *= 0.6;
|
||||
mc.thePlayer.motionZ *= 0.6;
|
||||
return;
|
||||
return 0.6;
|
||||
}
|
||||
double n = (100.0 - (float)reduction.getInput()) / 100.0;
|
||||
mc.thePlayer.motionX *= n;
|
||||
mc.thePlayer.motionZ *= n;
|
||||
return (100.0 - (float)reduction.getInput()) / 100.0;
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ public class Bhop extends Module {
|
|||
this.registerSetting(speedSetting = new SliderSetting("Speed", 2.0, 0.5, 8.0, 0.1));
|
||||
this.registerSetting(liquidDisable = new ButtonSetting("Disable in liquid", true));
|
||||
this.registerSetting(sneakDisable = new ButtonSetting("Disable while sneaking", true));
|
||||
this.registerSetting(rotateYawOption = new ButtonSetting("Rotate Yaw", false));
|
||||
this.registerSetting(rotateYawOption = new ButtonSetting("Rotate yaw", false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -62,17 +62,17 @@ public class Bhop extends Module {
|
|||
if (mc.thePlayer.onGround) {
|
||||
mc.thePlayer.jump();
|
||||
double horizontalSpeed = Utils.getHorizontalSpeed();
|
||||
double speedModifier = 0.4847;
|
||||
double speedModifier = 0.48;
|
||||
final int speedAmplifier = Utils.getSpeedAmplifier();
|
||||
switch (speedAmplifier) {
|
||||
case 1:
|
||||
speedModifier = 0.515200;
|
||||
speedModifier = 0.5;
|
||||
break;
|
||||
case 2:
|
||||
speedModifier = 0.587;
|
||||
speedModifier = 0.52;
|
||||
break;
|
||||
case 3:
|
||||
speedModifier = 0.6289;
|
||||
speedModifier = 0.58;
|
||||
break;
|
||||
}
|
||||
double additionalSpeed = speedModifier * ((speedSetting.getInput() - 1.0) / 3.0 + 1.0);
|
||||
|
|
|
|||
|
|
@ -6,11 +6,10 @@ import keystrokesmod.module.impl.combat.KillAura;
|
|||
import keystrokesmod.module.setting.impl.ButtonSetting;
|
||||
import keystrokesmod.module.setting.impl.DescriptionSetting;
|
||||
import keystrokesmod.module.setting.impl.SliderSetting;
|
||||
import net.minecraft.entity.Entity;
|
||||
import keystrokesmod.utility.Utils;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class KeepSprint extends Module {
|
||||
private DescriptionSetting description;
|
||||
public static SliderSetting slow;
|
||||
public static ButtonSetting disableWhileJump;
|
||||
public static ButtonSetting reduceReachHits;
|
||||
|
|
@ -23,31 +22,29 @@ public class KeepSprint extends Module {
|
|||
this.registerSetting(reduceReachHits = new ButtonSetting("Only reduce reach hits", false));
|
||||
}
|
||||
|
||||
public static void keepSprint(Entity en) {
|
||||
public static double getKeepSprintMotion() {
|
||||
boolean vanilla = false;
|
||||
if (disableWhileJump.isToggled() && !mc.thePlayer.onGround) {
|
||||
vanilla = true;
|
||||
}
|
||||
else if (reduceReachHits.isToggled() && !mc.thePlayer.capabilities.isCreativeMode) {
|
||||
double n = -1.0;
|
||||
double distance = -1.0;
|
||||
final Vec3 getPositionEyes = mc.thePlayer.getPositionEyes(1.0f);
|
||||
if (ModuleManager.killAura != null && ModuleManager.killAura.isEnabled() && KillAura.target != null) {
|
||||
n = getPositionEyes.distanceTo(KillAura.target.getPositionEyes(1.0f));
|
||||
distance = getPositionEyes.distanceTo(KillAura.target.getPositionEyes(Utils.getTimer().renderPartialTicks));
|
||||
}
|
||||
else if (ModuleManager.reach != null && ModuleManager.reach.isEnabled()) {
|
||||
n = getPositionEyes.distanceTo(mc.objectMouseOver.hitVec);
|
||||
distance = getPositionEyes.distanceTo(mc.objectMouseOver.hitVec);
|
||||
}
|
||||
if (n != -1.0 && n <= 3.0) {
|
||||
if (distance != -1.0 && distance <= 3.0) {
|
||||
vanilla = true;
|
||||
}
|
||||
}
|
||||
if (vanilla) {
|
||||
mc.thePlayer.motionX *= 0.6;
|
||||
mc.thePlayer.motionZ *= 0.6;
|
||||
} else {
|
||||
float n2 = (100.0f - (float) slow.getInput()) / 100.0f;
|
||||
mc.thePlayer.motionX *= n2;
|
||||
mc.thePlayer.motionZ *= n2;
|
||||
return 0.6;
|
||||
}
|
||||
else {
|
||||
return (100.0f - (float) slow.getInput()) / 100.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,9 +17,12 @@ import net.minecraft.network.play.server.*;
|
|||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
public class LongJump extends Module {
|
||||
private SliderSetting mode;
|
||||
|
||||
private SliderSetting boostSetting;
|
||||
private SliderSetting motionTicks;
|
||||
private SliderSetting verticalMotion;
|
||||
|
|
@ -33,6 +36,8 @@ public class LongJump extends Module {
|
|||
private KeySetting temporaryFlightKey;
|
||||
private SliderSetting pitchVal;
|
||||
|
||||
public String[] modes = new String[]{"Floyd", "Boost"};
|
||||
|
||||
private float yaw;
|
||||
private float pitch;
|
||||
|
||||
|
|
@ -55,10 +60,12 @@ public class LongJump extends Module {
|
|||
public static boolean slotReset;
|
||||
public static int slotResetTicks;
|
||||
|
||||
private String[] modes = new String[]{"Fireball", "Fireball Auto"};
|
||||
public LongJump() {
|
||||
super("Long Jump", category.movement);
|
||||
this.registerSetting(mode = new SliderSetting("Mode", 0, modes));
|
||||
|
||||
this.registerSetting(boostSetting = new SliderSetting("Horizontal boost", 1.7, 0.0, 2.0, 0.05));
|
||||
|
||||
this.registerSetting(verticalMotion = new SliderSetting("Vertical motion", 0, 0.4, 0.9, 0.01));
|
||||
this.registerSetting(motionDecay = new SliderSetting("Motion decay", 17, 1, 40, 1));
|
||||
this.registerSetting(allowStrafe = new ButtonSetting("Allow strafe", false));
|
||||
|
|
@ -67,9 +74,10 @@ public class LongJump extends Module {
|
|||
this.registerSetting(hideExplosion = new ButtonSetting("Hide explosion", false));
|
||||
|
||||
this.registerSetting(temporaryFlightKey = new KeySetting("Vertical key", Keyboard.KEY_SPACE));
|
||||
}
|
||||
|
||||
//this.registerSetting(new DescriptionSetting("Dev:"));
|
||||
//this.registerSetting(pitchVal = new SliderSetting("Stop movement Pitch", 55, 55, 80, 0.1));
|
||||
public void guiUpdate() {
|
||||
//temporaryFlightKey.isVisible = mode.getInput() == 0;
|
||||
}
|
||||
|
||||
public void onEnable() {
|
||||
|
|
@ -136,6 +144,7 @@ public class LongJump extends Module {
|
|||
disable();
|
||||
return;
|
||||
}
|
||||
if (mode.getInput() == 0) {
|
||||
if (boostTicks > 0) {
|
||||
modifyVertical(); // has to be onPreUpdate
|
||||
//Utils.print("Modifying vertical");
|
||||
|
|
@ -144,6 +153,7 @@ public class LongJump extends Module {
|
|||
//Utils.print("Speed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stopMovement.isToggled() && !notMoving) {
|
||||
if (stopTime > 0) {
|
||||
|
|
@ -190,6 +200,8 @@ public class LongJump extends Module {
|
|||
mc.thePlayer.inventory.currentItem = fireballSlot; // we are probably already on the slot but make sure
|
||||
fireballTime = System.currentTimeMillis();
|
||||
Reflection.rightClick();
|
||||
mc.thePlayer.swingItem();
|
||||
mc.getItemRenderer().resetEquippedProgress();
|
||||
stopVelocity = true;
|
||||
//Utils.print("Right click");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import keystrokesmod.module.setting.impl.ButtonSetting;
|
|||
import keystrokesmod.module.setting.impl.DescriptionSetting;
|
||||
import keystrokesmod.module.setting.impl.SliderSetting;
|
||||
import keystrokesmod.utility.*;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
|
@ -73,17 +74,7 @@ public class NoSlow extends Module {
|
|||
}
|
||||
break;
|
||||
case 4:
|
||||
if (reSendConsume) {
|
||||
if (mc.thePlayer.onGround) {
|
||||
mc.thePlayer.jump();
|
||||
break;
|
||||
}
|
||||
else {
|
||||
mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, mc.thePlayer.getHeldItem());
|
||||
canFloat = true;
|
||||
reSendConsume = false;
|
||||
}
|
||||
}
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -101,8 +92,9 @@ public class NoSlow extends Module {
|
|||
@SubscribeEvent
|
||||
public void onPostPlayerInput(PostPlayerInputEvent e) {
|
||||
if ((canFloat && mc.thePlayer.onGround)) {
|
||||
if (groundSpeedOption.isToggled() && !Utils.jumpDown() && !ModuleManager.bhop.isEnabled() && Utils.isMoving() && !Utils.bowBackwards()) {
|
||||
if (groundSpeedOption.isToggled() && !Utils.jumpDown() && !ModuleManager.bhop.isEnabled() && Utils.keysDown() && !Utils.bowBackwards()) {
|
||||
Utils.setSpeed(getSpeedModifier());
|
||||
//Utils.print("ground speed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -114,20 +106,26 @@ public class NoSlow extends Module {
|
|||
return;
|
||||
}
|
||||
postPlace = false;
|
||||
if (!Mouse.isButtonDown(1)) {
|
||||
if (!Mouse.isButtonDown(1) || (mc.thePlayer.getHeldItem() == null || !holdingConsumable(mc.thePlayer.getHeldItem()))) {
|
||||
resetFloat();
|
||||
noSlowing = false;
|
||||
//Utils.print("!Noslowing");
|
||||
return;
|
||||
}
|
||||
if (reSendConsume) {
|
||||
if (!mc.thePlayer.onGround) {
|
||||
if (ModuleUtils.inAirTicks > 1) {
|
||||
mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, mc.thePlayer.getHeldItem());
|
||||
canFloat = true;
|
||||
reSendConsume = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!canFloat) {
|
||||
return;
|
||||
}
|
||||
if (canFloat) {
|
||||
e.setPosY(e.getPosY() + 1E-14);
|
||||
e.setPosY(e.getPosY() + 1E-11);
|
||||
noSlowing = true;
|
||||
//Utils.print("Noslowing");
|
||||
}
|
||||
if (mc.thePlayer.onGround) {
|
||||
if (mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= 0 && Utils.isMoving()) {
|
||||
setRotation = true;
|
||||
|
|
@ -138,7 +136,7 @@ public class NoSlow extends Module {
|
|||
if (Utils.noSlowingBackWithBow()) setRotation = false;
|
||||
if (groundSpeedOption.isToggled()) {
|
||||
if (setRotation) {
|
||||
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow()) {
|
||||
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !Utils.jumpDown()) {
|
||||
float playerYaw = mc.thePlayer.rotationYaw;
|
||||
e.setYaw(playerYaw -= 55);
|
||||
}
|
||||
|
|
@ -149,14 +147,14 @@ public class NoSlow extends Module {
|
|||
@SubscribeEvent
|
||||
public void onPacketSend(SendPacketEvent e) {
|
||||
if (e.getPacket() instanceof C08PacketPlayerBlockPlacement && mode.getInput() == 4 && getSlowed() != 0.2f && holdingConsumable(((C08PacketPlayerBlockPlacement) e.getPacket()).getStack()) && !BlockUtils.isInteractable(mc.objectMouseOver) && Utils.holdingEdible(((C08PacketPlayerBlockPlacement) e.getPacket()).getStack())) {
|
||||
if (ModuleManager.skyWars.isEnabled() && Utils.getSkyWarsStatus() == 1 || canFloat) {
|
||||
if (ModuleManager.skyWars.isEnabled() && Utils.getSkyWarsStatus() == 1 || canFloat || reSendConsume) {
|
||||
return;
|
||||
}
|
||||
if (!mc.thePlayer.onGround) {
|
||||
canFloat = true;
|
||||
}
|
||||
else {
|
||||
if (mc.thePlayer.onGround) {
|
||||
if (!Utils.jumpDown()) {
|
||||
mc.thePlayer.jump();
|
||||
}
|
||||
reSendConsume = true;
|
||||
|
|
@ -193,7 +191,7 @@ public class NoSlow extends Module {
|
|||
}
|
||||
|
||||
public static boolean groundSpeed() {
|
||||
return groundSpeedOption.isToggled() && noSlowing;
|
||||
return groundSpeedOption.isToggled() && noSlowing && Utils.isMoving() && !Utils.jumpDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package keystrokesmod.module.impl.movement;
|
||||
|
||||
import keystrokesmod.event.PreMotionEvent;
|
||||
import keystrokesmod.event.PreUpdateEvent;
|
||||
import keystrokesmod.mixins.impl.entity.IAccessorEntityPlayerSP;
|
||||
import keystrokesmod.module.Module;
|
||||
import keystrokesmod.module.ModuleManager;
|
||||
import keystrokesmod.module.setting.impl.ButtonSetting;
|
||||
|
|
@ -12,6 +14,7 @@ import net.minecraft.client.gui.GuiButton;
|
|||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.fml.client.config.GuiButtonExt;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
|
|
@ -22,9 +25,12 @@ public class Sprint extends Module {
|
|||
private ButtonSetting displayText;
|
||||
private ButtonSetting rainbow;
|
||||
public SliderSetting omniDirectional;
|
||||
public ButtonSetting disableBackwards;
|
||||
public String text = "[Sprint (Toggled)]";
|
||||
public float posX = 5;
|
||||
public float posY = 5;
|
||||
private float limit;
|
||||
public boolean disableBack;
|
||||
|
||||
private String[] omniDirectionalModes = new String[] { "Disabled", "Vanilla", "Hypixel" };
|
||||
|
||||
|
|
@ -37,19 +43,19 @@ public class Sprint extends Module {
|
|||
this.registerSetting(displayText = new ButtonSetting("Display text", false));
|
||||
this.registerSetting(rainbow = new ButtonSetting("Rainbow", false));
|
||||
this.registerSetting(omniDirectional = new SliderSetting("Omni-Directional", 0, omniDirectionalModes));
|
||||
this.registerSetting(disableBackwards = new ButtonSetting("Disable backwards", false));
|
||||
this.closetModule = true;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPreMotion(PreMotionEvent e) {
|
||||
|
||||
if (Utils.noSlowingBackWithBow()) {
|
||||
ModuleManager.bhop.setRotation = false;
|
||||
return;
|
||||
}
|
||||
if (ModuleManager.sprint.isEnabled() && ModuleManager.sprint.omniDirectional.getInput() == 2) {
|
||||
if (mc.thePlayer.onGround && mc.thePlayer.moveStrafing == 0 && mc.thePlayer.moveForward <= -0.5 && !Utils.jumpDown()) {
|
||||
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.safeWalk.canSafeWalk() && !ModuleManager.scaffold.isEnabled && !ModuleManager.bhop.isEnabled()) {
|
||||
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.safeWalk.canSafeWalk() && !ModuleManager.scaffold.isEnabled && !ModuleManager.bhop.isEnabled() && !mc.thePlayer.isCollidedHorizontally) {
|
||||
float playerYaw = mc.thePlayer.rotationYaw;
|
||||
e.setYaw(playerYaw -= 55);
|
||||
}
|
||||
|
|
@ -57,6 +63,29 @@ public class Sprint extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPreUpdate(PreUpdateEvent e) {
|
||||
limit = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw - ((IAccessorEntityPlayerSP) mc.thePlayer).getLastReportedYaw() );
|
||||
//Utils.print("" + limit);
|
||||
|
||||
double limitVal = 135;
|
||||
if (!disableBackwards.isToggled()) {
|
||||
disableBack = false;
|
||||
return;
|
||||
}
|
||||
if (exceptions()) {
|
||||
disableBack = false;
|
||||
return;
|
||||
}
|
||||
if ((limit <= -limitVal || limit >= limitVal) || omniSprint() && ModuleManager.killAura.isTargeting && mc.thePlayer.moveForward <= 0.5) {
|
||||
disableBack = true;
|
||||
//Utils.print("Disable sprint");
|
||||
}
|
||||
else {
|
||||
disableBack = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void onUpdate() {
|
||||
if (Utils.nullCheck() && mc.inGameHasFocus) {
|
||||
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSprint.getKeyCode(), true);
|
||||
|
|
@ -87,6 +116,10 @@ public class Sprint extends Module {
|
|||
return false;
|
||||
}
|
||||
|
||||
private boolean exceptions() {
|
||||
return ModuleManager.scaffold.isEnabled || mc.thePlayer.hurtTime > 0;
|
||||
}
|
||||
|
||||
static class EditScreen extends GuiScreen {
|
||||
GuiButtonExt resetPosition;
|
||||
boolean d = false;
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public class BedAura extends Module {
|
|||
aiming = false;
|
||||
if ((rotate || breakProgress >= 1 || breakProgress == 0) && (currentBlock != null || rotateLastBlock != null)) {
|
||||
float[] rotations = RotationUtils.getRotations(currentBlock == null ? rotateLastBlock : currentBlock, e.getYaw(), e.getPitch());
|
||||
if (currentBlock != null && !RotationUtils.inRange(currentBlock, range.getInput())) {
|
||||
if (currentBlock == null || !RotationUtils.inRange(currentBlock, range.getInput())) {
|
||||
return;
|
||||
}
|
||||
e.setYaw(RotationUtils.applyVanilla(rotations[0]));
|
||||
|
|
@ -338,6 +338,7 @@ public class BedAura extends Module {
|
|||
stopAutoblock = false;
|
||||
noAutoBlockTicks = 0;
|
||||
rotateLastBlock = null;
|
||||
previousBlockBroken = null;
|
||||
}
|
||||
|
||||
public void setPacketSlot(int slot) {
|
||||
|
|
@ -352,6 +353,7 @@ public class BedAura extends Module {
|
|||
Utils.sendModuleMessage(this, "sending c07 &astart &7break &7(&b" + mc.thePlayer.ticksExisted + "&7)");
|
||||
}
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, blockPos, EnumFacing.UP));
|
||||
stopAutoblock = true;
|
||||
}
|
||||
|
||||
private void stopBreak(BlockPos blockPos) {
|
||||
|
|
@ -359,6 +361,7 @@ public class BedAura extends Module {
|
|||
Utils.sendModuleMessage(this, "sending c07 &cstop &7break &7(&b" + mc.thePlayer.ticksExisted + "&7)");
|
||||
}
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, blockPos, EnumFacing.UP));
|
||||
stopAutoblock = false;
|
||||
}
|
||||
|
||||
private void swing() {
|
||||
|
|
@ -425,7 +428,6 @@ public class BedAura extends Module {
|
|||
if (!disableBreakEffects.isToggled()) {
|
||||
mc.playerController.onPlayerDestroyBlock(blockPos, EnumFacing.UP);
|
||||
}
|
||||
rotate = true;
|
||||
rotateLastBlock = previousBlockBroken;
|
||||
return;
|
||||
}
|
||||
|
|
@ -448,7 +450,7 @@ public class BedAura extends Module {
|
|||
stopAutoblock = true; // if blocking then return and stop autoblocking
|
||||
}
|
||||
if (breakProgress >= lastProgress) {
|
||||
rotate = true;
|
||||
|
||||
}
|
||||
}
|
||||
breakProgress += progress;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class Blink extends Module {
|
|||
if (packet.getClass().getSimpleName().startsWith("S")) {
|
||||
return;
|
||||
}
|
||||
if (packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) {
|
||||
if (packet instanceof C00PacketKeepAlive || packet instanceof C00PacketLoginStart || packet instanceof C00Handshake) {
|
||||
return;
|
||||
}
|
||||
started = true;
|
||||
|
|
|
|||
|
|
@ -2,18 +2,21 @@ package keystrokesmod.module.impl.player;
|
|||
|
||||
import keystrokesmod.module.Module;
|
||||
import keystrokesmod.module.setting.impl.ButtonSetting;
|
||||
import keystrokesmod.module.setting.impl.SliderSetting;
|
||||
import keystrokesmod.utility.Reflection;
|
||||
import keystrokesmod.utility.Utils;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
|
||||
public class DelayRemover extends Module {
|
||||
public static ButtonSetting oldReg, removeJumpTicks;
|
||||
public static ButtonSetting oldReg;
|
||||
public static SliderSetting removeJumpTicks;
|
||||
private String[] removeJumpTicksModes = new String[] { "Disabled", "0", "Hypixel" };
|
||||
|
||||
public DelayRemover() {
|
||||
super("Delay Remover", category.player, 0);
|
||||
this.registerSetting(oldReg = new ButtonSetting("1.7 hitreg", true));
|
||||
this.registerSetting(removeJumpTicks = new ButtonSetting("Remove jump ticks", false));
|
||||
this.registerSetting(removeJumpTicks = new SliderSetting("Remove jump ticks", 0, removeJumpTicksModes));
|
||||
this.closetModule = true;
|
||||
}
|
||||
|
||||
|
|
@ -29,7 +32,7 @@ public class DelayRemover extends Module {
|
|||
} catch (IndexOutOfBoundsException ex2) {
|
||||
}
|
||||
}
|
||||
if (removeJumpTicks.isToggled()) {
|
||||
if (removeJumpTicks.getInput() == 1 || removeJumpTicks.getInput() == 2 && removeJumpDelay()) {
|
||||
try {
|
||||
Reflection.jumpTicks.set(mc.thePlayer, 0);
|
||||
} catch (IllegalAccessException ex3) {
|
||||
|
|
@ -37,4 +40,8 @@ public class DelayRemover extends Module {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean removeJumpDelay() {
|
||||
return !mc.thePlayer.onGround && mc.thePlayer.isCollidedVertically;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class NoFall extends Module {
|
|||
private SliderSetting minFallDistance;
|
||||
private ButtonSetting disableAdventure;
|
||||
private ButtonSetting ignoreVoid;
|
||||
private String[] modes = new String[]{"Spoof", "Packet", "NoGround"};
|
||||
private String[] modes = new String[]{"Spoof", "NoGround", "Packet A", "Packet B"};
|
||||
|
||||
private double initialY;
|
||||
private double dynamic;
|
||||
|
|
@ -32,7 +32,7 @@ public class NoFall extends Module {
|
|||
|
||||
public NoFall() {
|
||||
super("NoFall", category.player);
|
||||
this.registerSetting(mode = new SliderSetting("Mode", 0, modes));
|
||||
this.registerSetting(mode = new SliderSetting("Mode", 2, modes));
|
||||
this.registerSetting(disableAdventure = new ButtonSetting("Disable adventure", false));
|
||||
this.registerSetting(minFallDistance = new SliderSetting("Minimum fall distance", 3, 0, 10, 0.1));
|
||||
this.registerSetting(ignoreVoid = new ButtonSetting("Ignore void", true));
|
||||
|
|
@ -70,16 +70,21 @@ public class NoFall extends Module {
|
|||
if (mc.thePlayer.motionY < -2.4) {
|
||||
dynamic = 4.5;
|
||||
}
|
||||
if (isFalling || mode.getInput() == 2) {
|
||||
switch ((int) mode.getInput()) {
|
||||
case 1:
|
||||
if (isFalling && mode.getInput() == 2) {
|
||||
if (distanceFallen >= dynamic) {
|
||||
Utils.getTimer().timerSpeed = (float) 0.72;
|
||||
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
|
||||
initialY = mc.thePlayer.posY;
|
||||
edging = "nofall packet";
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (isFalling && mode.getInput() == 3) {
|
||||
Utils.getTimer().timerSpeed = (float) 1;
|
||||
if (distanceFallen >= 3) {
|
||||
Utils.getTimer().timerSpeed = (float) 0.5;
|
||||
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
|
||||
initialY = mc.thePlayer.posY;
|
||||
edging = "nofall packet";
|
||||
}
|
||||
}
|
||||
edging += " " + dynamic;
|
||||
|
|
@ -92,7 +97,7 @@ public class NoFall extends Module {
|
|||
case 0:
|
||||
e.setOnGround(true);
|
||||
break;
|
||||
case 2:
|
||||
case 1:
|
||||
e.setOnGround(false);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class NoRotate extends Module {
|
|||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (mc.thePlayer == null || (mc.thePlayer.rotationPitch % 1 == 0f && mc.thePlayer.rotationYaw % 1 == 0f)) {
|
||||
if (mc.thePlayer == null || mc.thePlayer.rotationPitch == 0) {
|
||||
return;
|
||||
}
|
||||
prevPitch = mc.thePlayer.rotationPitch % 360;
|
||||
|
|
@ -26,7 +26,7 @@ public class NoRotate extends Module {
|
|||
if (!this.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (packet.getPitch() % 1.0f == 0.0f || mc.thePlayer == null) {
|
||||
if (packet.getPitch() == 0 || mc.thePlayer == null) {
|
||||
return;
|
||||
}
|
||||
mc.thePlayer.prevRotationYaw = prevYaw;
|
||||
|
|
|
|||
|
|
@ -30,27 +30,23 @@ import java.util.*;
|
|||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class Scaffold extends Module {
|
||||
private static SliderSetting motion;
|
||||
public static SliderSetting rotation;
|
||||
private static SliderSetting sprint;
|
||||
private static SliderSetting fastScaffold;
|
||||
private static SliderSetting multiPlace;
|
||||
public static ButtonSetting autoSwap;
|
||||
private static ButtonSetting cancelKnockBack;
|
||||
private static ButtonSetting fastOnRMB;
|
||||
public static ButtonSetting highlightBlocks;
|
||||
private static ButtonSetting jumpFacingForward;
|
||||
public static ButtonSetting safeWalk;
|
||||
public static ButtonSetting showBlockCount;
|
||||
private static ButtonSetting silentSwing;
|
||||
public static ButtonSetting tower;
|
||||
private SliderSetting motion;
|
||||
public SliderSetting rotation;
|
||||
private SliderSetting sprint;
|
||||
private SliderSetting fastScaffold;
|
||||
private SliderSetting multiPlace;
|
||||
public ButtonSetting autoSwap;
|
||||
private ButtonSetting cancelKnockBack;
|
||||
private ButtonSetting fastOnRMB;
|
||||
public ButtonSetting highlightBlocks;
|
||||
private ButtonSetting jumpFacingForward;
|
||||
public ButtonSetting safeWalk;
|
||||
public ButtonSetting showBlockCount;
|
||||
private ButtonSetting silentSwing;
|
||||
|
||||
private static SliderSetting yaww2;
|
||||
private static SliderSetting minO;
|
||||
|
||||
private static String[] rotationModes = new String[] { "None", "Simple", "Offset", "Precise" };
|
||||
private static String[] sprintModes = new String[] { "None", "Vanilla", "Float" };
|
||||
private static String[] fastScaffoldModes = new String[] { "None", "Jump B", "Jump B Low", "Jump E", "Keep-Y", "Keep-Y Low" };
|
||||
private String[] rotationModes = new String[] { "None", "Simple", "Offset", "Precise" };
|
||||
private String[] sprintModes = new String[] { "None", "Vanilla", "Float" };
|
||||
private String[] fastScaffoldModes = new String[] { "None", "Jump B", "Jump B Low", "Jump E", "Keep-Y", "Keep-Y Low" };
|
||||
private String[] multiPlaceModes = new String[] { "Disabled", "1 extra", "2 extra" };
|
||||
|
||||
public Map<BlockPos, Timer> highlight = new HashMap<>();
|
||||
|
|
@ -115,7 +111,6 @@ public class Scaffold extends Module {
|
|||
this.registerSetting(safeWalk = new ButtonSetting("Safewalk", true));
|
||||
this.registerSetting(showBlockCount = new ButtonSetting("Show block count", true));
|
||||
this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false));
|
||||
this.registerSetting(tower = new ButtonSetting("Tower", false));
|
||||
|
||||
//this.registerSetting(yaww2 = new SliderSetting("yaw offset", "", 138, 110, 160, 1));
|
||||
//this.registerSetting(minO = new SliderSetting("min offset", "", 30, 1, 90, 1));
|
||||
|
|
@ -211,7 +206,7 @@ public class Scaffold extends Module {
|
|||
if (floatStarted && mc.thePlayer.onGround) {
|
||||
floatKeepY = false;
|
||||
startYPos = -1;
|
||||
if (moduleEnabled && !Utils.jumpDown()) e.setPosY(e.getPosY() + 1E-14);
|
||||
if (moduleEnabled && !Utils.jumpDown()) e.setPosY(e.getPosY() + 1E-11);
|
||||
if (Utils.isMoving()) Utils.setSpeed(getFloatSpeed(getSpeedLevel()));
|
||||
}
|
||||
} else if (floatWasEnabled) {
|
||||
|
|
@ -239,8 +234,8 @@ public class Scaffold extends Module {
|
|||
float main = MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw);
|
||||
float mainOffset = MathHelper.wrapAngleTo180_float(yawBackwards - lastBlockYaw);
|
||||
float mainOffset2 = MathHelper.wrapAngleTo180_float(yawBackwards - lastBlockYaw);
|
||||
rotOffset = (!Utils.scaffoldDiagonal(false)) ? 125F : 142F;
|
||||
float minOffset = 40;
|
||||
rotOffset = (!Utils.scaffoldDiagonal(false)) ? 132F : 140F;
|
||||
float minOffset = (!Utils.scaffoldDiagonal(false)) ? 40 : 15;
|
||||
if (blockRotations != null) {
|
||||
e.setYaw(blockRotations[0]);
|
||||
e.setPitch(blockRotations[1]);
|
||||
|
|
@ -304,10 +299,6 @@ public class Scaffold extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
if (rotation.getInput() == 1) {
|
||||
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw());
|
||||
}
|
||||
|
||||
if (e.getPitch() > 89) {
|
||||
e.setPitch(89);
|
||||
}
|
||||
|
|
@ -318,14 +309,22 @@ public class Scaffold extends Module {
|
|||
else {
|
||||
lastBlockYaw = lastYaw;
|
||||
if (rotation.getInput() == 2) {
|
||||
//e.setYaw(offsetRotation() - mainOffset);
|
||||
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw() - 165);
|
||||
/*if (main >= 0) {
|
||||
mainOffset2 = 25;
|
||||
}
|
||||
else if (main <= -0) {
|
||||
mainOffset2 = -25;
|
||||
}*/
|
||||
e.setYaw(offsetRotation());
|
||||
}
|
||||
else {
|
||||
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw());
|
||||
}
|
||||
e.setPitch(getPitch);
|
||||
}
|
||||
if (rotation.getInput() == 1) {
|
||||
e.setYaw(MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw());
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -344,6 +343,9 @@ public class Scaffold extends Module {
|
|||
private float yaw;
|
||||
|
||||
private float offsetRotation() {
|
||||
if (!Utils.isMoving() || Utils.getHorizontalSpeed() == 0.0D) {
|
||||
return yaw;
|
||||
}
|
||||
|
||||
float newYaw = getMotionYaw() - rotOffset * Math.signum(
|
||||
MathHelper.wrapAngleTo180_float(getMotionYaw() - yaw)
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ public class Tower extends Module {
|
|||
}
|
||||
|
||||
private boolean modulesEnabled() {
|
||||
return (ModuleManager.scaffold.moduleEnabled && ModuleManager.scaffold.holdingBlocks() && ModuleManager.scaffold.tower.isToggled() && ModuleManager.scaffold.hasSwapped && !ModuleManager.LongJump.isEnabled());
|
||||
return (ModuleManager.scaffold.moduleEnabled && ModuleManager.scaffold.holdingBlocks() && ModuleManager.scaffold.hasSwapped && !ModuleManager.LongJump.isEnabled());
|
||||
}
|
||||
|
||||
private int getSpeedLevel() {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ package keystrokesmod.module.setting;
|
|||
import com.google.gson.JsonObject;
|
||||
|
||||
public abstract class Setting {
|
||||
|
||||
public boolean isVisible = true;
|
||||
|
||||
public String n;
|
||||
|
||||
public Setting(String n) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import keystrokesmod.Raven;
|
|||
import keystrokesmod.module.Module;
|
||||
import keystrokesmod.module.setting.impl.ButtonSetting;
|
||||
import keystrokesmod.script.classes.Entity;
|
||||
import keystrokesmod.script.classes.Image;
|
||||
import keystrokesmod.script.classes.NetworkPlayer;
|
||||
import keystrokesmod.utility.Utils;
|
||||
import keystrokesmod.utility.profile.ProfileModule;
|
||||
import org.lwjgl.Sys;
|
||||
|
|
@ -32,9 +34,11 @@ public class Manager extends Module {
|
|||
}
|
||||
else {
|
||||
double timeTaken = Utils.round((System.currentTimeMillis() - currentTimeMillis) / 1000.0, 1);
|
||||
Utils.sendMessage("&7Loaded &b" + Raven.scriptManager.scripts.size() + " &7script" + ((Raven.scriptManager.scripts.size() == 1) ? "" : "s") + " in &b" + (Utils.isWholeNumber(timeTaken) ? (int) timeTaken + "" : timeTaken) + "&7s.");
|
||||
Utils.sendMessage("&7Loaded &b" + Raven.scriptManager.scripts.size() + " &7script" + ((Raven.scriptManager.scripts.size() == 1) ? "" : "s") + " in &b" + Utils.asWholeNum(timeTaken) + "&7s.");
|
||||
}
|
||||
Entity.clearCache();
|
||||
NetworkPlayer.clearCache();
|
||||
Image.clearCache();
|
||||
if (Raven.currentProfile != null && Raven.currentProfile.getModule() != null) {
|
||||
((ProfileModule) Raven.currentProfile.getModule()).saved = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import java.io.File;
|
|||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.*;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import net.minecraft.client.renderer.*;
|
|||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.resources.IResourcePack;
|
||||
import net.minecraft.client.resources.ResourcePackRepository;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
|
@ -45,17 +44,19 @@ import org.lwjgl.opengl.Display;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.util.glu.GLU;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
public class ScriptDefaults {
|
||||
private static ExecutorService cachedExecutor;
|
||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||
public static final Bridge bridge = new Bridge();
|
||||
private static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);
|
||||
|
||||
public static class client {
|
||||
public static boolean allowFlying() {
|
||||
|
|
@ -85,8 +86,11 @@ public class ScriptDefaults {
|
|||
Utils.addFriend(username);
|
||||
}
|
||||
|
||||
public static void async(Runnable method) {
|
||||
executor.execute(method);
|
||||
public static void async(final Runnable method) {
|
||||
if (cachedExecutor == null) {
|
||||
cachedExecutor = Executors.newCachedThreadPool();
|
||||
}
|
||||
cachedExecutor.execute(method);
|
||||
}
|
||||
|
||||
public static int getFPS() {
|
||||
|
|
@ -110,10 +114,6 @@ public class ScriptDefaults {
|
|||
return Utils.isDiagonal(false);
|
||||
}
|
||||
|
||||
public static boolean isHoldingWeapon() {
|
||||
return Utils.holdingWeapon();
|
||||
}
|
||||
|
||||
public static void setTimer(float timer) {
|
||||
Utils.getTimer().timerSpeed = timer;
|
||||
}
|
||||
|
|
@ -130,6 +130,30 @@ public class ScriptDefaults {
|
|||
PacketUtils.receivePacketNoEvent(packet.packet);
|
||||
}
|
||||
|
||||
public static String getTitle() {
|
||||
try {
|
||||
return (String) Reflection.displayedTitle.get(mc.ingameGUI);
|
||||
}
|
||||
catch (IllegalAccessException ignored) {}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getSubTitle() {
|
||||
try {
|
||||
return (String) Reflection.displayedSubTitle.get(mc.ingameGUI);
|
||||
}
|
||||
catch (IllegalAccessException ignored) {}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getRecordPlaying() {
|
||||
try {
|
||||
return (String) Reflection.recordPlaying.get(mc.ingameGUI);
|
||||
}
|
||||
catch (IllegalAccessException ignored) {}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static boolean isFlying() {
|
||||
return mc.thePlayer.capabilities.isFlying;
|
||||
}
|
||||
|
|
@ -212,18 +236,22 @@ public class ScriptDefaults {
|
|||
return mc.thePlayer.capabilities.allowEdit;
|
||||
}
|
||||
|
||||
public static void setItemInUseCount(int count) {
|
||||
Reflection.setItemInUseCount(count);
|
||||
}
|
||||
|
||||
public static int getItemInUseCount() {
|
||||
return mc.thePlayer.getItemInUseCount();
|
||||
}
|
||||
|
||||
public static int getItemInUseDuration() {
|
||||
return mc.thePlayer.getItemInUseDuration();
|
||||
}
|
||||
|
||||
public static void log(String message) {
|
||||
System.out.println(message);
|
||||
}
|
||||
|
||||
public static boolean isMouseDown(int button) {
|
||||
return Mouse.isButtonDown(button);
|
||||
}
|
||||
|
||||
public static boolean isKeyDown(int key) {
|
||||
return Keyboard.isKeyDown(key);
|
||||
}
|
||||
|
||||
public static void setSneaking(boolean sneak) {
|
||||
mc.thePlayer.setSneaking(sneak);
|
||||
}
|
||||
|
|
@ -263,8 +291,7 @@ public class ScriptDefaults {
|
|||
try {
|
||||
Thread.sleep(ms);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
}
|
||||
catch (InterruptedException ignored) {}
|
||||
}
|
||||
|
||||
public static void ping() {
|
||||
|
|
@ -296,6 +323,23 @@ public class ScriptDefaults {
|
|||
}
|
||||
}
|
||||
|
||||
public static String getTabHeader() {
|
||||
try {
|
||||
return (String) Reflection.tabHeader.get(mc.ingameGUI.getTabList());
|
||||
}
|
||||
catch (IllegalAccessException ignored) {}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getTabFooter() {
|
||||
try {
|
||||
return (String) Reflection.tabFooter.get(mc.ingameGUI.getTabList());
|
||||
}
|
||||
catch (IllegalAccessException ignored) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static float getForward() {
|
||||
return mc.thePlayer.movementInput.moveForward;
|
||||
}
|
||||
|
|
@ -366,7 +410,7 @@ public class ScriptDefaults {
|
|||
return new int[]{scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), scaledResolution.getScaleFactor()};
|
||||
}
|
||||
|
||||
public float getServerDirection(PlayerState state) {
|
||||
public static float getServerDirection(PlayerState state) {
|
||||
return state.yaw;
|
||||
}
|
||||
|
||||
|
|
@ -374,6 +418,10 @@ public class ScriptDefaults {
|
|||
return raycastBlock(distance, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true);
|
||||
}
|
||||
|
||||
public static Object[] raycastBlock(double distance, float yaw, float pitch) {
|
||||
return raycastBlock(distance, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true);
|
||||
}
|
||||
|
||||
public static Object[] raycastBlock(double distance, float yaw, float pitch, boolean collisionCheck) {
|
||||
MovingObjectPosition hit = RotationUtils.rayCast(distance, yaw, pitch, collisionCheck);
|
||||
if (hit == null || hit.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
|
|
@ -469,7 +517,7 @@ public class ScriptDefaults {
|
|||
public static List<NetworkPlayer> getNetworkPlayers() {
|
||||
List<NetworkPlayer> entities = new ArrayList<>();
|
||||
for (NetworkPlayerInfo networkPlayerInfo : Utils.getTablist(false)) {
|
||||
entities.add(new NetworkPlayer(networkPlayerInfo));
|
||||
entities.add(NetworkPlayer.convert(networkPlayerInfo));
|
||||
}
|
||||
return entities;
|
||||
}
|
||||
|
|
@ -517,20 +565,18 @@ public class ScriptDefaults {
|
|||
public modules(String superName) {
|
||||
this.superName = superName;
|
||||
}
|
||||
|
||||
private Module getModule(String moduleName) {
|
||||
boolean found = false;
|
||||
for (Module module : Raven.getModuleManager().getModules()) {
|
||||
if (module.getName().equals(moduleName)) {
|
||||
return module;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
for (Module module : Raven.scriptManager.scripts.values()) {
|
||||
if (module.getName().equals(moduleName)) {
|
||||
return module;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -620,14 +666,6 @@ public class ScriptDefaults {
|
|||
return new Vec3(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||
}
|
||||
|
||||
public boolean isScaffolding() {
|
||||
return ModuleManager.scaffold.isEnabled && ModuleManager.scaffold.tower.isToggled();
|
||||
}
|
||||
|
||||
public boolean isTowering() {
|
||||
return ModuleManager.tower.canTower();
|
||||
}
|
||||
|
||||
public boolean isHidden(String moduleName) {
|
||||
Module module = getModule(moduleName);
|
||||
if (module != null) {
|
||||
|
|
@ -852,13 +890,74 @@ public class ScriptDefaults {
|
|||
}
|
||||
}
|
||||
|
||||
public static class config {
|
||||
private static String CONFIG_DIR = mc.mcDataDir + File.separator + "keystrokes" + File.separator + "script_config.txt";
|
||||
private static String SEPARATOR = ":";
|
||||
private static String SEPARATOR_FULL = config.SEPARATOR + " ";
|
||||
|
||||
private static void ensureConfigFileExists() throws IOException {
|
||||
final Path configPath = Paths.get(config.CONFIG_DIR);
|
||||
if (Files.notExists(configPath)) {
|
||||
Files.createDirectories(configPath.getParent());
|
||||
Files.createFile(configPath);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean set(String key, final String value) {
|
||||
if (key == null || key.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
key = key.replace(config.SEPARATOR, "");
|
||||
final String entry = key + config.SEPARATOR_FULL + value;
|
||||
try {
|
||||
ensureConfigFileExists();
|
||||
final Path configPath = new File(config.CONFIG_DIR).toPath();
|
||||
final List<String> lines = new ArrayList<>(Files.readAllLines(configPath));
|
||||
boolean keyExists = false;
|
||||
for (int i = 0; i < lines.size(); ++i) {
|
||||
final String line = lines.get(i);
|
||||
if (line.startsWith(key + config.SEPARATOR_FULL)) {
|
||||
lines.set(i, entry);
|
||||
keyExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!keyExists) {
|
||||
lines.add(entry);
|
||||
}
|
||||
Files.write(configPath, lines);
|
||||
return true;
|
||||
}
|
||||
catch (IOException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String get(final String key) {
|
||||
if (key == null || key.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
ensureConfigFileExists();
|
||||
final Path configPath = new File(config.CONFIG_DIR).toPath();
|
||||
final List<String> lines = Files.readAllLines(configPath);
|
||||
for (final String line : lines) {
|
||||
if (line.startsWith(key + config.SEPARATOR_FULL)) {
|
||||
return line.substring((key + config.SEPARATOR_FULL).length());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException ex) {}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class render {
|
||||
private static final IntBuffer VIEWPORT = GLAllocation.createDirectIntBuffer(16);
|
||||
private static final FloatBuffer MODELVIEW = GLAllocation.createDirectFloatBuffer(16);
|
||||
private static final FloatBuffer PROJECTION = GLAllocation.createDirectFloatBuffer(16);
|
||||
private static final FloatBuffer SCREEN_COORDS = GLAllocation.createDirectFloatBuffer(3);
|
||||
|
||||
|
||||
public static void block(Vec3 position, int color, boolean outline, boolean shade) {
|
||||
RenderUtils.renderBlock(new BlockPos(position.x, position.y, position.z), color, outline, shade);
|
||||
}
|
||||
|
|
@ -908,10 +1007,6 @@ public class ScriptDefaults {
|
|||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void text(String text, float x, float y, int color, boolean shadow) {
|
||||
mc.fontRendererObj.drawString(text, x, y, color, shadow);
|
||||
}
|
||||
|
||||
public static void resetEquippedProgress() {
|
||||
mc.getItemRenderer().resetEquippedProgress();
|
||||
}
|
||||
|
|
@ -985,6 +1080,14 @@ public class ScriptDefaults {
|
|||
RoundedUtils.drawRoundedRectRise(startX, startY, Math.abs(startX - endX), Math.abs(startY - endY), radius, color);
|
||||
}
|
||||
|
||||
public static void gradientRect(float startX, float startY, float endX, float endY, int leftColor, int rightColor) {
|
||||
gradientRect(startX, startY, endX, endY, leftColor, leftColor, rightColor, rightColor);
|
||||
}
|
||||
|
||||
public static void gradientRect(float startX, float startY, float endX, float endY, int topLeftColor, int bottomLeftColor, int topRightColor, int bottomRightColor) {
|
||||
RenderUtils.drawRoundedGradientRect(startX, startY, endX, endY, 0, topLeftColor, bottomLeftColor, topRightColor, bottomRightColor);
|
||||
}
|
||||
|
||||
public static double[] getRotations() {
|
||||
return new double[] { mc.getRenderManager().playerViewY, mc.getRenderManager().playerViewX };
|
||||
}
|
||||
|
|
@ -1006,7 +1109,7 @@ public class ScriptDefaults {
|
|||
return new Vec3(position);
|
||||
}
|
||||
|
||||
public static void text(String text, float x, float y, float scale, int color, boolean shadow) {
|
||||
public static void text2d(String text, float x, float y, float scale, int color, boolean shadow) {
|
||||
if (scale != 1.0f) {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.scale(scale, scale, scale);
|
||||
|
|
@ -1021,8 +1124,54 @@ public class ScriptDefaults {
|
|||
}
|
||||
}
|
||||
|
||||
public static void rect(float startX, float startY, float endX, float endY, int color) {
|
||||
RenderUtils.drawRectangleGL(startX, startY, endX, endY, color);
|
||||
public static void text3d(String text, float x, float y, float scale, int color, boolean shadow) {
|
||||
GlStateManager.pushMatrix();
|
||||
Reflection.setupCameraTransform(mc.entityRenderer, Utils.getTimer().renderPartialTicks, 0);
|
||||
mc.entityRenderer.setupOverlayRendering();
|
||||
if (scale != 1.0f) {
|
||||
GlStateManager.scale(scale, scale, scale);
|
||||
}
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
mc.fontRendererObj.drawString(text, x, y, color, shadow);
|
||||
GlStateManager.disableBlend();
|
||||
if (scale != 1.0f) {
|
||||
GlStateManager.scale(1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
public static void rect(float startX, float startY, float endX, float endY, final int color) {
|
||||
if (startX < endX) {
|
||||
final float i = startX;
|
||||
startX = endX;
|
||||
endX = i;
|
||||
}
|
||||
if (startY < endY) {
|
||||
final float j = startY;
|
||||
startY = endY;
|
||||
endY = j;
|
||||
}
|
||||
final float f3 = (color >> 24 & 0xFF) / 255.0f;
|
||||
final float f4 = (color >> 16 & 0xFF) / 255.0f;
|
||||
final float f5 = (color >> 8 & 0xFF) / 255.0f;
|
||||
final float f6 = (color & 0xFF) / 255.0f;
|
||||
final Tessellator tessellator = Tessellator.getInstance();
|
||||
final WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
GL11.glPushMatrix();
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||
GlStateManager.color(f4, f5, f6, f3);
|
||||
worldrenderer.begin(7, DefaultVertexFormats.POSITION);
|
||||
worldrenderer.pos((double)startX, (double)endY, 0.0).endVertex();
|
||||
worldrenderer.pos((double)endX, (double)endY, 0.0).endVertex();
|
||||
worldrenderer.pos((double)endX, (double)startY, 0.0).endVertex();
|
||||
worldrenderer.pos((double)startX, (double)startY, 0.0).endVertex();
|
||||
tessellator.draw();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.disableBlend();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void line2D(double startX, double startY, double endX, double endY, float lineWidth, int color) {
|
||||
|
|
@ -1219,27 +1368,30 @@ public class ScriptDefaults {
|
|||
return new int[] { Mouse.getX(), Mouse.getY() };
|
||||
}
|
||||
|
||||
public static boolean isPressed(String key) {
|
||||
for (Map.Entry<KeyBinding, String> map : Reflection.keyBindings.entrySet()) {
|
||||
if (map.getValue().equals(key)) {
|
||||
return map.getKey().isKeyDown();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
public static boolean isPressed(final String key) {
|
||||
KeyBinding keyBind = Reflection.keybinds.get(key);
|
||||
return keyBind != null && keyBind.isKeyDown();
|
||||
}
|
||||
|
||||
public static void setPressed(String key, boolean pressed) {
|
||||
for (Map.Entry<KeyBinding, String> map : Reflection.keyBindings.entrySet()) {
|
||||
if (map.getValue().equals(key)) {
|
||||
KeyBinding.setKeyBindState(map.getKey().getKeyCode(), pressed);
|
||||
public static void setPressed(final String key, final boolean pressed) {
|
||||
KeyBinding keyBind = Reflection.keybinds.get(key);
|
||||
if (keyBind != null) {
|
||||
KeyBinding.setKeyBindState(keyBind.getKeyCode(), pressed);
|
||||
if (pressed) {
|
||||
KeyBinding.onTick(map.getKey().getKeyCode());
|
||||
}
|
||||
KeyBinding.onTick(keyBind.getKeyCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int getKeyCode(String key) {
|
||||
public static int getKeyCode(final String key) {
|
||||
final KeyBinding keyBind = Reflection.keybinds.get(key);
|
||||
if (keyBind != null) {
|
||||
return keyBind.getKeyCode();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static int getKeyIndex(String key) {
|
||||
return Keyboard.getKeyIndex(key);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent;
|
|||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ public class ScriptEvents {
|
|||
this.module = module;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onChat(ClientChatReceivedEvent e) {
|
||||
if (e.type == 2 || !Utils.nullCheck()) {
|
||||
return;
|
||||
|
|
@ -37,7 +38,7 @@ public class ScriptEvents {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onSendPacket(SendPacketEvent e) {
|
||||
if (e.isCanceled() || e.getPacket() == null) {
|
||||
return;
|
||||
|
|
@ -51,7 +52,7 @@ public class ScriptEvents {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onReceivePacket(ReceivePacketEvent e) {
|
||||
if (e.isCanceled() || e.getPacket() == null) {
|
||||
return;
|
||||
|
|
@ -62,7 +63,7 @@ public class ScriptEvents {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onRenderWorldLast(RenderWorldLastEvent e) {
|
||||
if (!Utils.nullCheck()) {
|
||||
return;
|
||||
|
|
@ -70,17 +71,17 @@ public class ScriptEvents {
|
|||
Raven.scriptManager.invoke("onRenderWorld", module, e.partialTicks);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onPreUpdate(PreUpdateEvent e) {
|
||||
Raven.scriptManager.invoke("onPreUpdate", module);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onPostUpdate(PostUpdateEvent e) {
|
||||
Raven.scriptManager.invoke("onPostUpdate", module);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onRenderTick(TickEvent.RenderTickEvent e) {
|
||||
if (e.phase != TickEvent.Phase.END || !Utils.nullCheck()) {
|
||||
return;
|
||||
|
|
@ -88,7 +89,7 @@ public class ScriptEvents {
|
|||
Raven.scriptManager.invoke("onRenderTick", module, e.renderTickTime);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onGuiUpdate(GuiUpdateEvent e) {
|
||||
if (e.guiScreen == null) {
|
||||
return;
|
||||
|
|
@ -96,7 +97,7 @@ public class ScriptEvents {
|
|||
Raven.scriptManager.invoke("onGuiUpdate", module, e.guiScreen.getClass().getSimpleName(), e.opened);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onPreMotion(PreMotionEvent e) {
|
||||
PlayerState playerState = new PlayerState(e, (byte) 0);
|
||||
Raven.scriptManager.invoke("onPreMotion", module, playerState);
|
||||
|
|
@ -115,7 +116,7 @@ public class ScriptEvents {
|
|||
e.setSneaking(playerState.isSneaking);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onWorldJoin(EntityJoinWorldEvent e) {
|
||||
if (e.entity == null) {
|
||||
return;
|
||||
|
|
@ -123,17 +124,17 @@ public class ScriptEvents {
|
|||
Raven.scriptManager.invoke("onWorldJoin", module, Entity.convert(e.entity));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onPostInput(PostPlayerInputEvent e) {
|
||||
Raven.scriptManager.invoke("onPostPlayerInput", module);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onPostMotion(PostMotionEvent e) {
|
||||
Raven.scriptManager.invoke("onPostMotion", module);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void onMouse(MouseEvent e) {
|
||||
if (Raven.scriptManager.invokeBoolean("onMouse", module, e.button, e.buttonstate) == 0) {
|
||||
e.setCanceled(true);
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ public class ScriptManager {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (!this.scripts.isEmpty()) {
|
||||
Iterator<Map.Entry<Script, Module>> iterator = scripts.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry<Script, Module> entry = iterator.next();
|
||||
|
|
@ -85,11 +86,15 @@ public class ScriptManager {
|
|||
|
||||
String cachedHash = loadedHashes.get(fileName);
|
||||
if (cachedHash != null && cachedHash.equals(hash) && !entry.getKey().error) {
|
||||
continue; // No changes detected, skip reloading
|
||||
continue; // no changes detected, skip loading
|
||||
}
|
||||
entry.getKey().delete();
|
||||
iterator.remove();
|
||||
loadedHashes.remove(fileName, hash);
|
||||
loadedHashes.remove(fileName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
loadedHashes.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
public class Bridge {
|
||||
private static final Map<String, Object> map = new HashMap<>();;
|
||||
private static final Map<String, Object> map = new HashMap<>();
|
||||
|
||||
public void add(String key, Object value) {
|
||||
map.put(key, value);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityFishHook;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
|
|
@ -74,10 +75,11 @@ public class Entity {
|
|||
}
|
||||
|
||||
public boolean isHoldingBlock() {
|
||||
if (this.isLiving) {
|
||||
return ((EntityLivingBase) this.entity).getHeldItem() != null && ((EntityLivingBase) this.entity).getHeldItem().getItem() instanceof ItemBlock;
|
||||
return this.isLiving && ((EntityLivingBase)this.entity).getHeldItem() != null && ((EntityLivingBase)this.entity).getHeldItem().getItem() instanceof ItemBlock;
|
||||
}
|
||||
return false;
|
||||
|
||||
public boolean isHoldingWeapon() {
|
||||
return this.isLiving && Utils.holdingWeapon((EntityLivingBase)this.entity);
|
||||
}
|
||||
|
||||
public float getAbsorption() {
|
||||
|
|
@ -132,6 +134,10 @@ public class Entity {
|
|||
return this.entity.getUniqueID().toString();
|
||||
}
|
||||
|
||||
public String getCustomNameTag() {
|
||||
return this.entity.getCustomNameTag();
|
||||
}
|
||||
|
||||
public double getBPS() {
|
||||
if (!this.isLiving) {
|
||||
return 0.0;
|
||||
|
|
@ -230,7 +236,7 @@ public class Entity {
|
|||
}
|
||||
|
||||
public NetworkPlayer getNetworkPlayer() {
|
||||
return new NetworkPlayer(Minecraft.getMinecraft().getNetHandler().getPlayerInfo(this.entity.getUniqueID()));
|
||||
return NetworkPlayer.convert(Minecraft.getMinecraft().getNetHandler().getPlayerInfo(this.entity.getUniqueID()));
|
||||
}
|
||||
|
||||
public float getPitch() {
|
||||
|
|
@ -314,6 +320,24 @@ public class Entity {
|
|||
return this.entity.isDead || (this.isLiving && ((EntityLivingBase)this.entity).deathTime > 0);
|
||||
}
|
||||
|
||||
public int getHunger() {
|
||||
if (!this.isPlayer || ((EntityPlayer) this.entity).getFoodStats() == null) {
|
||||
return 0;
|
||||
}
|
||||
return ((EntityPlayer) this.entity).getFoodStats().getFoodLevel();
|
||||
}
|
||||
|
||||
public float getSaturation() {
|
||||
if (!this.isPlayer || ((EntityPlayer) this.entity).getFoodStats() == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
return ((EntityPlayer) this.entity).getFoodStats().getSaturationLevel();
|
||||
}
|
||||
|
||||
public float getAir() {
|
||||
return this.entity.getAir();
|
||||
}
|
||||
|
||||
public boolean isInvisible() {
|
||||
return entity.isInvisible();
|
||||
}
|
||||
|
|
@ -326,6 +350,13 @@ public class Entity {
|
|||
return entity.isInLava();
|
||||
}
|
||||
|
||||
public Entity getFisher() {
|
||||
if (this.entity instanceof EntityFishHook) {
|
||||
return convert(((EntityFishHook) this.entity).angler);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isInLiquid() {
|
||||
return !this.entity.isOffsetPositionInLiquid(0, 0, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ public class Image {
|
|||
return this.bufferedImage != null;
|
||||
}
|
||||
|
||||
public static void clearCache() {
|
||||
imageCache.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Image(" + this.height + "," + this.width + "," + this.url + ")";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import net.minecraft.enchantment.Enchantment;
|
|||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,45 +2,46 @@ package keystrokesmod.script.classes;
|
|||
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||
import net.minecraft.scoreboard.ScorePlayerTeam;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class NetworkPlayer {
|
||||
private NetworkPlayerInfo networkPlayerInfo;
|
||||
public NetworkPlayer(NetworkPlayerInfo networkPlayerInfo) {
|
||||
this.networkPlayerInfo = networkPlayerInfo;
|
||||
private NetworkPlayerInfo playerInfo;
|
||||
private static HashMap<String, NetworkPlayer> cache = new HashMap<>();
|
||||
|
||||
public NetworkPlayer(NetworkPlayerInfo playerInfo) {
|
||||
this.playerInfo = playerInfo;
|
||||
}
|
||||
|
||||
public String getCape() {
|
||||
return networkPlayerInfo.getLocationCape().getResourcePath();
|
||||
return playerInfo.getLocationCape().getResourcePath();
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
if (networkPlayerInfo == null) {
|
||||
return "";
|
||||
}
|
||||
return networkPlayerInfo.getDisplayName() != null ? networkPlayerInfo.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfo.getPlayerTeam(), networkPlayerInfo.getGameProfile().getName());
|
||||
return (this.playerInfo.getGameProfile() == Minecraft.getMinecraft().thePlayer.getGameProfile()) ? Minecraft.getMinecraft().thePlayer.getDisplayName().getUnformattedText() : ScorePlayerTeam.formatPlayerName(this.playerInfo.getPlayerTeam(), this.getName());
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
if (networkPlayerInfo == null) {
|
||||
if (playerInfo == null) {
|
||||
return "";
|
||||
}
|
||||
return networkPlayerInfo.getGameProfile().getName();
|
||||
return playerInfo.getGameProfile().getName();
|
||||
}
|
||||
|
||||
public int getPing() {
|
||||
if (networkPlayerInfo == null) {
|
||||
if (playerInfo == null) {
|
||||
return 0;
|
||||
}
|
||||
return networkPlayerInfo.getResponseTime();
|
||||
return playerInfo.getResponseTime();
|
||||
}
|
||||
|
||||
public String getSkinData() {
|
||||
final Property texture = (Property) Iterables.getFirst(networkPlayerInfo.getGameProfile().getProperties().get("textures"), (Object)null);
|
||||
final Property texture = (Property) Iterables.getFirst(playerInfo.getGameProfile().getProperties().get("textures"), (Object)null);
|
||||
if (texture == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -48,9 +49,27 @@ public class NetworkPlayer {
|
|||
}
|
||||
|
||||
public String getUUID() {
|
||||
if (networkPlayerInfo == null) {
|
||||
if (playerInfo == null) {
|
||||
return "";
|
||||
}
|
||||
return networkPlayerInfo.getGameProfile().getId().toString();
|
||||
return playerInfo.getGameProfile().getId().toString();
|
||||
}
|
||||
|
||||
public static NetworkPlayer convert(NetworkPlayerInfo networkPlayerInfo) {
|
||||
if (networkPlayerInfo == null) {
|
||||
return null;
|
||||
}
|
||||
String id = networkPlayerInfo.getGameProfile().getId().toString();
|
||||
NetworkPlayer cachedEntity = cache.get(id);
|
||||
|
||||
if (cachedEntity == null) {
|
||||
cachedEntity = new NetworkPlayer(networkPlayerInfo);
|
||||
cache.put(id, cachedEntity);
|
||||
}
|
||||
return cachedEntity;
|
||||
}
|
||||
|
||||
public static void clearCache() {
|
||||
cache.clear();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package keystrokesmod.script.classes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import keystrokesmod.utility.NetworkUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -30,7 +32,10 @@ public class Request {
|
|||
|
||||
}
|
||||
|
||||
public void addHeader(String header, String value) {
|
||||
public void addHeader(final String header, final String value) {
|
||||
if (this.headers == null) {
|
||||
this.headers = new ArrayList<>();
|
||||
}
|
||||
this.headers.add(new String[] { header, value });
|
||||
}
|
||||
|
||||
|
|
@ -51,44 +56,104 @@ public class Request {
|
|||
}
|
||||
|
||||
public Response fetch() {
|
||||
if (!this.url.isEmpty()) {
|
||||
HttpURLConnection con = null;
|
||||
try {
|
||||
URL url = new URL(this.url);
|
||||
final URL url = new URL(this.url);
|
||||
con = (HttpURLConnection)url.openConnection();
|
||||
con.setRequestMethod(this.method);
|
||||
if (!userAgent.isEmpty()) {
|
||||
con.setRequestProperty("User-Agent", this.userAgent);
|
||||
}
|
||||
if (headers != null && !headers.isEmpty()) {
|
||||
for (String[] header : headers) {
|
||||
con.setConnectTimeout(this.connectionTimeout);
|
||||
con.setReadTimeout(this.readTimeout);
|
||||
con.setRequestProperty("User-Agent", this.userAgent.isEmpty() ? NetworkUtils.CHROME_USER_AGENT : this.userAgent);
|
||||
if (this.headers != null && !this.headers.isEmpty()) {
|
||||
for (final String[] header : this.headers) {
|
||||
con.setRequestProperty(header[0], header[1]);
|
||||
}
|
||||
}
|
||||
if (connectionTimeout > 0) {
|
||||
con.setConnectTimeout(connectionTimeout);
|
||||
}
|
||||
if (readTimeout > 0) {
|
||||
con.setReadTimeout(readTimeout);
|
||||
}
|
||||
if (!content.isEmpty() && method.equals("POST")) {
|
||||
if (this.method.equals("POST") && !this.content.isEmpty()) {
|
||||
con.setDoOutput(true);
|
||||
OutputStream stream = con.getOutputStream();
|
||||
stream.write(content.getBytes());
|
||||
stream.close();
|
||||
con.getInputStream().close();
|
||||
final byte[] out = this.content.getBytes(StandardCharsets.UTF_8);
|
||||
con.setFixedLengthStreamingMode(out.length);
|
||||
con.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
con.connect();
|
||||
final OutputStream os = con.getOutputStream();
|
||||
try {
|
||||
os.write(out);
|
||||
if (os != null) {
|
||||
os.close();
|
||||
}
|
||||
} catch (IOException iOException) {
|
||||
iOException.printStackTrace();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
if (os != null) {
|
||||
try {
|
||||
os.close();
|
||||
}
|
||||
catch (Throwable t2) {
|
||||
t.addSuppressed(t2);
|
||||
}
|
||||
}
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
String contents = "";
|
||||
try {
|
||||
final BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
try {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
String input;
|
||||
while ((input = br.readLine()) != null) {
|
||||
sb.append(input);
|
||||
}
|
||||
contents = sb.toString();
|
||||
br.close();
|
||||
}
|
||||
catch (Throwable t3) {
|
||||
try {
|
||||
br.close();
|
||||
}
|
||||
catch (Throwable t4) {
|
||||
t3.addSuppressed(t4);
|
||||
}
|
||||
throw t3;
|
||||
}
|
||||
}
|
||||
catch (IOException er1) {
|
||||
InputStream errorStream = con.getErrorStream();
|
||||
if (errorStream != null) {
|
||||
try {
|
||||
final BufferedReader errorReader = new BufferedReader(new InputStreamReader(errorStream));
|
||||
try {
|
||||
final StringBuilder sb2 = new StringBuilder();
|
||||
String input2;
|
||||
while ((input2 = errorReader.readLine()) != null) {
|
||||
sb2.append(input2);
|
||||
}
|
||||
contents = sb2.toString();
|
||||
errorReader.close();
|
||||
}
|
||||
catch (Throwable t5) {
|
||||
try {
|
||||
errorReader.close();
|
||||
}
|
||||
catch (Throwable t6) {
|
||||
t5.addSuppressed(t6);
|
||||
}
|
||||
throw t5;
|
||||
}
|
||||
}
|
||||
catch (IOException ex) {}
|
||||
}
|
||||
}
|
||||
return new Response(con.getResponseCode(), contents);
|
||||
}
|
||||
catch (IOException ex2) {}
|
||||
finally {
|
||||
if (con != null) {
|
||||
con.disconnect();
|
||||
}
|
||||
}
|
||||
if (con == null) {
|
||||
return null;
|
||||
}
|
||||
return new Response(con);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,37 +1,28 @@
|
|||
package keystrokesmod.script.classes;
|
||||
|
||||
import com.google.gson.JsonParser;
|
||||
import keystrokesmod.utility.NetworkUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
|
||||
public class Response {
|
||||
private HttpURLConnection connection;
|
||||
private int responseCode;
|
||||
private String contents;
|
||||
|
||||
protected Response(HttpURLConnection connection) {
|
||||
this.connection = connection;
|
||||
public Response(int responseCode, String contents) {
|
||||
this.responseCode = responseCode;
|
||||
this.contents = contents;
|
||||
}
|
||||
|
||||
public int code() {
|
||||
try {
|
||||
return this.connection.getResponseCode();
|
||||
}
|
||||
catch (IOException e) {
|
||||
return 0;
|
||||
}
|
||||
return this.responseCode;
|
||||
}
|
||||
|
||||
public String string() {
|
||||
return NetworkUtils.getTextFromConnection(this.connection, false);
|
||||
return this.contents;
|
||||
}
|
||||
|
||||
public Json json() {
|
||||
return new Json((new JsonParser()).parse(NetworkUtils.getTextFromConnection(this.connection, false)).getAsJsonObject(), (byte) 0);
|
||||
return (this.contents == null) ? null : new Json(this.contents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Response(" + this.code() + ")";
|
||||
return "Response(" + this.responseCode + ")";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,16 +21,18 @@ public class TileEntity {
|
|||
}
|
||||
|
||||
public Object[] getSkullData() {
|
||||
if (!(this.tileEntity instanceof TileEntitySkull)) {
|
||||
if (this.tileEntity instanceof TileEntitySkull) {
|
||||
final TileEntitySkull skull = (TileEntitySkull)this.tileEntity;
|
||||
final Object[] skullData = { skull.getSkullType(), skull.getSkullRotation(), null, null, null };
|
||||
if (skull.getPlayerProfile() == null) {
|
||||
skullData[2] = (skullData[3] = null);
|
||||
}
|
||||
else {
|
||||
skullData[2] = skull.getPlayerProfile().getName();
|
||||
skullData[3] = skull.getPlayerProfile().getId();
|
||||
}
|
||||
return skullData;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
TileEntitySkull skull = (TileEntitySkull) this.tileEntity;
|
||||
String name = "";
|
||||
String uuid = "";
|
||||
if (skull.getPlayerProfile() != null) {
|
||||
name = skull.getPlayerProfile().getName();
|
||||
uuid = skull.getPlayerProfile().getId().toString();
|
||||
}
|
||||
return new Object[] { skull.getSkullType(), skull.getSkullRotation(), name, uuid };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,100 +0,0 @@
|
|||
package keystrokesmod.script.classes;
|
||||
|
||||
import keystrokesmod.utility.BlockUtils;
|
||||
import keystrokesmod.utility.Utils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.network.NetworkPlayerInfo;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.scoreboard.Team;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class World {
|
||||
private Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
public Block getBlockAt(int x, int y, int z) {
|
||||
net.minecraft.block.Block block = BlockUtils.getBlock(new BlockPos(x, y, z));
|
||||
if (block == null) {
|
||||
return new Block(Blocks.air, new BlockPos(x, y, z));
|
||||
}
|
||||
return new Block(block, new BlockPos(x, y, z));
|
||||
|
||||
}
|
||||
|
||||
public Block getBlockAt(Vec3 pos) {
|
||||
net.minecraft.block.Block block = BlockUtils.getBlock(new BlockPos(pos.x, pos.y, pos.z));
|
||||
if (block == null) {
|
||||
return new Block(Blocks.air, new BlockPos(pos.x, pos.y, pos.z));
|
||||
}
|
||||
return new Block(block, new BlockPos(pos.x, pos.y, pos.z));
|
||||
}
|
||||
|
||||
public String getDimension() {
|
||||
if (mc.theWorld == null) {
|
||||
return "";
|
||||
}
|
||||
return mc.theWorld.provider.getDimensionName();
|
||||
}
|
||||
|
||||
public List<Entity> getEntities() {
|
||||
List<Entity> entities = new ArrayList<>();
|
||||
for (net.minecraft.entity.Entity entity : mc.theWorld.loadedEntityList) {
|
||||
entities.add(Entity.convert(entity));
|
||||
}
|
||||
return entities;
|
||||
}
|
||||
|
||||
public Entity getEntityById(int entityId) {
|
||||
for (net.minecraft.entity.Entity entity : mc.theWorld.loadedEntityList) {
|
||||
if (entity.getEntityId() == entityId) {
|
||||
return Entity.convert(entity);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<NetworkPlayer> getNetworkPlayers() {
|
||||
List<NetworkPlayer> entities = new ArrayList<>();
|
||||
for (NetworkPlayerInfo networkPlayerInfo : Utils.getTablist(false)) {
|
||||
entities.add(new NetworkPlayer(networkPlayerInfo));
|
||||
}
|
||||
return entities;
|
||||
}
|
||||
|
||||
public List<Entity> getPlayerEntities() {
|
||||
List<Entity> entities = new ArrayList<>();
|
||||
for (net.minecraft.entity.Entity entity : mc.theWorld.playerEntities) {
|
||||
entities.add(Entity.convert(entity));
|
||||
}
|
||||
return entities;
|
||||
}
|
||||
|
||||
public List<String> getScoreboard() {
|
||||
List<String> sidebarLines = Utils.getSidebarLines();
|
||||
if (sidebarLines.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return sidebarLines;
|
||||
}
|
||||
|
||||
public Map<String, List<String>> getTeams() {
|
||||
Map<String, List<String>> teams = new HashMap<>();
|
||||
for (Team team : mc.theWorld.getScoreboard().getTeams()) {
|
||||
List<String> members = new ArrayList<>();
|
||||
for (String member : team.getMembershipCollection()) {
|
||||
members.add(member);
|
||||
}
|
||||
teams.put(team.getRegisteredName(), members);
|
||||
}
|
||||
return teams;
|
||||
}
|
||||
|
||||
public List<TileEntity> getTileEntities() {
|
||||
List<TileEntity> tileEntities = new ArrayList<>();
|
||||
for (net.minecraft.tileentity.TileEntity entity : mc.theWorld.loadedTileEntityList) {
|
||||
tileEntities.add(new TileEntity(entity));
|
||||
}
|
||||
return tileEntities;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,15 +18,15 @@ public class S3E extends SPacket {
|
|||
|
||||
public S3E(S3EPacketTeams packet) {
|
||||
super(packet);
|
||||
this.name = packet.func_149312_c();
|
||||
this.displayName = packet.func_149306_d();
|
||||
this.prefix = packet.func_149311_e();
|
||||
this.suffix = packet.func_149309_f();
|
||||
this.nametagVisibility = packet.func_179814_i();
|
||||
this.playerList = packet.func_149310_g();
|
||||
this.action = packet.func_149307_h();
|
||||
this.friendlyFlags = packet.func_149308_i();
|
||||
this.color = packet.func_179813_h();
|
||||
this.name = packet.getName();
|
||||
this.displayName = packet.getDisplayName();
|
||||
this.prefix = packet.getPrefix();
|
||||
this.suffix = packet.getSuffix();
|
||||
this.nametagVisibility = packet.getNameTagVisibility();
|
||||
this.playerList = packet.getPlayers();
|
||||
this.action = packet.getAction();
|
||||
this.friendlyFlags = packet.getFriendlyFlags();
|
||||
this.color = packet.getColor();
|
||||
}
|
||||
|
||||
public S3E(Packet packet, String name, String displayName, String prefix, String suffix, String nametagVisibility, Collection<String> playerList, int action, int friendlyFlags, int color) {
|
||||
|
|
|
|||
|
|
@ -101,6 +101,12 @@ public class PacketHandler {
|
|||
else if (packet instanceof S3APacketTabComplete) {
|
||||
sPacket = new S3A((S3APacketTabComplete) packet, (byte) 0);
|
||||
}
|
||||
else if (packet instanceof S02PacketChat) {
|
||||
sPacket = new S02((S02PacketChat) packet);
|
||||
}
|
||||
else if (packet instanceof S45PacketTitle) {
|
||||
sPacket = new S45((S45PacketTitle) packet);
|
||||
}
|
||||
else {
|
||||
sPacket = new SPacket(packet);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class BlockUtils {
|
|||
}
|
||||
|
||||
public static boolean isInteractable(Block block) {
|
||||
return block instanceof BlockFurnace || block instanceof BlockTrapDoor || block instanceof BlockDoor || block instanceof BlockContainer || block instanceof BlockJukebox || block instanceof BlockFenceGate || block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockEnchantmentTable || block instanceof BlockBrewingStand || block instanceof BlockBed || block instanceof BlockDropper || block instanceof BlockDispenser || block instanceof BlockHopper || block instanceof BlockAnvil || block instanceof BlockNote || block instanceof BlockWorkbench;
|
||||
return block instanceof BlockFurnace || block instanceof BlockTrapDoor || block instanceof BlockDoor || block instanceof BlockContainer || block instanceof BlockJukebox || block instanceof BlockFenceGate || block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockEnchantmentTable || block instanceof BlockBrewingStand || block instanceof BlockBed || block instanceof BlockDropper || block instanceof BlockDispenser || block instanceof BlockHopper || block instanceof BlockAnvil || block instanceof BlockNote || block instanceof BlockWorkbench || block instanceof BlockButton;
|
||||
}
|
||||
|
||||
public static boolean isInteractable(MovingObjectPosition mv) {
|
||||
|
|
@ -38,8 +38,7 @@ public class BlockUtils {
|
|||
}
|
||||
IBlockState iblockstate = mc.theWorld.getBlockState(mv.getBlockPos());
|
||||
if (!mc.thePlayer.isSneaking() || mc.thePlayer.getHeldItem() == null || mc.thePlayer.getHeldItem().getItem().doesSneakBypassUse(mc.theWorld, mv.getBlockPos(), mc.thePlayer)) {
|
||||
Vec3 hitVec = getHitVec(mv.hitVec, mv.getBlockPos());
|
||||
return iblockstate.getBlock().onBlockActivated(mc.theWorld, mv.getBlockPos(), iblockstate, mc.thePlayer, mv.sideHit, (float) hitVec.xCoord, (float) hitVec.yCoord, (float) hitVec.zCoord);
|
||||
return isInteractable(iblockstate.getBlock());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,8 +61,6 @@ public class ModuleUtils {
|
|||
@SubscribeEvent
|
||||
public void onPreUpdate(PreUpdateEvent e) {
|
||||
|
||||
inAirTicks = mc.thePlayer.onGround ? 0 : ++inAirTicks;
|
||||
|
||||
if (LongJump.slotReset && ++LongJump.slotResetTicks >= 2) {
|
||||
LongJump.stopKillAura = false;
|
||||
LongJump.stopScaffold = false;
|
||||
|
|
@ -94,6 +92,8 @@ public class ModuleUtils {
|
|||
@SubscribeEvent
|
||||
public void onPreMotion(PreMotionEvent e) {
|
||||
|
||||
inAirTicks = mc.thePlayer.onGround ? 0 : ++inAirTicks;
|
||||
|
||||
// 7 tick needs to always finish the motion or itll lag back
|
||||
if (!ModuleManager.bhop.isEnabled() && ModuleManager.bhop.mode.getInput() == 3 && ModuleManager.bhop.didMove) {
|
||||
int simpleY = (int) Math.round((e.posY % 1) * 10000);
|
||||
|
|
@ -127,7 +127,7 @@ public class ModuleUtils {
|
|||
}
|
||||
if (ModuleManager.bhop.rotateYawOption.isToggled()) {
|
||||
if (ModuleManager.bhop.setRotation) {
|
||||
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.scaffold.isEnabled) {
|
||||
if (!ModuleManager.killAura.isTargeting && !Utils.noSlowingBackWithBow() && !ModuleManager.scaffold.isEnabled && !mc.thePlayer.isCollidedHorizontally) {
|
||||
float playerYaw = mc.thePlayer.rotationYaw;
|
||||
e.setYaw(playerYaw -= 55);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class NetworkUtils {
|
|||
public static String API_KEY = "";
|
||||
private static final Pattern OGP_IMAGE_REGEX = Pattern.compile("<meta property=\"(?:og:image|twitter:image)\" content=\"(?<url>.+?)\".*?/?>");
|
||||
private static final Pattern IMG_TAG_REGEX = Pattern.compile("<img.*?src=\"(?<url>.+?)\".*?>");
|
||||
private static final String CHROME_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";
|
||||
public static final String CHROME_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";
|
||||
|
||||
public static boolean isHypixelKeyValid(String ak) {
|
||||
String c = getTextFromURL("https://api.hypixel.net/key?key=" + ak, false);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package keystrokesmod.utility;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiEnchantment;
|
||||
import net.minecraft.client.gui.GuiIngame;
|
||||
import net.minecraft.client.gui.GuiPlayerTabOverlay;
|
||||
import net.minecraft.client.gui.GuiScreenBook;
|
||||
import net.minecraft.client.gui.inventory.GuiBrewingStand;
|
||||
import net.minecraft.client.gui.inventory.GuiDispenser;
|
||||
|
|
@ -20,7 +21,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.client.C01PacketChatMessage;
|
||||
import net.minecraft.network.play.client.C02PacketUseEntity;
|
||||
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
|
||||
|
|
@ -37,7 +37,6 @@ import java.nio.ByteBuffer;
|
|||
import java.util.*;
|
||||
|
||||
public class Reflection {
|
||||
public static Field title;
|
||||
public static Field button;
|
||||
public static Field buttonstate;
|
||||
public static Field buttons;
|
||||
|
|
@ -56,23 +55,24 @@ public class Reflection {
|
|||
public static Field inGround;
|
||||
public static Method getFOVModifier;
|
||||
public static Field itemInUseCount;
|
||||
public static Field displayedTitle;
|
||||
public static Field displayedSubTitle;
|
||||
public static Field S08PacketPlayerPosLookYaw;
|
||||
public static Field S08PacketPlayerPosLookPitch;
|
||||
public static Field C02PacketUseEntityEntityId;
|
||||
public static Field recordPlaying;
|
||||
public static Field bookContents;
|
||||
public static Field classTarget;
|
||||
public static Field fallDistance;
|
||||
public static Field tabHeader;
|
||||
public static Field tabFooter;
|
||||
public static Field thirdPersonDistance;
|
||||
public static Field alwaysEdible;
|
||||
public static Field mcGuiInGame;
|
||||
public static Field targetEntity;
|
||||
public static Field targetTasks;
|
||||
public static Field executingTaskEntries;
|
||||
public static Field C01PacketChatMessageMessage;
|
||||
public static HashMap<Class, Field> containerInventoryPlayer = new HashMap<>();
|
||||
private static List<Class> containerClasses = Arrays.asList(GuiFurnace.class, GuiBrewingStand.class, GuiEnchantment.class, ContainerHopper.class, GuiDispenser.class, ContainerWorkbench.class, ContainerMerchant.class, ContainerHorseInventory.class);
|
||||
public static boolean sendMessage = false;
|
||||
public static Map<KeyBinding, String> keyBindings = new HashMap<>();
|
||||
public static Map<String, KeyBinding> keybinds = new HashMap<>();
|
||||
|
||||
public static void getFields() {
|
||||
try {
|
||||
|
|
@ -86,12 +86,6 @@ public class Reflection {
|
|||
leftClickCounter.setAccessible(true);
|
||||
}
|
||||
|
||||
title = ReflectionHelper.findField(GuiIngame.class, "field_175201_x", "screenTitle");
|
||||
|
||||
if (title != null) {
|
||||
title.setAccessible(true);
|
||||
}
|
||||
|
||||
jumpTicks = ReflectionHelper.findField(EntityLivingBase.class, "field_70773_bE", "jumpTicks");
|
||||
|
||||
if (jumpTicks != null) {
|
||||
|
|
@ -104,37 +98,49 @@ public class Reflection {
|
|||
rightClickDelayTimerField.setAccessible(true);
|
||||
}
|
||||
|
||||
displayedTitle = ReflectionHelper.findField(GuiIngame.class, "field_175201_x", "displayedTitle");
|
||||
|
||||
if (displayedTitle != null) {
|
||||
displayedTitle.setAccessible(true);
|
||||
}
|
||||
|
||||
displayedSubTitle = ReflectionHelper.findField(GuiIngame.class, "field_175200_y", "displayedSubTitle");
|
||||
|
||||
if (displayedSubTitle != null) {
|
||||
displayedSubTitle.setAccessible(true);
|
||||
}
|
||||
|
||||
tabHeader = ReflectionHelper.findField(GuiPlayerTabOverlay.class, "header", "field_175256_i");
|
||||
if (tabHeader != null) {
|
||||
tabHeader.setAccessible(true);
|
||||
}
|
||||
|
||||
tabFooter = ReflectionHelper.findField(GuiPlayerTabOverlay.class, "footer", "field_175255_h");
|
||||
if (tabFooter != null) {
|
||||
tabFooter.setAccessible(true);
|
||||
}
|
||||
|
||||
C01PacketChatMessageMessage = ReflectionHelper.findField(C01PacketChatMessage.class, "field_149440_a", "message");
|
||||
|
||||
if (C01PacketChatMessageMessage != null) {
|
||||
C01PacketChatMessageMessage.setAccessible(true);
|
||||
}
|
||||
|
||||
recordPlaying = ReflectionHelper.findField(GuiIngame.class, "recordPlaying", "field_73838_g");
|
||||
if (recordPlaying != null) {
|
||||
recordPlaying.setAccessible(true);
|
||||
}
|
||||
|
||||
curBlockDamageMP = ReflectionHelper.findField(PlayerControllerMP.class, "field_78770_f", "curBlockDamageMP"); // fastmine and mining related stuff
|
||||
if (curBlockDamageMP != null) {
|
||||
curBlockDamageMP.setAccessible(true);
|
||||
}
|
||||
|
||||
classTarget = ReflectionHelper.findField(EntityAIAttackOnCollide.class, "field_75444_h", "classTarget");
|
||||
if (classTarget != null) {
|
||||
classTarget.setAccessible(true);
|
||||
}
|
||||
|
||||
blockHitDelay = ReflectionHelper.findField(PlayerControllerMP.class, "field_78781_i", "blockHitDelay");
|
||||
if (blockHitDelay != null) {
|
||||
blockHitDelay.setAccessible(true);
|
||||
}
|
||||
|
||||
targetEntity = ReflectionHelper.findField(EntityAINearestAttackableTarget.class, "targetEntity", "field_75309_a");
|
||||
if (targetEntity != null) {
|
||||
targetEntity.setAccessible(true);
|
||||
}
|
||||
|
||||
targetTasks = ReflectionHelper.findField(EntityLiving.class, "targetTasks", "field_70715_bh");
|
||||
if (targetTasks != null) {
|
||||
targetTasks.setAccessible(true);
|
||||
}
|
||||
|
||||
fallDistance = ReflectionHelper.findField(Entity.class, "fallDistance", "field_70143_R");
|
||||
if (fallDistance != null) {
|
||||
fallDistance.setAccessible(true);
|
||||
|
|
@ -145,11 +151,6 @@ public class Reflection {
|
|||
mcGuiInGame.setAccessible(true);
|
||||
}
|
||||
|
||||
executingTaskEntries = ReflectionHelper.findField(EntityAITasks.class, "executingTaskEntries", "field_75780_b");
|
||||
if (executingTaskEntries != null) {
|
||||
executingTaskEntries.setAccessible(true);
|
||||
}
|
||||
|
||||
shaderResourceLocations = ReflectionHelper.findField(EntityRenderer.class, "shaderResourceLocations", "field_147712_ad");
|
||||
if (shaderResourceLocations != null) {
|
||||
shaderResourceLocations.setAccessible(true);
|
||||
|
|
@ -219,8 +220,9 @@ public class Reflection {
|
|||
}
|
||||
|
||||
public static void setKeyBindings() {
|
||||
for (KeyBinding keyBinding : Minecraft.getMinecraft().gameSettings.keyBindings) {
|
||||
keyBindings.put(keyBinding, keyBinding.getKeyDescription().substring(4));
|
||||
for (KeyBinding keyBind : Minecraft.getMinecraft().gameSettings.keyBindings) {
|
||||
String keyName = keyBind.getKeyDescription().replaceFirst("key\\.", "");
|
||||
keybinds.put(keyName, keyBind);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -338,6 +340,15 @@ public class Reflection {
|
|||
return blocking;
|
||||
}
|
||||
|
||||
public static void setItemInUseCount(int count) {
|
||||
try {
|
||||
itemInUseCount.set(Minecraft.getMinecraft().thePlayer, count);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean setupCameraTransform(EntityRenderer entityRenderer, float partialTicks, int eyeIndex) {
|
||||
try {
|
||||
if (setupCameraTransform == null) {
|
||||
|
|
@ -351,17 +362,4 @@ public class Reflection {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Entity getClassTarget(EntityAIAttackOnCollide task) {
|
||||
try {
|
||||
if (classTarget != null) {
|
||||
Entity targetEntity = (Entity) classTarget.get(task);
|
||||
return targetEntity;
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -589,7 +589,7 @@ public class Utils {
|
|||
|
||||
public static String getTitle() {
|
||||
try {
|
||||
return (String) Reflection.title.get(mc.ingameGUI);
|
||||
return (String) Reflection.displayedTitle.get(mc.ingameGUI);
|
||||
} catch (IllegalAccessException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
|
@ -1194,10 +1194,14 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static boolean holdingWeapon() {
|
||||
if (mc.thePlayer.getHeldItem() == null) {
|
||||
return holdingWeapon(mc.thePlayer);
|
||||
}
|
||||
|
||||
public static boolean holdingWeapon(EntityLivingBase entityLivingBase) {
|
||||
if (entityLivingBase.getHeldItem() == null) {
|
||||
return false;
|
||||
}
|
||||
Item getItem = mc.thePlayer.getHeldItem().getItem();
|
||||
Item getItem = entityLivingBase.getHeldItem().getItem();
|
||||
return getItem instanceof ItemSword || (Settings.weaponAxe.isToggled() && getItem instanceof ItemAxe) || (Settings.weaponRod.isToggled() && getItem instanceof ItemFishingRod) || (Settings.weaponStick.isToggled() && getItem == Items.stick);
|
||||
}
|
||||
|
||||
|
|
@ -1340,26 +1344,6 @@ public class Utils {
|
|||
return new int[] { Mouse.getX(), Mouse.getY() };
|
||||
}
|
||||
|
||||
public static boolean isPressed(String key) {
|
||||
for (Map.Entry<KeyBinding, String> map : Reflection.keyBindings.entrySet()) {
|
||||
if (map.getValue().equals(key)) {
|
||||
return map.getKey().isKeyDown();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void setPressed(String key, boolean pressed) {
|
||||
for (Map.Entry<KeyBinding, String> map : Reflection.keyBindings.entrySet()) {
|
||||
if (map.getValue().equals(key)) {
|
||||
KeyBinding.setKeyBindState(map.getKey().getKeyCode(), pressed);
|
||||
if (pressed) {
|
||||
KeyBinding.onTick(map.getKey().getKeyCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int getKeyCode(String key) {
|
||||
return Keyboard.getKeyIndex(key);
|
||||
}
|
||||
|
|
@ -1394,6 +1378,10 @@ public class Utils {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static String asWholeNum(double input) {
|
||||
return isWholeNumber(input) ? (int) input + "" : String.valueOf(input);
|
||||
}
|
||||
|
||||
public static boolean isBedwarsPractice() {
|
||||
if (Utils.isHypixel()) {
|
||||
if (!Utils.nullCheck()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue