mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-17 19:15:16 +00:00
setup mixins
This commit is contained in:
1 parent
796d6b2d87
commit
63628854e6
8 files changed
+83
-78
No files matched your search
+4
-4
@@ -61,17 +61,17 @@ apiPackage =
|
||||
accessTransformersFile =
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
usesMixins = true
|
||||
# Adds some debug arguments like verbose output and export
|
||||
usesMixinDebug = false
|
||||
usesMixinDebug = true
|
||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||
mixinPlugin =
|
||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
||||
mixinsPackage =
|
||||
mixinsPackage = mixins
|
||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||
# This parameter is for legacy compatibility only
|
||||
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
|
||||
coreModClass =
|
||||
coreModClass = mixins.PosteaLoadingPlugin
|
||||
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
|
||||
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
|
||||
containsMixinsAndOrCoreModOnly = false
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package com.myname.mymodid;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import org.spongepowered.asm.launch.MixinBootstrap;
|
||||
import org.spongepowered.asm.mixin.Mixins;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]")
|
||||
public class MyMod {
|
||||
@@ -22,9 +19,6 @@ public class MyMod {
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
MixinBootstrap.init();
|
||||
Mixins.addConfiguration("mixins.json");
|
||||
|
||||
proxy.preInit(event);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.myname.mymodid;
|
||||
|
||||
import com.falsepattern.gasstation.IEarlyMixinLoader;
|
||||
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
||||
import jdk.jfr.Name;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@IFMLLoadingPlugin.TransformerExclusions({ "mods.mymod" })
|
||||
@Name("mymod")
|
||||
@IFMLLoadingPlugin.SortingIndex(1500)
|
||||
@IFMLLoadingPlugin.MCVersion("1.7.10")
|
||||
public final class PosteaLoadingPlugin implements IEarlyMixinLoader, IFMLLoadingPlugin {
|
||||
|
||||
public static final String ItemStackTransformer = "mods.battlegear2.coremod.transformers.EntityPlayerTransformer";
|
||||
|
||||
public static File debugOutputLocation;
|
||||
public static final String[] transformers = new String[] { ItemStackTransformer };
|
||||
|
||||
@Override
|
||||
public String[] getASMTransformerClass() {
|
||||
return transformers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccessTransformerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModContainerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSetupClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectData(Map<String, Object> data) {
|
||||
debugOutputLocation = new File(data.get("mcLocation").toString(), "ItemStack edited classes");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMixinConfigs() {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add("mixins.json" );
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.myname.mymodid.mixins;
|
||||
|
||||
import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader;
|
||||
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@IFMLLoadingPlugin.MCVersion("1.7.10")
|
||||
public final class PosteaLoadingPlugin implements IEarlyMixinLoader, IFMLLoadingPlugin {
|
||||
|
||||
@Override
|
||||
public String[] getASMTransformerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAccessTransformerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModContainerClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSetupClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectData(Map<String, Object> data) {}
|
||||
|
||||
@Override
|
||||
public String getMixinConfig() {
|
||||
return "mixins.mymodid.early.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMixins(Set<String> loadedCoreMods) {
|
||||
final List<String> mixins = new ArrayList<>();
|
||||
mixins.add("MixinItemStack");
|
||||
if (FMLLaunchHandler.side().isClient()) {
|
||||
// register client only mixins here,
|
||||
// that is mixins that target client classes
|
||||
// such as net.minecraft.client.Minecraft class
|
||||
}
|
||||
return mixins;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package com.myname.mymodid;
|
||||
package com.myname.mymodid.mixins.early;
|
||||
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
@@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
@Mixin(ItemStack.class)
|
||||
public abstract class MixinItemStack{
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/item/Item;II)V", at = @At("HEAD"))
|
||||
@Inject(method = "<init>(Lnet/minecraft/item/Item;II)V", at = @At("RETURN"))
|
||||
private void onConstructorHead(Item item, int stackSize, int metadata, CallbackInfo ci) {
|
||||
System.out.println(item.getUnlocalizedName() + " " + metadata + " " + stackSize);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "com.myname.mymodid",
|
||||
"mixins": [
|
||||
"MixinItemStack"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8.5-GTNH",
|
||||
"package": "com.myname.mymodid.mixins.early",
|
||||
"refmap": "mixins.mymodid.refmap.json",
|
||||
"target": "@env(DEFAULT)",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [],
|
||||
"client": [],
|
||||
"server": []
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8.5-GTNH",
|
||||
"refmap": "mixins.mymodid.refmap.json",
|
||||
"target": "@env(DEFAULT)",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [],
|
||||
"client": [],
|
||||
"server": []
|
||||
}
|
||||
Reference in new issue
Block a user