File tree Expand file tree Collapse file tree
java/com/gregtechceu/gtceu/core/mixins Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .gregtechceu .gtceu .core .mixins ;
22
33import net .minecraftforge .fml .ModList ;
4+ import net .minecraftforge .fml .loading .FMLLoader ;
45import net .minecraftforge .fml .loading .LoadingModList ;
56
67import org .objectweb .asm .tree .ClassNode ;
@@ -25,6 +26,8 @@ public String getRefMapperConfig() {
2526 private static final String MIXIN_PACKAGE = "com.gregtechceu.gtceu.core.mixins." ;
2627 private static final Map <String , String > MOD_COMPAT_MIXINS = new HashMap <>();
2728
29+ private static final String DEV_PACKAGE = MIXIN_PACKAGE + "dev." ;
30+
2831 static {
2932 MOD_COMPAT_MIXINS .put ("roughlyenoughitems" , MIXIN_PACKAGE + "rei" );
3033 addModCompatMixin ("emi" );
@@ -37,6 +40,9 @@ public String getRefMapperConfig() {
3740
3841 @ Override
3942 public boolean shouldApplyMixin (String targetClassName , String mixinClassName ) {
43+ if (mixinClassName .startsWith (DEV_PACKAGE )) {
44+ return !FMLLoader .isProduction ();
45+ }
4046 for (var compatMod : MOD_COMPAT_MIXINS .entrySet ()) {
4147 if (mixinClassName .startsWith (compatMod .getValue ())) {
4248 return isModLoaded (compatMod .getKey ());
Original file line number Diff line number Diff line change 1+ package com .gregtechceu .gtceu .core .mixins .dev .test ;
2+
3+ import com .gregtechceu .gtceu .utils .FormattingUtil ;
4+
5+ import net .minecraft .gametest .framework .GameTestRegistry ;
6+
7+ import com .llamalad7 .mixinextras .injector .ModifyExpressionValue ;
8+ import org .spongepowered .asm .mixin .Mixin ;
9+ import org .spongepowered .asm .mixin .injection .At ;
10+
11+ @ Mixin (GameTestRegistry .class )
12+ public class GameTestRegistryMixin {
13+
14+ @ ModifyExpressionValue (method = "turnMethodIntoTestFunction" ,
15+ at = @ At (value = "INVOKE" , target = "Ljava/lang/reflect/Method;getName()Ljava/lang/String;" ))
16+ private static String gtceu$makeTestMethodNameSnakeCase (String original ) {
17+ return FormattingUtil .toLowerCaseUnderscore (original );
18+ }
19+ }
Original file line number Diff line number Diff line change 6161 " TagManagerMixin" ,
6262 " TagValueAccessor" ,
6363 " client.ItemEntityMixin" ,
64+ " dev.test.GameTestRegistryMixin" ,
6465 " emi.EmiRecipeFillerMixin" ,
6566 " emi.FillRecipePacketMixin" ,
6667 " emi.FluidEmiStackMixin" ,
You can’t perform that action at this time.
0 commit comments