diff --git a/README.md b/README.md index 2050ab7..5d96652 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,45 @@ # NoAutoJump -Simply forces Auto-Jump to be disabled! +[![Downloads](http://cf.way2muchnoise.eu/full_no-auto-jump_downloads.svg)](https://minecraft.curseforge.com/projects/no-auto-jump) [![MCVersion](http://cf.way2muchnoise.eu/versions/no-auto-jump.svg)](https://minecraft.curseforge.com/projects/no-auto-jump) + +[![GitHub issues](https://img.shields.io/github/issues/JackyyTV/NoAutoJump.svg)](https://github.com/JackyyTV/NoAutoJump/issues) [![GitHub pull requests](https://img.shields.io/github/issues-pr/JackyyTV/NoAutoJump.svg)](https://github.com/JackyyTV/NoAutoJump/pulls) [![license](https://img.shields.io/github/license/JackyyTV/NoAutoJump.svg)](../dev-1.12.2/LICENSE) + +[![Logo](https://i.gyazo.com/00a2bbe43870bb032e19e1399fa72411.png)](https://minecraft.curseforge.com/projects/no-auto-jump) + +--- + +## About + +This is the GitHub repo for the No Auto Jump Minecraft mod, where the source code and issue tracker are in here. + +Submit any bug reports / suggestions via [issue tracker](https://github.com/JackyyTV/NoAutoJump/issues). + +[Pull requests](https://github.com/JackyyTV/NoAutoJump/pulls) are welcome if you would like to add features / help with bug fixes or translations. + +--- + +## Contact Me + +- Twitter - [@JackyyTV](https://twitter.com/JackyyTV) +- Discord - Jacky#1234 +- Twitch - [Jackyy](https://www.twitch.tv/jackyy) +- Reddit - [JackyyTV](https://www.reddit.com/message/compose/?to=JackyyTV) + +--- + +## Setting up workspace / compile the mod yourself + +If you would like to set up the workspace yourself to submit PRs of features additions or bug fixes, or compile the mod, here's how you do it. + +1. Clone the mod. + - HTTPS: `git clone https://github.com/JackyyTV/NoAutoJump.git` + - SSH: `git clone git@github.com:JackyyTV/NoAutoJump.git` + - Or, use the GitHub desktop app to clone the repo via GUI interface. + +2. Setting up the workspace, depending on what you need. + - Decompiled source: `gradlew setupDecompWorkspace` + - Obfuscated source: `gradlew setupDevWorkspace` + - CI server: `gradlew setupCIWorkspace` + +3. Either use `gradlew build` to build the jar file (Output is in `build/libs`), or setup the IDE if you are going to modify any codes. Both IntelliJ IDEA and Eclipse are included below since they're more popular IDEs. + - IntelliJ IDEA: Do `gradlew idea`, open the `.ipr` file and import the gradle file, then execute the `genIntellijRuns` task in the "Gradle" tab. + - Eclipse: Do `gradlew eclipse` and open the directory as project. diff --git a/build.gradle b/build.gradle index 3221e80..a10eb54 100644 --- a/build.gradle +++ b/build.gradle @@ -4,13 +4,13 @@ buildscript { maven { url = "http://files.minecraftforge.net/maven" } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' version = "${mc_version}-${mod_version}" -group = "jackydev.noautojump" +group = "jackyy.noautojump" archivesBaseName = "NoAutoJump" sourceCompatibility = targetCompatibility = "1.8" @@ -22,29 +22,25 @@ minecraft { version = "${forge_version}" runDir = "run" mappings = "${mappings_version}" + + replace '@FINGERPRINT@', project.findProperty('signSHA1') + replaceIn "NoAutoJump.java" } repositories { maven { - url "http://dvs1.progwml6.com/files/maven" - } - maven { - url "http://maven.epoxide.xyz" + name = "JEI Maven" + url = "http://dvs1.progwml6.com/files/maven" } maven { - url "http://maven.amadornes.com/" + name = "Hwyla Maven" + url = "https://tehnut.info/maven" } - maven { - url "http://tehnut.info/maven" - } } dependencies { - compile files("libs/Baubles-1.12-1.5.0.jar") - deobfCompile "mezz.jei:jei_1.12.2:+:api" - runtime "mezz.jei:jei_1.12.2:+" - deobfCompile "mcp.mobius.waila:Hwyla:+:api" - runtime "mcp.mobius.waila:Hwyla:+" + deobfCompile "mezz.jei:jei_1.11.2:+" + deobfCompile "mcp.mobius.waila:Hwyla:1.8.22-B37_1.11" } processResources { @@ -59,3 +55,25 @@ processResources { } } +task signJar(type: SignJar, dependsOn: reobfJar) { + onlyIf { + project.hasProperty('keyStore') + } + keyStore = project.findProperty('keyStore') + alias = project.findProperty('keyStoreAlias') + storePass = project.findProperty('keyStorePass') + keyPass = project.findProperty('keyStoreKeyPass') + inputFile = jar.archivePath + outputFile = jar.archivePath +} + +build.dependsOn signJar + +task deobfJar(type: Jar) { + from sourceSets.main.output + classifier = 'deobf' +} + +artifacts { + archives deobfJar +} diff --git a/gradle.properties b/gradle.properties index 5a0cf7a..aee9b83 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx4G -mc_version=1.12 -forge_version=1.12.2-14.23.0.2529 +mc_version=1.11.2 +forge_version=1.11.2-13.20.1.2530 mod_version=1.0 -mappings_version=snapshot_20170917 +mappings_version=stable_32 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e027175..2f7d10e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip diff --git a/src/main/java/jackydev/noautojump/NoAutoJump.java b/src/main/java/jackyy/noautojump/NoAutoJump.java similarity index 62% rename from src/main/java/jackydev/noautojump/NoAutoJump.java rename to src/main/java/jackyy/noautojump/NoAutoJump.java index daed4a6..c5e9cd6 100644 --- a/src/main/java/jackydev/noautojump/NoAutoJump.java +++ b/src/main/java/jackyy/noautojump/NoAutoJump.java @@ -1,4 +1,4 @@ -package jackydev.noautojump; +package jackyy.noautojump; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; @@ -8,17 +8,21 @@ import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLFingerprintViolationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; -@Mod(modid = NoAutoJump.MODID, version = NoAutoJump.VERSION, name = NoAutoJump.MODNAME, acceptedMinecraftVersions = NoAutoJump.MCVERSION, clientSideOnly = true, acceptableRemoteVersions = "*", useMetadata = true) +@Mod(modid = NoAutoJump.MODID, version = NoAutoJump.VERSION, name = NoAutoJump.MODNAME, certificateFingerprint = "@FINGERPRINT@", acceptedMinecraftVersions = NoAutoJump.MCVERSION, clientSideOnly = true, acceptableRemoteVersions = "*", useMetadata = true) public class NoAutoJump { public static final String VERSION = "1.0"; - public static final String MCVERSION = "[1.12,)"; + public static final String MCVERSION = "[1.11,1.12)"; public static final String MODID = "noautojump"; public static final String MODNAME = "No Auto Jump"; + public static final Logger LOGGER = LogManager.getLogger(MODNAME); @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { @@ -36,11 +40,16 @@ public void onClientTick(TickEvent.ClientTickEvent event) { public void onInitGui(GuiScreenEvent.InitGuiEvent.Post event) { if (event.getGui() instanceof GuiControls) { for (GuiButton button : event.getButtonList()) { - if (button instanceof GuiOptionButton && ((GuiOptionButton) button).getOption() == GameSettings.Options.AUTO_JUMP) { + if (button instanceof GuiOptionButton && ((GuiOptionButton) button).returnEnumOptions() == GameSettings.Options.AUTO_JUMP) { button.enabled = false; } } } } + @Mod.EventHandler + public void onFingerprintViolation(FMLFingerprintViolationEvent event) { + LOGGER.warn("Invalid fingerprint detected! The file " + event.getSource().getName() + " may have been modified. This will NOT be supported by the mod author!"); + } + } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index dbbf09e..775be6e 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -4,10 +4,10 @@ "name": "No Auto Jump", "description": "Simply forces Auto-Jump to be disabled!", "version": "1.0", - "mcversion": "1.12", - "url": "https://github.com/Jacky1356400/NoAutoJump", + "mcversion": "1.11.2", + "url": "https://github.com/JackyyTV/NoAutoJump", "updateUrl": "", - "authorList": ["Jacky1356400"], + "authorList": ["Jackyy"], "credits": "", "logoFile": "", "screenshots": [],