Răsfoiți Sursa

port to 1.16.5 and close #75

Jared 4 ani în urmă
părinte
comite
b077f253e5

+ 2 - 0
.gitignore

@@ -24,3 +24,5 @@ usernamecache.json
 secrets.json
 changelog.md
 *.launch
+
+logs/

+ 28 - 30
build.gradle

@@ -21,8 +21,6 @@ apply plugin: 'maven-publish'
 
 apply from: 'https://raw.githubusercontent.com/MinecraftModDevelopment/Gradle-Collection/22e7d543a18cd30675277fbfa3669e3d9e206010/generic/secrets.gradle'
 
-import groovy.json.JsonOutput
-
 if (project.hasProperty('secretFile')) {
     loadSecrets(new File((String) findProperty('secretFile')))
 }
@@ -43,7 +41,7 @@ repositories {
 }
 
 minecraft {
-    mappings channel: 'snapshot', version: '20200820-1.16.1'
+    mappings channel: 'snapshot', version: '20201028-1.16.3'
     accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
 
     runs {
@@ -72,33 +70,8 @@ minecraft {
     }
 }
 
-task genGitChangelog() {
-    def stdout = new ByteArrayOutputStream()
-    // first commit to check from, in our case the first commit of the branch
-    String firstCommit = "efff217f353e51ce43751caf94b1924818b710e8";
-    String repoLink = "https://github.com/jaredlll08/Controlling/commit/"
-    // was having issues with grep and spaces in the regex
-    exec {
-        commandLine 'git', 'log', '-i', '--grep=version\\spush', '--grep=open\\sbeta\\sspecific\\scode', '--pretty=tformat:%H', '--date=local', firstCommit + '..@{0}'
-        standardOutput = stdout
-    }
-    if (stdout.toString().trim().indexOf("\n") >= 0) {
-        firstCommit = stdout.toString().split("\n")[0].trim();
-    }
-    System.out.println("Last version hash: \"" + firstCommit + "\"");
-    stdout = new ByteArrayOutputStream()
-    def test = exec {
-        commandLine 'git', 'log', '--pretty=tformat:- [%s](' + repoLink + '%H) - %aN - %cd', '--max-parents=1', '--date=local', firstCommit + "..@"
-        standardOutput = stdout
-    }
-    File file = new File("changelog.md")
-    file.write("### Current version: " + project.version)
-    file.append("\n" + stdout.toString())
-    System.out.println("Changelog generated!")
-}
-
 dependencies {
-    minecraft 'net.minecraftforge:forge:1.16.4-35.0.15'
+    minecraft 'net.minecraftforge:forge:1.16.5-36.0.0'
 }
 
 jar {
@@ -209,7 +182,7 @@ task updateVersionTracker {
         def body = [
                 'author'        : "${project.findProperty('versionTrackerAuthor')}",
                 'projectName'   : "controlling",
-                'gameVersion'   : "1.16.4",
+                'gameVersion'   : "1.16.5",
                 'projectVersion': "${version}",
                 'homepage'      : "${project.findProperty('versionTrackerHomepage')}",
                 'uid'           : "${project.findProperty('versionTrackerKey')}"
@@ -228,4 +201,29 @@ task updateVersionTracker {
         println "VersionCheck Response: ${req.getInputStream().getText()}"
     }
 
+}
+
+task genGitChangelog() {
+    def stdout = new ByteArrayOutputStream()
+    // first commit to check from, in our case the first commit of the branch
+    String firstCommit = "efff217f353e51ce43751caf94b1924818b710e8";
+    String repoLink = "https://github.com/jaredlll08/Controlling/commit/"
+    // was having issues with grep and spaces in the regex
+    exec {
+        commandLine 'git', 'log', '-i', '--grep=version\\spush', '--grep=open\\sbeta\\sspecific\\scode', '--pretty=tformat:%H', '--date=local', firstCommit + '..@{0}'
+        standardOutput = stdout
+    }
+    if (stdout.toString().trim().indexOf("\n") >= 0) {
+        firstCommit = stdout.toString().split("\n")[0].trim();
+    }
+    System.out.println("Last version hash: \"" + firstCommit + "\"");
+    stdout = new ByteArrayOutputStream()
+    def test = exec {
+        commandLine 'git', 'log', '--pretty=tformat:- [%s](' + repoLink + '%H) - %aN - %cd', '--max-parents=1', '--date=local', firstCommit + "..@"
+        standardOutput = stdout
+    }
+    File file = new File("changelog.md")
+    file.write("### Current version: " + project.version)
+    file.append("\n" + stdout.toString())
+    System.out.println("Changelog generated!")
 }

+ 5 - 3
src/main/java/com/blamejared/controlling/client/gui/GuiNewKeyBindingList.java

@@ -11,6 +11,7 @@ import net.minecraft.client.resources.I18n;
 import net.minecraft.client.settings.KeyBinding;
 import net.minecraft.util.text.*;
 import net.minecraftforge.api.distmarker.*;
+import net.minecraftforge.fml.client.gui.GuiUtils;
 import org.apache.commons.lang3.ArrayUtils;
 
 import java.util.*;
@@ -173,15 +174,16 @@ public class GuiNewKeyBindingList extends KeyBindingList {
             if (flag) {
                 this.btnChangeKeyBinding.setMessage(new StringTextComponent(TextFormatting.WHITE + "> " + TextFormatting.YELLOW + message.getString() + TextFormatting.WHITE + " <"));
             } else if (flag1) {
-                IFormattableTextComponent modConflict = TextComponentUtils.func_240648_a_(message.copyRaw(), message.getStyle().setColor(Color.func_240743_a_(16755200)));
-                IFormattableTextComponent keyConflict = TextComponentUtils.func_240648_a_(message.copyRaw(), message.getStyle().setColor(Color.func_240743_a_(16755200)));
+                IFormattableTextComponent modConflict = TextComponentUtils.func_240648_a_(message.copyRaw(), message.getStyle().setColor(Color.fromInt(16755200)));
+                IFormattableTextComponent keyConflict = TextComponentUtils.func_240648_a_(message.copyRaw(), message.getStyle().setColor(Color.fromInt(16755200)));
 
                 this.btnChangeKeyBinding.setMessage(keyCodeModifierConflict ? modConflict : keyConflict);
             }
 
             this.btnChangeKeyBinding.render(stack, mouseX, mouseY, p_render_9_);
             if (mouseY >= y && mouseY <= y + p_render_5_) {
-                mc.fontRenderer.drawString(stack, I18n.format(keybinding.getKeyCategory()), mouseX + 10, mouseY, 0xFFFFFF);
+                GuiUtils.drawHoveringText(stack, Collections.singletonList(new TranslationTextComponent(keybinding.getKeyCategory())), mouseX, mouseY, mc.currentScreen.width, mc.currentScreen.height, 0, mc.fontRenderer);
+//                mc.fontRenderer.drawString(stack, I18n.format(keybinding.getKeyCategory()), mouseX + 10, mouseY, 0xFFFFFF);
             }
         }
 

+ 1 - 1
src/main/resources/META-INF/mods.toml

@@ -8,7 +8,7 @@ license="MIT"
 modId="controlling" #mandatory
 version="${file.jarVersion}" #mandatory
 displayName="Controlling" #mandatory
-updateJSONURL="https://updates.blamejared.com/get?n=controlling&gv=1.16.4"
+updateJSONURL="https://updates.blamejared.com/get?n=controlling&gv=1.16.5"
 description='''
 Adds the ability to search for keybinds using their name in the KeyBinding menu, this allows players to easily find a key binding in the menu.
 '''