Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.15 dev try2 #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ on:
permissions:
contents: write


jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -54,6 +53,7 @@ jobs:
run: ./gradlew build --stacktrace

- name: Send JAR to Discord Webhook
if: github.event_name == 'push' # Only send to Discord on push events
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
GITHUB_SHA: ${{ github.sha }}
Expand All @@ -74,4 +74,16 @@ jobs:
curl -X POST -H "Content-Type: multipart/form-data" \
-F "file=@$JAR_PATH" \
-F "payload_json={\"content\":\"$GIT_COMMIT_AUTHOR pushed $GIT_COMMIT_COMMENT_COUNT changes to the repository $GITHUB_REPOSITORY on branch $GITHUB_REF. Commit URL: $GIT_COMMIT_URL\"}" \
$DISCORD_WEBHOOK_URL
$DISCORD_WEBHOOK_URL

- name: Find Correct JAR
id: findjar
run: |
output="$(find build/libs/ ! -name "*-sources.jar" -type f -printf "%f\n")"
echo "::set-output name=jarname::$output"

- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ steps.findjar.outputs.jarname }}
path: build/libs/${{ steps.findjar.outputs.jarname }}
1 change: 1 addition & 0 deletions src/main/java/keystrokesmod/Raven.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void init(FMLInitializationEvent ignored) {
MinecraftForge.EVENT_BUS.register(ModuleManager.slotHandler);
MinecraftForge.EVENT_BUS.register(ModuleManager.dynamicManager);
MinecraftForge.EVENT_BUS.register(new MoveableManager());
MinecraftForge.EVENT_BUS.register(profileManager);

I18nManager.init();
AutoUpdate.init();
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/keystrokesmod/event/ClientBrandEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package keystrokesmod.event;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.minecraftforge.fml.common.eventhandler.Event;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
public class ClientBrandEvent extends Event {
private String brand;
}
32 changes: 32 additions & 0 deletions src/main/java/keystrokesmod/event/EyeHeightEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package keystrokesmod.event;

import keystrokesmod.utility.Utils;
import lombok.*;
import net.minecraftforge.fml.common.eventhandler.Event;

import static keystrokesmod.Raven.mc;

@Getter
public class EyeHeightEvent extends Event {
private double y;
private boolean set;

public EyeHeightEvent(double eyeHeight) {
setEyeHeight(eyeHeight);
}

public double getEyeHeight() {
return 1.62 - (mc.thePlayer.lastTickPosY +
(((mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * Utils.getTimer().renderPartialTicks)) - y);
}

public void setEyeHeight(double targetEyeHeight) {
this.y = targetEyeHeight - 1.62 + mc.thePlayer.lastTickPosY +
((mc.thePlayer.posY - mc.thePlayer.lastTickPosY) * (double) Utils.getTimer().renderPartialTicks);
}

public void setY(double y) {
this.y = y;
this.set = true;
}
}
8 changes: 8 additions & 0 deletions src/main/java/keystrokesmod/event/FOVUpdateEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package keystrokesmod.event;

import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;

@Cancelable
public class FOVUpdateEvent extends Event {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@


import com.google.common.base.Predicates;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.render.CustomFOV;
import keystrokesmod.module.impl.other.RotationHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.util.*;
import net.minecraftforge.client.event.FOVUpdateEvent;
import net.minecraftforge.common.MinecraftForge;
import org.jetbrains.annotations.NotNull;
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.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.List;

Expand Down Expand Up @@ -111,4 +117,30 @@ public void getMouseOver(float p_getMouseOver_1_, CallbackInfo ci) {

ci.cancel();
}


/**
* @author kefpull
* @reason attempt 1 have an option for CustomFOV to do the same thing as optifine's "Dynamic FOV:off". Hopefully this does not break the whole entire client :).
* I know we're supposed to use an event or something like that, so I will do that if I can.
* <p>
* Source for method: line 412 in EntityRenderer.class
*/

@Inject(method = "getFOVModifier", at = @At("RETURN"), cancellable = true)
public void onGetFOVModifier(@NotNull CallbackInfoReturnable<Float> cir) {

if (ModuleManager.customFOV != null && ModuleManager.customFOV.forceStaticFOV != null) {

if (ModuleManager.customFOV.isEnabled() && ModuleManager.customFOV.forceStaticFOV.isToggled()) {

cir.setReturnValue(CustomFOV.getDesiredFOV());

}

}
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ public interface EntityLivingBaseAccessor {

@Accessor("dead")
boolean isDead();

@Accessor("jumpTicks")
void setJumpTicks(int ticks);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package keystrokesmod.mixins.impl.entity;

import keystrokesmod.event.EyeHeightEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.movement.KeepSprint;
import keystrokesmod.module.impl.render.Particles;
Expand All @@ -17,13 +18,17 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import static keystrokesmod.Raven.mc;

@SuppressWarnings("DataFlowIssue")
@Mixin(value = EntityPlayer.class)
public abstract class MixinEntityPlayer extends EntityLivingBase {
public MixinEntityPlayer(World p_i1594_1_) {
Expand All @@ -34,6 +39,7 @@ public MixinEntityPlayer(World p_i1594_1_) {
* @author strangerrrs
* @reason mixin attack target entity with current item
*/
@SuppressWarnings({"UnresolvedMixinReference", "ExtractMethodRecommender"})
@Inject(method = "attackTargetEntityWithCurrentItem", at = @At("HEAD"), cancellable = true)
public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCurrentItem_1_, CallbackInfo ci) {
if (ForgeHooks.onPlayerAttackTarget(((EntityPlayer) (Object) this), p_attackTargetEntityWithCurrentItem_1_)) {
Expand Down Expand Up @@ -72,7 +78,7 @@ public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCur
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));
p_attackTargetEntityWithCurrentItem_1_.addVelocity(-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F, 0.1, MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F);
if (ModuleManager.keepSprint != null && ModuleManager.keepSprint.isEnabled()) {
KeepSprint.keepSprint(p_attackTargetEntityWithCurrentItem_1_);
}
Expand Down Expand Up @@ -110,13 +116,14 @@ public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCur

EnchantmentHelper.applyArthropodEnchantments(this, p_attackTargetEntityWithCurrentItem_1_);
ItemStack itemstack = mc.thePlayer.getCurrentEquippedItem();
Entity entity = p_attackTargetEntityWithCurrentItem_1_;
Entity entity1 = p_attackTargetEntityWithCurrentItem_1_;
if (p_attackTargetEntityWithCurrentItem_1_ instanceof EntityDragonPart) {
IEntityMultiPart ientitymultipart = ((EntityDragonPart) p_attackTargetEntityWithCurrentItem_1_).entityDragonObj;
if (ientitymultipart instanceof EntityLivingBase) {
entity = (EntityLivingBase) ientitymultipart;
entity1 = (EntityLivingBase) ientitymultipart;
}
}
Entity entity = entity1;

if (itemstack != null && entity instanceof EntityLivingBase) {
itemstack.hitEntity((EntityLivingBase) entity, ((EntityPlayer) (Object) this));
Expand All @@ -143,4 +150,14 @@ public void attackTargetEntityWithCurrentItem(Entity p_attackTargetEntityWithCur
ci.cancel();
}

@Inject(method = "getEyeHeight", at = @At("RETURN"), cancellable = true)
public void onGetEyeHeight(@NotNull CallbackInfoReturnable<Float> cir) {
EyeHeightEvent event = new EyeHeightEvent(cir.getReturnValue());
MinecraftForge.EVENT_BUS.post(event);
if (event.isSet()) {
mc.thePlayer.cameraYaw = 0;
mc.thePlayer.cameraPitch = 0;
cir.setReturnValue((float) event.getEyeHeight());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void onDrawScreen(int p_drawScreen_1_, int p_drawScreen_2_, float p_drawS

BackgroundUtils.renderBackground(this);

FontManager.tenacity80.drawCenteredString("Raven XD", width / 2.0, height * 0.2, LOGO_COLOR);
FontManager.getFont(FontManager.Fonts.MAPLESTORY, 80).drawCenteredString("Raven XD", width / 2.0, height * 0.2, LOGO_COLOR);

List<String> branding = Lists.reverse(FMLCommonHandler.instance().getBrandings(true));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package keystrokesmod.mixins.impl.gui;


import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiMultiplayer.class)
public class MixinGuiMultiplayer extends GuiScreen {

@Redirect(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiMultiplayer;drawDefaultBackground()V"))
public void onDrawDefaultBackground(GuiMultiplayer instance) {
}
}
25 changes: 25 additions & 0 deletions src/main/java/keystrokesmod/mixins/impl/gui/MixinGuiSlot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package keystrokesmod.mixins.impl.gui;


import keystrokesmod.module.ModuleManager;
import keystrokesmod.utility.render.BackgroundUtils;
import net.minecraft.client.gui.GuiSlot;
import net.minecraft.client.renderer.Tessellator;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(GuiSlot.class)
public class MixinGuiSlot {

@Inject(method = "drawContainerBackground", at = @At("HEAD"), cancellable = true, remap = false)
public void onDrawContainerBackground(Tessellator p_drawContainerBackground_1_, CallbackInfo ci) {
if (!ModuleManager.clientTheme.isEnabled() || !ModuleManager.clientTheme.background.isToggled())
return;

BackgroundUtils.renderBackground((GuiSlot) (Object) this);

ci.cancel();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package keystrokesmod.mixins.impl.network;

import keystrokesmod.event.ClientBrandEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(FMLCommonHandler.class)
public abstract class MixinFMLCommonHandler {

@Inject(method = "getModName", at = @At("RETURN"), remap = false, cancellable = true)
private void getModName(@NotNull CallbackInfoReturnable<String> cir) {
ClientBrandEvent event = new ClientBrandEvent(cir.getReturnValue());
MinecraftForge.EVENT_BUS.post(event);
cir.setReturnValue(event.getBrand());
}
}
10 changes: 8 additions & 2 deletions src/main/java/keystrokesmod/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class ModuleManager {
public static NoCameraClip noCameraClip;
public static AutoPlay autoPlay;
public static CustomName customName;
public static CustomFOV customFOV;
public static CommandChat commandChat;
public static Phase phase;
public static PingSpoof pingSpoof;
Expand Down Expand Up @@ -127,6 +128,8 @@ public class ModuleManager {
public static Regen regen;
public static ChatAI chatAI;
public static keystrokesmod.module.impl.render.ArrayList arrayList;
public static InvMove invMove;
public static MotionCamera motionCamera;

static List<Module> modules = new ArrayList<>();

Expand Down Expand Up @@ -202,7 +205,7 @@ public void register() {

// movement
this.addModule(fly = new Fly());
this.addModule(new InvMove());
this.addModule(invMove = new InvMove());
this.addModule(keepSprint = new KeepSprint());
this.addModule(longJump = new LongJump());
this.addModule(noSlow = new NoSlow());
Expand Down Expand Up @@ -239,6 +242,7 @@ public void register() {
this.addModule(viewPackets = new ViewPackets());
this.addModule(new FlagDetector());
this.addModule(chatAI = new ChatAI());
this.addModule(new Test());

// player
this.addModule(new AntiAFK());
Expand All @@ -251,7 +255,7 @@ public void register() {
this.addModule(backtrack = new Backtrack());
this.addModule(blink = new Blink());
this.addModule(chestStealer = new ChestStealer());
this.addModule(new DelayRemover());
this.addModule(new NoJumpDelay());
this.addModule(new FakeLag());
this.addModule(new Freecam());
this.addModule(invManager = new InvManager());
Expand All @@ -272,6 +276,7 @@ public void register() {
this.addModule(new ChestESP());
this.addModule(customCape = new CustomCape());
this.addModule(customName = new CustomName());
this.addModule(customFOV = new CustomFOV());
this.addModule(freeLook = new FreeLook());
this.addModule(fullBright = new FullBright());
this.addModule(hud = new HUD());
Expand All @@ -298,6 +303,7 @@ public void register() {
this.addModule(new KillMessage());
this.addModule(clientTheme = new ClientTheme());
this.addModule(arrayList = new keystrokesmod.module.impl.render.ArrayList());
this.addModule(motionCamera = new MotionCamera());

// world
this.addModule(antiBot = new AntiBot());
Expand Down
Loading