generated from CleanroomMC/TemplateDevEnv
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mixin to OreIngredient to get the oredict name (#204)
- Loading branch information
1 parent
cca1525
commit 6067df5
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cleanroommc/groovyscript/core/mixin/OreIngredientMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.cleanroommc.groovyscript.core.mixin; | ||
|
||
import net.minecraftforge.oredict.OreIngredient; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = OreIngredient.class, remap = false) | ||
public class OreIngredientMixin { | ||
|
||
@Unique | ||
private String groovyScript$oreDict; | ||
|
||
@Inject(at = @At("TAIL"), method = "<init>(Ljava/lang/String;)V") | ||
private void init(String ore, CallbackInfo ci) { | ||
groovyScript$oreDict = ore; | ||
} | ||
|
||
@Unique | ||
public String getOreDict() { | ||
return groovyScript$oreDict; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters