Skip to content

Commit

Permalink
Merge tag 'v7.46.1' into 1.21.2-pre2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Oct 11, 2024
2 parents b744155 + 0966dd4 commit 852b196
Showing 10 changed files with 119 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ loader_version=0.16.6
fabric_version=0.105.3+1.21.2

# Mod Properties
mod_version = v7.46-MC1.21.2-pre2
mod_version = v7.46.1-MC1.21.2-pre2
maven_group = net.wurstclient
archives_base_name = Wurst-Client

2 changes: 1 addition & 1 deletion src/main/java/net/wurstclient/WurstClient.java
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ public enum WurstClient
public static MinecraftClient MC;
public static IMinecraftClient IMC;

public static final String VERSION = "7.46";
public static final String VERSION = "7.46.1";
public static final String MC_VERSION = "1.21.2-pre2";

private WurstAnalytics analytics;
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ public static void login(String email, String password)

Session session = new Session(mcProfile.getName(), mcProfile.getUUID(),
mcProfile.getAccessToken(), Optional.empty(), Optional.empty(),
Session.AccountType.MOJANG);
Session.AccountType.MSA);

WurstClient.IMC.setSession(session);
}
11 changes: 6 additions & 5 deletions src/main/java/net/wurstclient/hacks/AntiKnockbackHack.java
Original file line number Diff line number Diff line change
@@ -21,19 +21,20 @@ public final class AntiKnockbackHack extends Hack implements KnockbackListener
private final SliderSetting hStrength =
new SliderSetting("Horizontal Strength",
"How far to reduce horizontal knockback.\n"
+ "-100% = double knockback\n" + "0% = normal knockback\n"
+ "100% = no knockback\n" + ">100% = reverse knockback",
1, 0.01, 2, 0.01, ValueDisplay.PERCENTAGE);
1, -1, 2, 0.01, ValueDisplay.PERCENTAGE);

private final SliderSetting vStrength =
new SliderSetting("Vertical Strength",
"How far to reduce vertical knockback.\n" + "100% = no knockback\n"
+ ">100% = reverse knockback",
1, 0.01, 2, 0.01, ValueDisplay.PERCENTAGE);
"How far to reduce vertical knockback.\n"
+ "-100% = double knockback\n" + "0% = normal knockback\n"
+ "100% = no knockback\n" + ">100% = reverse knockback",
1, -1, 2, 0.01, ValueDisplay.PERCENTAGE);

public AntiKnockbackHack()
{
super("AntiKnockback");

setCategory(Category.COMBAT);
addSetting(hStrength);
addSetting(vStrength);
14 changes: 7 additions & 7 deletions src/main/java/net/wurstclient/mixin/MinecraftClientMixin.java
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
package net.wurstclient.mixin;

import java.io.File;
import java.util.UUID;

import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
@@ -27,7 +26,6 @@
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.session.ProfileKeys;
import net.minecraft.client.session.ProfileKeysImpl;
import net.minecraft.client.session.Session;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
@@ -59,7 +57,7 @@ public abstract class MinecraftClientMixin
private YggdrasilAuthenticationService authenticationService;

private Session wurstSession;
private ProfileKeysImpl wurstProfileKeys;
private ProfileKeys wurstProfileKeys;

private MinecraftClientMixin(WurstClient wurst, String name)
{
@@ -213,10 +211,12 @@ public void setSession(Session session)
{
wurstSession = session;

UserApiService userApiService = authenticationService
.createUserApiService(session.getAccessToken());
UUID uuid = wurstSession.getUuidOrNull();
UserApiService userApiService =
session.getAccountType() == Session.AccountType.MSA
? authenticationService.createUserApiService(
session.getAccessToken())
: UserApiService.OFFLINE;
wurstProfileKeys =
new ProfileKeysImpl(userApiService, uuid, runDirectory.toPath());
ProfileKeys.create(userApiService, session, runDirectory.toPath());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (c) 2014-2024 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockView;
import net.wurstclient.event.EventManager;
import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent;

@Pseudo
@Mixin(targets = {
// < Sodium 0.6.0-beta.1
"me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache",
// < Sodium 0.5.0
"me.jellysquid.mods.sodium.client.render.occlusion.BlockOcclusionCache"},
remap = false)
public class SodiumOldBlockOcclusionCacheMixin
{
/**
* This mixin hides and shows regular full blocks when using X-Ray with
* old versions of Sodium installed.
*/
@Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true)
public void shouldDrawSide(BlockState state, BlockView world, BlockPos pos,
Direction side, CallbackInfoReturnable<Boolean> cir)
{
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
EventManager.fire(event);

if(event.isRendered() != null)
cir.setReturnValue(event.isRendered());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2014-2024 Wurst-Imperium and contributors.
*
* This source code is subject to the terms of the GNU General Public
* License, version 3. If a copy of the GPL was not distributed with this
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
*/
package net.wurstclient.mixin;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.BlockRenderView;
import net.wurstclient.event.EventManager;
import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent;

@Pseudo
@Mixin(targets = {
// < Sodium 0.6.0-beta.1
"me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.FluidRenderer",
// < Sodium 0.4.9
"me.jellysquid.mods.sodium.client.render.pipeline.FluidRenderer"},
remap = false)
public class SodiumOldFluidRendererMixin
{
/**
* This mixin hides and shows fluids when using X-Ray with old versions of
* Sodium installed.
*/
@Inject(at = @At("HEAD"), method = "isSideExposed", cancellable = true)
private void isSideExposed(BlockRenderView world, int x, int y, int z,
Direction dir, float height, CallbackInfoReturnable<Boolean> cir)
{
BlockPos pos = new BlockPos(x, y, z);
BlockState state = world.getBlockState(pos);
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
EventManager.fire(event);

if(event.isRendered() != null)
cir.setReturnValue(event.isRendered());
}
}
7 changes: 6 additions & 1 deletion src/main/java/net/wurstclient/util/RotationUtils.java
Original file line number Diff line number Diff line change
@@ -89,7 +89,12 @@ public static double getAngleToLastReportedLookVec(Vec3d vec)
public static double getAngleToLastReportedLookVec(Rotation rotation)
{
ClientPlayerEntity player = MC.player;
Rotation lastReported = new Rotation(player.lastYaw, player.lastPitch);

// lastYaw/Pitch do not get updated when the player is in a vehicle
Rotation lastReported = player.hasVehicle()
? new Rotation(player.getYaw(), player.getPitch())
: new Rotation(player.lastYaw, player.lastPitch);

return lastReported.getAngleTo(rotation);
}

3 changes: 1 addition & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -36,8 +36,7 @@
"breaks": {
"wi_zoom": "*",
"wi-zoom": "*",
"vulkanmod": "*",
"sodium": "<0.6.0-beta.1"
"vulkanmod": "*"
},
"custom": {
"modmenu": {
2 changes: 2 additions & 0 deletions src/main/resources/wurst.mixins.json
Original file line number Diff line number Diff line change
@@ -61,6 +61,8 @@
"SimpleOptionMixin",
"SodiumBlockOcclusionCacheMixin",
"SodiumFluidRendererMixin",
"SodiumOldBlockOcclusionCacheMixin",
"SodiumOldFluidRendererMixin",
"StatsScreenMixin",
"StatusEffectInstanceMixin",
"TelemetryManagerMixin",

0 comments on commit 852b196

Please sign in to comment.