Skip to content

Commit 924be20

Browse files
authored
re-add 1.21.9 support, fix fapi dependency (#5755)
1 parent ee0fbdd commit 924be20

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ dependencies {
7878

7979
modInclude(fabricApi.module("fabric-api-base", properties["fapi_version"] as String))
8080
modInclude(fabricApi.module("fabric-resource-loader-v0", properties["fapi_version"] as String))
81+
modInclude(fabricApi.module("fabric-resource-loader-v1", properties["fapi_version"] as String))
8182

8283
// Compat fixes
8384
modCompileOnly(fabricApi.module("fabric-renderer-indigo", properties["fapi_version"] as String))

src/main/java/meteordevelopment/meteorclient/mixin/CobwebBlockMixin.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.minecraft.entity.EntityCollisionHandler;
1414
import net.minecraft.util.math.BlockPos;
1515
import net.minecraft.world.World;
16+
import org.spongepowered.asm.mixin.Dynamic;
1617
import org.spongepowered.asm.mixin.Mixin;
1718
import org.spongepowered.asm.mixin.injection.At;
1819
import org.spongepowered.asm.mixin.injection.Inject;
@@ -22,8 +23,14 @@
2223

2324
@Mixin(CobwebBlock.class)
2425
public abstract class CobwebBlockMixin {
25-
@Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true)
26+
@Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true, require = 0)
2627
private void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, boolean bl, CallbackInfo ci) {
2728
if (entity == mc.player && Modules.get().get(NoSlow.class).cobweb()) ci.cancel();
2829
}
30+
31+
@Dynamic("1.21.9 Method Parameters")
32+
@Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true, require = 0)
33+
private void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, CallbackInfo ci) {
34+
if (entity == mc.player && Modules.get().get(NoSlow.class).cobweb()) ci.cancel();
35+
}
2936
}

src/main/java/meteordevelopment/meteorclient/mixin/SweetBerryBushBlockMixin.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import net.minecraft.entity.EntityCollisionHandler;
1414
import net.minecraft.util.math.BlockPos;
1515
import net.minecraft.world.World;
16+
import org.spongepowered.asm.mixin.Dynamic;
1617
import org.spongepowered.asm.mixin.Mixin;
1718
import org.spongepowered.asm.mixin.injection.At;
1819
import org.spongepowered.asm.mixin.injection.Inject;
@@ -22,8 +23,14 @@
2223

2324
@Mixin(SweetBerryBushBlock.class)
2425
public abstract class SweetBerryBushBlockMixin {
25-
@Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;slowMovement(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Vec3d;)V"), cancellable = true)
26+
@Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;slowMovement(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Vec3d;)V"), cancellable = true, require = 0)
2627
private void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, boolean bl, CallbackInfo ci) {
2728
if (entity == mc.player && Modules.get().get(NoSlow.class).berryBush()) ci.cancel();
2829
}
30+
31+
@Dynamic("1.21.9 Method Parameters")
32+
@Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;slowMovement(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/Vec3d;)V"), cancellable = true, require = 0)
33+
private void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, CallbackInfo ci) {
34+
if (entity == mc.player && Modules.get().get(NoSlow.class).berryBush()) ci.cancel();
35+
}
2936
}

src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"depends": {
4949
"java": ">=21",
50-
"minecraft": ["${minecraft_version}"],
50+
"minecraft": ["${minecraft_version}", "1.21.9"],
5151
"fabricloader": ">=${loader_version}"
5252
},
5353
"breaks": {

0 commit comments

Comments
 (0)