Skip to content

Commit 256b9f8

Browse files
committed
Fixed mixin crash
1 parent 57e9baa commit 256b9f8

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.0.12
2+
3+
- Fixed raid member mixin crash
4+
15
## 4.0.11
26

37
- Fixed persistent maulers (they should properly despawn now)
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
package com.faboslav.friendsandfoes.common.mixin;
22

33
import com.faboslav.friendsandfoes.common.FriendsAndFoes;
4-
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
5-
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
6-
import net.minecraft.world.entity.EntityType;
74
import net.minecraft.world.entity.raid.Raid;
85
import org.spongepowered.asm.mixin.Mixin;
96
import org.spongepowered.asm.mixin.injection.At;
7+
import org.spongepowered.asm.mixin.injection.ModifyArg;
108
import org.spongepowered.asm.mixin.injection.Slice;
119

1210
@Mixin(Raid.RaiderType.class)
1311
public final class RaidMemberMixin
1412
{
15-
@WrapOperation(
13+
@ModifyArg(
1614
method = "<clinit>",
1715
slice = @Slice(
1816
from = @At(
@@ -22,15 +20,12 @@ public final class RaidMemberMixin
2220
),
2321
at = @At(
2422
value = "INVOKE",
25-
target = "Lnet/minecraft/world/entity/raid/Raid$RaiderType;<init>(Ljava/lang/String;ILnet/minecraft/world/entity/EntityType;[I)V"
23+
target = "Lnet/minecraft/world/entity/raid/Raid$RaiderType;<init>(Ljava/lang/String;ILnet/minecraft/world/entity/EntityType;[I)V",
24+
ordinal = 0
2625
)
2726
)
28-
private static void friendsandfoes$wrapEvokerCtor(
29-
String name,
30-
int id,
31-
EntityType<?> type,
32-
int[] countInWave,
33-
Operation<Void> original
27+
private static int[] friendsandfoes_updateCountInWave(
28+
int[] countInWave
3429
) {
3530
if (
3631
(
@@ -42,9 +37,9 @@ public final class RaidMemberMixin
4237
&& FriendsAndFoes.getConfig().enableIceologerInRaids
4338
)
4439
) {
45-
original.call(name, id, type, new int[]{0, 0, 0, 0, 0, 1, 1, 1});
46-
} else {
47-
original.call(name, id, type, countInWave);
40+
return new int[]{0, 0, 0, 0, 0, 1, 1, 1};
4841
}
42+
43+
return new int[]{0, 0, 0, 0, 0, 1, 1, 2};
4944
}
5045
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ java.version=
1010
mod.name=Friends&Foes
1111
mod.id=friendsandfoes
1212
mod.group=com.faboslav.friendsandfoes
13-
mod.version=4.0.11
13+
mod.version=4.0.12
1414
mod.author=Faboslav
1515
mod.description=Adds outvoted and forgotten mobs from the mob vote, expanding on their original concepts and introducing new vanilla-like features.
1616
mod.license=CC-BY-NC-ND-4.0

0 commit comments

Comments
 (0)