Skip to content

Commit 477abff

Browse files
authored
Fix high light waypoint (#32)
1 parent 635dd10 commit 477abff

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.plusls.ommc.mixin.feature.highlightWaypoint;
2+
3+
import org.spongepowered.asm.mixin.Final;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.Mutable;
6+
import org.spongepowered.asm.mixin.Shadow;
7+
import org.spongepowered.asm.mixin.injection.At;
8+
import org.spongepowered.asm.mixin.injection.Inject;
9+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10+
11+
import java.util.ArrayList;
12+
import java.util.List;
13+
14+
//#if MC > 12002
15+
import net.minecraft.network.chat.MutableComponent;
16+
import net.minecraft.network.chat.Component;
17+
import net.minecraft.network.chat.ComponentContents;
18+
import net.minecraft.network.chat.Style;
19+
//#else
20+
//$$ import top.hendrixshen.magiclib.compat.preprocess.api.DummyClass;
21+
//#endif
22+
23+
//#if MC > 12002
24+
@Mixin(MutableComponent.class)
25+
//#else
26+
//$$ @Mixin(DummyClass.class)
27+
//#endif
28+
public class MixinMutableComponent {
29+
30+
//#if MC > 12002
31+
@Final
32+
@Mutable
33+
@Shadow
34+
private List<Component> siblings;
35+
36+
@Inject(method = "<init>", at = @At("RETURN"))
37+
private void makeMutable(ComponentContents componentContents, List<Component> list, Style style, CallbackInfo ci) {
38+
if (list.getClass().getName().contains("ListN")) {
39+
siblings = new ArrayList<>(list);
40+
}
41+
}
42+
//#endif
43+
}

src/main/resources/ommc.mixins.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"feature.highlightWaypoint.MixinChatHud",
4343
"feature.highlightWaypoint.MixinGameRenderer",
4444
"feature.highlightWaypoint.MixinLevelRenderer",
45+
"feature.highlightWaypoint.MixinMutableComponent",
4546
"feature.preventIntentionalGameDesign.MixinClientPlayerInteractionManager",
4647
"feature.removeBreakCooldown.MixinClientPlayerInteractionManager",
4748
"feature.worldEaterMineHelper.MixinJsonUnbakedModel",

0 commit comments

Comments
 (0)