diff --git a/dependencies.gradle b/dependencies.gradle index ea1f482..b6456d0 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,9 +1,5 @@ // Add your dependencies here dependencies { - compileOnly("com.github.GTNewHorizons:GT5-Unofficial:experimental-SNAPSHOT:dev") { - // Only get GT5U and not its dependencies, since it won't be run in dev. It is an optional dependency - transitive = false - setChanging(true) - } + } diff --git a/gradle.properties b/gradle.properties index 6ef1f3d..c4d7c82 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,11 +33,11 @@ apiPackage = accessTransformersFile = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! -usesMixins = true +usesMixins = false # Specify the location of your implementation of IMixinPlugin. Leave it empty otherwise. -mixinPlugin = mixinplugin.MixinPlugin +mixinPlugin = # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! -mixinsPackage = mixins +mixinsPackage = # 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 diff --git a/repositories.gradle b/repositories.gradle index 7d02b58..f7d641b 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -1,7 +1,5 @@ // Add any additional repositiroes for your dependencies here repositories { - maven { - url = "https://jitpack.io" - } + } diff --git a/src/main/java/com/myname/mymodid/mixinplugin/Mixin.java b/src/main/java/com/myname/mymodid/mixinplugin/Mixin.java deleted file mode 100644 index d519f83..0000000 --- a/src/main/java/com/myname/mymodid/mixinplugin/Mixin.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.myname.mymodid.mixinplugin; - -import java.util.Arrays; -import java.util.List; - -import static com.myname.mymodid.mixinplugin.TargetedMod.*; - -public enum Mixin { - - // - // IMPORTANT: Do not make any references to any mod from this file. This file is loaded quite early on and if - // you refer to other mods you load them as well. The consequence is: You can't inject any previously loaded classes! - // Exception: Tags.java, as long as it is used for Strings only! - // - - // Replace with your own mixins: - ItemEditableBookMixin("minecraft.ItemEditableBookMixin", VANILLA), - // You may also require multiple mods to be loaded if your mixin requires both - GT_Block_Ores_AbstractMixin("gregtech.GT_Block_Ores_AbstractMixin", GREGTECH, VANILLA); - - public final String mixinClass; - public final List targetedMods; - - Mixin(String mixinClass, TargetedMod... targetedMods) { - this.mixinClass = mixinClass; - this.targetedMods = Arrays.asList(targetedMods); - } -} diff --git a/src/main/java/com/myname/mymodid/mixinplugin/MixinPlugin.java b/src/main/java/com/myname/mymodid/mixinplugin/MixinPlugin.java deleted file mode 100644 index bd5b3b2..0000000 --- a/src/main/java/com/myname/mymodid/mixinplugin/MixinPlugin.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.myname.mymodid.mixinplugin; - -import com.myname.mymodid.Tags; -import net.minecraft.launchwrapper.Launch; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.lib.tree.ClassNode; -import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; -import org.spongepowered.asm.mixin.extensibility.IMixinInfo; -import ru.timeconqueror.spongemixins.MinecraftURLClassPath; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import static com.myname.mymodid.mixinplugin.TargetedMod.VANILLA; - -public class MixinPlugin implements IMixinConfigPlugin { - - private static final Logger LOG = LogManager.getLogger(Tags.MODID + " mixins"); - - @Override - public void onLoad(String mixinPackage) { - - } - - @Override - public String getRefMapperConfig() { - return null; - } - - @Override - public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { - return true; - } - - @Override - public void acceptTargets(Set myTargets, Set otherTargets) { - - } - - // This method return a List of mixins. Every mixins in this list will be loaded. - @Override - public List getMixins() { - final boolean isDevelopmentEnvironment = (boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); - - List loadedMods = Arrays.stream(TargetedMod.values()) - .filter(mod -> mod == VANILLA - || (mod.loadInDevelopment && isDevelopmentEnvironment) - || loadJar(mod.jarNameBeginsWith)) - .collect(Collectors.toList()); - for (TargetedMod mod : TargetedMod.values()) { - if(loadedMods.contains(mod)) { - LOG.info("Found " + mod.modName + "! Integrating now..."); - } - else { - LOG.info("Could not find " + mod.modName + "! Skipping integration...."); - } - } - - List mixins = new ArrayList<>(); - for (Mixin mixin : Mixin.values()) { - if (loadedMods.containsAll(mixin.targetedMods)) { - mixins.add(mixin.mixinClass); - LOG.debug("Loading mixin: " + mixin.mixinClass); - } - } - return mixins; - } - - private boolean loadJar(final String jarNameBeginsWith) { - try { - File jar = MinecraftURLClassPath.getJarInModPath(jarNameBeginsWith); - if(jar == null) { - LOG.info("Jar not found: " + jarNameBeginsWith); - return false; - } - - LOG.info("Attempting to add " + jar + " to the URL Class Path"); - if(!jar.exists()) { - throw new FileNotFoundException(jar.toString()); - } - MinecraftURLClassPath.addJar(jar); - return true; - } - catch (Exception e) { - e.printStackTrace(); - return false; - } - } - - @Override - public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { - - } - - @Override - public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { - - } -} \ No newline at end of file diff --git a/src/main/java/com/myname/mymodid/mixinplugin/TargetedMod.java b/src/main/java/com/myname/mymodid/mixinplugin/TargetedMod.java deleted file mode 100644 index 3a6304a..0000000 --- a/src/main/java/com/myname/mymodid/mixinplugin/TargetedMod.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.myname.mymodid.mixinplugin; - -public enum TargetedMod { - - // - // IMPORTANT: Do not make any references to any mod from this file. This file is loaded quite early on and if - // you refer to other mods you load them as well. The consequence is: You can't inject any previously loaded classes! - // Exception: Tags.java, as long as it is used for Strings only! - // - - // Replace with your injected mods here, but always keep VANILLA: - VANILLA("Minecraft", "unused", true), - GREGTECH("GregTech", "gregtech", false); - - public final String modName; - public final String jarNameBeginsWith; - // Optional dependencies can be omitted in development. Especially skipping GT5U will drastically speed up your game start! - public final boolean loadInDevelopment; - - TargetedMod(String modName, String jarNameBeginsWith, boolean loadInDevelopment) { - this.modName = modName; - this.jarNameBeginsWith = jarNameBeginsWith; - this.loadInDevelopment = loadInDevelopment; - } -} diff --git a/src/main/java/com/myname/mymodid/mixins/gregtech/GT_Block_Ores_AbstractMixin.java b/src/main/java/com/myname/mymodid/mixins/gregtech/GT_Block_Ores_AbstractMixin.java deleted file mode 100644 index c480f8c..0000000 --- a/src/main/java/com/myname/mymodid/mixins/gregtech/GT_Block_Ores_AbstractMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.myname.mymodid.mixins.gregtech; - -import com.myname.mymodid.MyMod; -import gregtech.api.items.GT_Generic_Block; -import gregtech.common.blocks.GT_Block_Ores_Abstract; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; - -@Mixin(value = GT_Block_Ores_Abstract.class, remap = false) -public class GT_Block_Ores_AbstractMixin extends GT_Generic_Block { - - protected GT_Block_Ores_AbstractMixin() { - super(null, null, null); - } - - @Override - public boolean onBlockActivated(World world, int blockX, int blockY, int blockZ, EntityPlayer player, int side, float offsetX, float offsetY, float offsetZ) { - MyMod.info("You touched a GT Ore!"); - return super.onBlockActivated(world, blockX, blockY, blockZ, player, side, offsetX, offsetY, offsetZ); - } - - @Override - public void onBlockClicked(World world, int blockX, int blockY, int blockZ, EntityPlayer player) { - MyMod.info("You touched a GT Ore!"); - super.onBlockClicked(world, blockX, blockY, blockZ, player); - } -} diff --git a/src/main/java/com/myname/mymodid/mixins/minecraft/ItemEditableBookMixin.java b/src/main/java/com/myname/mymodid/mixins/minecraft/ItemEditableBookMixin.java deleted file mode 100644 index 268227a..0000000 --- a/src/main/java/com/myname/mymodid/mixins/minecraft/ItemEditableBookMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.myname.mymodid.mixins.minecraft; - -import com.myname.mymodid.MyMod; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemEditableBook; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; - -@Mixin(value = ItemEditableBook.class) -public class ItemEditableBookMixin { - - @Inject(method = "onItemRightClick", - at = @At("HEAD"), - require = 1, - locals = LocalCapture.CAPTURE_FAILEXCEPTION) - private void onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer, CallbackInfoReturnable callbackInfoReturnable) { - MyMod.info("You are reading a book"); - } -} \ No newline at end of file