Skip to content

Commit

Permalink
rewrite part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
nextdayy committed Jan 9, 2025
1 parent c752191 commit 5c27e19
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 322 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugins {

toolkitLoomHelper {
useOneConfig {
version = "1.0.0-alpha.49"
version = "1.0.0-alpha.51"
loaderVersion = "1.1.0-alpha.35"

usePolyMixin = true
Expand Down
7 changes: 2 additions & 5 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ preprocess {
// "1.8.9-forge"(10809, "srg")
// }

"1.12.2-fabric"(11202, "yarn") {
"1.12.2-forge"(11202, "srg") {
"1.8.9-forge"(10809, "srg") {
"1.8.9-fabric"(10809, "yarn")
}
"1.12.2-forge"(11202, "srg") {
"1.8.9-forge"(10809, "srg") {
}
}

Expand Down
2 changes: 0 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ rootProject.buildFileName = "root.gradle.kts"
// **REMEMBER TO ALSO UPDATE THE `root.gradle.kts` AND `build.gradle.kts` FILES WITH THE NEW VERSION(S).
listOf(
"1.8.9-forge",
"1.8.9-fabric",
"1.12.2-fabric",
"1.12.2-forge"
).forEach { version ->
include(":$version")
Expand Down

This file was deleted.

35 changes: 0 additions & 35 deletions src/main/java/org/polyfrost/behindyou/mixin/MinecraftMixin.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.polyfrost.behindyou.mixin;

import net.minecraft.client.settings.GameSettings;
import org.polyfrost.behindyou.BehindYou;
import net.minecraft.client.renderer.EntityRenderer;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.*;

@Mixin(EntityRenderer.class)
public class Mixin_EntityRendererSetFOVLevel {
@Redirect(method = "orientCamera", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;thirdPersonView:I", ordinal = 0))
private int checkAndKeepF3(GameSettings instance) {
return BehindYou.INSTANCE.isFinished() ? instance.thirdPersonView : 1;
}

@ModifyVariable(method = "orientCamera", at = @At(value = "STORE"), ordinal = 3)
private double set(double z, float partialTicks) {
return BehindYou.INSTANCE.getLevel(z, partialTicks);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.polyfrost.behindyou.mixin;


import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.GameSettings;
import org.objectweb.asm.Opcodes;
import org.polyfrost.behindyou.BehindYou;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(Minecraft.class)
public class Mixin_MinecraftCapturePOVSet {
@Redirect(method = "runTick", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;thirdPersonView:I", opcode = Opcodes.PUTFIELD))
private void capturePOVSetF5(GameSettings instance, int value) {
BehindYou.INSTANCE.setPerspective(value);
}

@Redirect(method = "runGameLoop", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;thirdPersonView:I", opcode = Opcodes.PUTFIELD))
private void capturePOVSetStuckInBlock(GameSettings instance, int value) {
BehindYou.INSTANCE.setPerspective(value);
}
}
Loading

0 comments on commit 5c27e19

Please sign in to comment.