Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.14-dev' into 2.14-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-mc committed Dec 6, 2024
2 parents cd35915 + 1704c90 commit eef8c38
Show file tree
Hide file tree
Showing 6 changed files with 270 additions and 24 deletions.
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 }}
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());

}

}
}



}
2 changes: 2 additions & 0 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 @@ -272,6 +273,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 Down
Loading

0 comments on commit eef8c38

Please sign in to comment.