-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathStatsMixin.java
More file actions
55 lines (50 loc) · 2.2 KB
/
StatsMixin.java
File metadata and controls
55 lines (50 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package net.modificationstation.stationapi.mixin.block;
import net.minecraft.item.Item;
import net.minecraft.stat.Stat;
import net.minecraft.stat.Stats;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Stats.class)
class StatsMixin {
@Redirect(
method = "initializeItemStats",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/stat/Stats;initItemsUsedStats([Lnet/minecraft/stat/Stat;Ljava/lang/String;III)[Lnet/minecraft/stat/Stat;"
)
)
private static Stat[] stationapi_stop1(Stat[] statArray, String translationKey, int startId, int statAmount, int arrayLength) {
return new Stat[Item.ITEMS.length];
}
@Redirect(
method = "initializeItemStats",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/stat/Stats;initializeBrokenItemStats([Lnet/minecraft/stat/Stat;Ljava/lang/String;III)[Lnet/minecraft/stat/Stat;"
)
)
private static Stat[] stationapi_stop2(Stat[] statArray, String translationKey, int startId, int statAmount, int arrayLength) {
return new Stat[Item.ITEMS.length];
}
@Redirect(
method = "initializeExtendedItemStats",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/stat/Stats;initItemsUsedStats([Lnet/minecraft/stat/Stat;Ljava/lang/String;III)[Lnet/minecraft/stat/Stat;"
)
)
private static Stat[] stationapi_stop3(Stat[] statArray, String translationKey, int startId, int statAmount, int arrayLength) {
return new Stat[Item.ITEMS.length];
}
@Redirect(
method = "initializeExtendedItemStats",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/stat/Stats;initializeBrokenItemStats([Lnet/minecraft/stat/Stat;Ljava/lang/String;III)[Lnet/minecraft/stat/Stat;"
)
)
private static Stat[] stop4(Stat[] statArray, String translationKey, int startId, int statAmount, int arrayLength) {
return new Stat[Item.ITEMS.length];
}
}