File tree Expand file tree Collapse file tree 3 files changed +54
-1
lines changed
java/com/cleanroommc/groovyscript Expand file tree Collapse file tree 3 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 1+ package com .cleanroommc .groovyscript .compat .mods .projecte ;
2+
3+ import com .cleanroommc .groovyscript .compat .vanilla .ShapedCraftingRecipe ;
4+ import com .cleanroommc .groovyscript .compat .vanilla .ShapelessCraftingRecipe ;
5+ import moze_intel .projecte .emc .mappers .CraftingMapper ;
6+ import net .minecraft .item .crafting .IRecipe ;
7+
8+ public class EMCMapper implements CraftingMapper .IRecipeMapper {
9+
10+ @ Override
11+ public String getName () {
12+ return "GroovyScriptEMCMapper" ;
13+ }
14+
15+ @ Override
16+ public String getDescription () {
17+ return "Supporting GroovyScript class 'ShapedCraftingRecipe' and 'ShapelessCraftingRecipe'" ;
18+ }
19+
20+ @ Override
21+ public boolean canHandle (IRecipe iRecipe ) {
22+ return iRecipe instanceof ShapedCraftingRecipe || iRecipe instanceof ShapelessCraftingRecipe ;
23+ }
24+ }
Original file line number Diff line number Diff line change 1+ package com .cleanroommc .groovyscript .core .mixin .projecte ;
2+
3+ import com .cleanroommc .groovyscript .compat .mods .projecte .EMCMapper ;
4+ import moze_intel .projecte .emc .mappers .CraftingMapper ;
5+ import moze_intel .projecte .emc .mappers .CraftingMapper .IRecipeMapper ;
6+ import org .spongepowered .asm .mixin .Final ;
7+ import org .spongepowered .asm .mixin .Mixin ;
8+ import org .spongepowered .asm .mixin .Mutable ;
9+ import org .spongepowered .asm .mixin .Shadow ;
10+ import org .spongepowered .asm .mixin .injection .At ;
11+ import org .spongepowered .asm .mixin .injection .Inject ;
12+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
13+
14+ import java .util .ArrayList ;
15+ import java .util .List ;
16+
17+ @ Mixin (value = CraftingMapper .class , remap = false )
18+ public class CraftingMapperMixin {
19+
20+ @ Shadow @ Final @ Mutable
21+ private List <IRecipeMapper > recipeMappers ;
22+
23+ @ Inject (method = "<init>" , at = @ At ("RETURN" ))
24+ private void onInit (CallbackInfo ci ) {
25+ this .recipeMappers = new ArrayList <>(this .recipeMappers );
26+ this .recipeMappers .add (new EMCMapper ());
27+ }
28+ }
Original file line number Diff line number Diff line change 55 "minVersion" : " 0.8" ,
66 "compatibilityLevel" : " JAVA_8" ,
77 "mixins" : [
8- " WorldHelperAccessor"
8+ " WorldHelperAccessor" ,
9+ " CraftingMapperMixin"
910 ]
1011}
You can’t perform that action at this time.
0 commit comments