Skip to content

Commit 0b86937

Browse files
Merge 1.21.4 into 1.21.1
1 parent 7d56119 commit 0b86937

File tree

9 files changed

+179
-35
lines changed

9 files changed

+179
-35
lines changed

.github/workflows/auto_snapshot_update.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
run: |
6464
./gradlew migrateMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
6565
./gradlew migrateTestMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
66+
./gradlew migrateClassTweakerMappings --mappings ${{ inputs.yarn_mappings }} --overrideInputsIHaveABackup
6667
6768
- name: Update version constants
6869
run: |

build.gradle

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ buildscript {
22
dependencies {
33
classpath "org.kohsuke:github-api:1.330"
44
}
5-
6-
configurations.classpath {
7-
resolutionStrategy {
8-
// v28.0-jre, used by fabric-loom 1.13.3, is vulnerable to CVE-2020-8908 and CVE-2023-2976
9-
force "com.google.guava:guava:32.0.1-jre"
10-
}
11-
}
125
}
136

147
plugins {
@@ -33,22 +26,6 @@ repositories {
3326
// for more information about repositories.
3427
}
3528

36-
// Override vulnerable dependencies until Minecraft updates to newer versions
37-
configurations.all {
38-
resolutionStrategy {
39-
// v3.14.0, used by Minecraft 1.20.5 - 1.21.3, is vulnerable to CVE-2025-48924
40-
force "org.apache.commons:commons-lang3:3.18.0"
41-
// v4.1.97.Final, used by Minecraft 1.21 - 1.21.3, is vulnerable to CVE-2024-47535 and CVE-2025-25193
42-
force "io.netty:netty-common:4.1.118.Final"
43-
// v4.1.97.Final, used by Minecraft 1.21 - 1.21.3, is vulnerable to CVE-2025-24970
44-
force "io.netty:netty-handler:4.1.118.Final"
45-
// v4.1.97.Final, used by Minecraft 1.21 - 1.21.3, is vulnerable to CVE-2025-58057
46-
force "io.netty:netty-codec:4.1.125.Final"
47-
// v4.1.97.Final, used by Minecraft 1.21 - 1.21.3, is vulnerable to CVE-2025-58056
48-
force "io.netty:netty-codec-http:4.1.125.Final"
49-
}
50-
}
51-
5229
dependencies {
5330
// To change the versions see the gradle.properties file
5431
minecraft "com.mojang:minecraft:${project.minecraft_version}"
@@ -162,14 +139,14 @@ spotless {
162139
eclipse().configFile(file("codestyle/formatter.xml"))
163140
}
164141
format("licenseHeader") {
165-
target("src/*/java/**/*.java", "src/test/java/**/*.java")
142+
target("src/*/java/**/*.java")
166143
def header_file = file("codestyle/license_header.txt")
167144
def delimiter = LicenseHeaderStep.DEFAULT_JAVA_HEADER_DELIMITER
168145
licenseHeaderFile(header_file, delimiter).updateYearWithLatest(true)
169146
}
170147
json {
171-
target "src/**/*.json"
172-
gson().indentWithSpaces(2).version("2.10.1")
148+
target("src/**/*.json", "src/**/*.mcmeta")
149+
gson().indentWithSpaces(2).version("2.11.0")
173150
}
174151
}
175152

src/main/java/net/wurstclient/hacks/autofarm/plants/ChorusPlantPlantType.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,20 @@ public Item getSeedItem()
5757
@Override
5858
public boolean shouldHarvestByMining(BlockPos pos, BlockState state)
5959
{
60-
if(state.isOf(Blocks.CHORUS_FLOWER)
61-
&& state.getOrEmpty(ChorusFlowerBlock.AGE)
62-
.orElse(0) == ChorusFlowerBlock.MAX_AGE)
63-
return true;
60+
if(state.isOf(Blocks.CHORUS_FLOWER))
61+
return isFlowerFullyGrown(pos, state);
6462

65-
if(!state.isOf(Blocks.CHORUS_PLANT))
66-
return false;
63+
if(state.isOf(Blocks.CHORUS_PLANT))
64+
return !hasAttachedFlowers(pos, state, new HashSet<>());
6765

68-
return !hasAttachedFlowers(pos, state, new HashSet<>());
66+
return false;
67+
}
68+
69+
private boolean isFlowerFullyGrown(BlockPos pos, BlockState state)
70+
{
71+
return state.getOrEmpty(ChorusFlowerBlock.AGE)
72+
.orElse(0) == ChorusFlowerBlock.MAX_AGE
73+
|| !BlockUtils.getState(pos.up()).isAir();
6974
}
7075

7176
private boolean hasAttachedFlowers(BlockPos pos, BlockState state,
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (c) 2014-2025 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.mixin;
9+
10+
import org.jetbrains.annotations.Nullable;
11+
import org.spongepowered.asm.mixin.Mixin;
12+
import org.spongepowered.asm.mixin.Pseudo;
13+
import org.spongepowered.asm.mixin.Shadow;
14+
import org.spongepowered.asm.mixin.injection.At;
15+
import org.spongepowered.asm.mixin.injection.Inject;
16+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
17+
18+
import net.minecraft.block.BlockState;
19+
import net.minecraft.util.math.BlockPos;
20+
import net.minecraft.util.math.Direction;
21+
import net.wurstclient.event.EventManager;
22+
import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent;
23+
24+
/**
25+
* Last updated for <a href=
26+
* "https://github.com/CaffeineMC/sodium/tree/320aad8b70bf22254452872c7e9443c8b55efbc5">Sodium
27+
* 0.6.13+mc1.21.4</a>
28+
*/
29+
@Pseudo
30+
@Mixin(targets = {
31+
"net.caffeinemc.mods.sodium.client.render.frapi.render.AbstractBlockRenderContext"})
32+
public class SodiumAbstractBlockRenderContextMixin
33+
{
34+
@Shadow
35+
protected BlockState state;
36+
37+
@Shadow
38+
protected BlockPos pos;
39+
40+
/**
41+
* Hides and shows blocks when using X-Ray with Sodium installed.
42+
*/
43+
@Inject(at = @At("HEAD"),
44+
method = "isFaceCulled(Lnet/minecraft/class_2350;)Z",
45+
cancellable = true,
46+
remap = false,
47+
require = 0)
48+
private void onIsFaceCulled(@Nullable Direction face,
49+
CallbackInfoReturnable<Boolean> cir)
50+
{
51+
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
52+
EventManager.fire(event);
53+
54+
if(event.isRendered() != null)
55+
cir.setReturnValue(!event.isRendered());
56+
}
57+
}

src/main/java/net/wurstclient/mixin/SodiumBlockOcclusionCacheMixin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class SodiumBlockOcclusionCacheMixin
2929
/**
3030
* This mixin hides and shows regular full blocks when using X-Ray with
3131
* Sodium installed. Last updated for Sodium 0.6.0-beta.1+mc1.21.
32+
*
33+
* <p>
34+
* Works with Sodium >=0.6.0-beta.1 and <0.6.13.
3235
*/
3336
@Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true)
3437
public void shouldDrawSide(BlockState state, BlockView world, BlockPos pos,
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2014-2025 Wurst-Imperium and contributors.
3+
*
4+
* This source code is subject to the terms of the GNU General Public
5+
* License, version 3. If a copy of the GPL was not distributed with this
6+
* file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt
7+
*/
8+
package net.wurstclient.mixin;
9+
10+
import org.spongepowered.asm.mixin.Mixin;
11+
import org.spongepowered.asm.mixin.Pseudo;
12+
import org.spongepowered.asm.mixin.injection.At;
13+
14+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
15+
16+
import net.wurstclient.WurstClient;
17+
import net.wurstclient.hacks.XRayHack;
18+
19+
/**
20+
* Last updated for <a href=
21+
* "https://github.com/CaffeineMC/sodium/tree/320aad8b70bf22254452872c7e9443c8b55efbc5">Sodium
22+
* 0.6.13+mc1.21.4</a>
23+
*/
24+
@Pseudo
25+
@Mixin(targets = {
26+
"net.caffeinemc.mods.sodium.client.render.chunk.compile.pipeline.BlockRenderer"},
27+
remap = false)
28+
public class SodiumBlockRendererMixin
29+
extends SodiumAbstractBlockRenderContextMixin
30+
{
31+
/**
32+
* Modifies opacity of blocks when using X-Ray with Sodium installed.
33+
*/
34+
@ModifyExpressionValue(at = @At(value = "INVOKE",
35+
target = "Lnet/caffeinemc/mods/sodium/client/render/frapi/mesh/MutableQuadViewImpl;color(I)I"),
36+
method = "bufferQuad(Lnet/caffeinemc/mods/sodium/client/render/frapi/mesh/MutableQuadViewImpl;[FLnet/caffeinemc/mods/sodium/client/render/chunk/terrain/material/Material;)V",
37+
require = 0)
38+
private int onBufferQuad(int original)
39+
{
40+
XRayHack xray = WurstClient.INSTANCE.getHax().xRayHack;
41+
if(!xray.isOpacityMode() || xray.isVisible(state.getBlock(), pos))
42+
return original;
43+
44+
return original & xray.getOpacityColorMask();
45+
}
46+
}

src/main/java/net/wurstclient/mixin/SodiumDefaultFluidRendererMixin.java

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@
1414
import org.spongepowered.asm.mixin.injection.Inject;
1515
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1616

17+
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
18+
import com.llamalad7.mixinextras.sugar.Local;
19+
1720
import net.minecraft.block.BlockState;
1821
import net.minecraft.fluid.Fluid;
1922
import net.minecraft.fluid.FluidState;
2023
import net.minecraft.util.math.BlockPos;
2124
import net.minecraft.util.math.Direction;
2225
import net.minecraft.world.BlockRenderView;
26+
import net.wurstclient.WurstClient;
2327
import net.wurstclient.event.EventManager;
2428
import net.wurstclient.events.ShouldDrawSideListener.ShouldDrawSideEvent;
29+
import net.wurstclient.hacks.XRayHack;
2530

2631
@Pseudo
2732
@Mixin(targets = {
@@ -42,6 +47,7 @@ public class SodiumDefaultFluidRendererMixin
4247
@Inject(at = @At("HEAD"),
4348
method = "isFluidOccluded(Lnet/minecraft/class_1920;IIILnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_3611;)Z",
4449
cancellable = true,
50+
remap = false,
4551
require = 0)
4652
private void onIsFluidOccludedInSodium060(BlockRenderView world, int x,
4753
int y, int z, Direction dir, BlockState state, Fluid fluid,
@@ -60,7 +66,8 @@ private void onIsFluidOccludedInSodium060(BlockRenderView world, int x,
6066
* This mixin hides and shows fluids when using X-Ray with Sodium installed.
6167
*
6268
* <p>
63-
* Works with Sodium >=0.6.1. Last tested with Sodium 0.6.5+mc1.21.1.
69+
* Works with Sodium >=0.6.1 and <0.6.13. Last tested with Sodium
70+
* 0.6.5+mc1.21.1.
6471
*/
6572
@Inject(at = @At("HEAD"),
6673
method = "isFluidOccluded(Lnet/minecraft/class_1920;IIILnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_3610;)Z",
@@ -78,4 +85,48 @@ private void onIsFluidOccluded(BlockRenderView world, int x, int y, int z,
7885
if(event.isRendered() != null)
7986
cir.setReturnValue(!event.isRendered());
8087
}
88+
89+
/**
90+
* Hides and shows fluids when using X-Ray with Sodium installed.
91+
*
92+
* <p>
93+
* Works with Sodium >=0.6.13. Last updated for Sodium 0.6.13+mc1.21.4.
94+
*/
95+
@Inject(at = @At("HEAD"),
96+
method = "isFullBlockFluidOccluded(Lnet/minecraft/class_1920;Lnet/minecraft/class_2338;Lnet/minecraft/class_2350;Lnet/minecraft/class_2680;Lnet/minecraft/class_3610;)Z",
97+
cancellable = true,
98+
remap = false,
99+
require = 0)
100+
private void onIsFullBlockFluidOccluded(BlockRenderView world, BlockPos pos,
101+
Direction dir, BlockState state, FluidState fluid,
102+
CallbackInfoReturnable<Boolean> cir)
103+
{
104+
ShouldDrawSideEvent event = new ShouldDrawSideEvent(state, pos);
105+
EventManager.fire(event);
106+
107+
if(event.isRendered() != null)
108+
cir.setReturnValue(!event.isRendered());
109+
}
110+
111+
/**
112+
* Modifies opacity of fluids when using X-Ray with Sodium installed.
113+
*
114+
* <p>
115+
* Works with Sodium >=0.6.13. Last updated for Sodium 0.6.13+mc1.21.4.
116+
*/
117+
@ModifyExpressionValue(at = @At(value = "INVOKE",
118+
target = "Lnet/caffeinemc/mods/sodium/api/util/ColorARGB;toABGR(I)I"),
119+
method = "updateQuad",
120+
require = 0,
121+
remap = false)
122+
private int onUpdateQuad(int original, @Local(argsOnly = true) BlockPos pos,
123+
@Local(argsOnly = true) FluidState state)
124+
{
125+
XRayHack xray = WurstClient.INSTANCE.getHax().xRayHack;
126+
if(!xray.isOpacityMode()
127+
|| xray.isVisible(state.getBlockState().getBlock(), pos))
128+
return original;
129+
130+
return original & xray.getOpacityColorMask();
131+
}
81132
}

src/main/resources/wurst.accesswidener

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ accessible method net/minecraft/client/gui/screen/ingame/HandledScreen onMouseCl
44
accessible method net/minecraft/client/gui/screen/multiplayer/MultiplayerScreen connect (Lnet/minecraft/client/network/ServerInfo;)V
55
accessible method net/minecraft/client/MinecraftClient doItemUse ()V
66
accessible method net/minecraft/client/Mouse onMouseButton (JIII)V
7+
accessible method net/minecraft/client/particle/ParticleManager clearParticles ()V
78
accessible method net/minecraft/client/render/BackgroundRenderer getFogModifier (Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;
89
accessible method net/minecraft/client/render/GameRenderer loadPostProcessor (Lnet/minecraft/util/Identifier;)V
910
accessible method net/minecraft/component/ComponentMap$Builder put (Lnet/minecraft/component/ComponentType;Ljava/lang/Object;)V
@@ -23,6 +24,7 @@ accessible field net/minecraft/client/network/ClientPlayerEntity lastYaw F
2324
accessible field net/minecraft/client/network/ClientPlayerInteractionManager blockBreakingCooldown I
2425
accessible field net/minecraft/client/network/ClientPlayerInteractionManager breakingBlock Z
2526
accessible field net/minecraft/client/network/ClientPlayerInteractionManager currentBreakingProgress F
27+
accessible field net/minecraft/client/texture/NativeImage pointer J
2628
accessible field net/minecraft/client/toast/ToastManager toastQueue Ljava/util/Deque;
2729
accessible field net/minecraft/entity/Entity movementMultiplier Lnet/minecraft/util/math/Vec3d;
2830
accessible field net/minecraft/network/packet/s2c/play/ChunkDeltaUpdateS2CPacket sectionPos Lnet/minecraft/util/math/ChunkSectionPos;

src/main/resources/wurst.mixins.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@
6060
"ScreenMixin",
6161
"ShulkerBoxScreenMixin",
6262
"SimpleOptionMixin",
63-
"SodiumDefaultFluidRendererMixin",
63+
"SodiumAbstractBlockRenderContextMixin",
6464
"SodiumBlockOcclusionCacheMixin",
65+
"SodiumBlockRendererMixin",
66+
"SodiumDefaultFluidRendererMixin",
6567
"StatsScreenMixin",
6668
"StatusEffectInstanceMixin",
6769
"TelemetryManagerMixin",

0 commit comments

Comments
 (0)