Skip to content

Commit

Permalink
Test Mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
a1640727878 committed Aug 25, 2019
1 parent 62799db commit 282a68f
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ hs_err_pid*
/.gradle/
/bin/
/build/
/run/
/.settings/
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ dependencies {
compile 'org.spongepowered:mixin:0.7.11-SNAPSHOT'
}

jar {

manifest.attributes(
"FMLCorePluginContainsFMLMod": "true",
"ForceLoadAsMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs": "mixins.mohist.json",
"FMLCorePlugin": "red.mohist_community.mohist.MohistCoreMod"
)
}

processResources {

inputs.property "version", project.version
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod_version=1.0
mod_group=com.mohist_community.mohist
mod_group=red.mohist_community.mohist
mod_name=Mohist
mod_class=Mohist

version_minecraft=1.12.2
version_forge=14.23.5.2838
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/red/mohist_community/mohist/Mohist.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package red.mohist_community.mohist;

import net.minecraftforge.fml.common.Mod;

@Mod(modid = "mohist", name = "Mohist")
public class Mohist {

}
45 changes: 45 additions & 0 deletions src/main/java/red/mohist_community/mohist/MohistCoreMod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package red.mohist_community.mohist;

import java.util.Map;

import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.Mixins;

import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;

@IFMLLoadingPlugin.MCVersion("1.12.2")
@IFMLLoadingPlugin.SortingIndex(-5000)
@IFMLLoadingPlugin.Name("Mohist")
public class MohistCoreMod implements IFMLLoadingPlugin {

public MohistCoreMod() {
MixinBootstrap.init();
Mixins.addConfiguration("mixins.mohist.json");
}

@Override
public String[] getASMTransformerClass() {
return new String[0];
}

@Override
public String getModContainerClass() {
return null;
}

@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {

}

@Override
public String getAccessTransformerClass() {
return null;
}

}
11 changes: 11 additions & 0 deletions src/main/resources/mixins.mohist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"required": true,
"minVersion": "0.7.10",
"package": "red.mohist_community.mohist.mixin",
"refmap": "mixins.mohist.refmap.json",
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8",
"mixins": [
"MixinMinecraftServer"
]
}

0 comments on commit 282a68f

Please sign in to comment.