Skip to content

Commit

Permalink
port to 1.16.5 and close #75
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlll08 committed Jan 15, 2021
1 parent cc83b06 commit b077f25
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ usernamecache.json
secrets.json
changelog.md
*.launch

logs/
58 changes: 28 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')))
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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')}"
Expand All @@ -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!")
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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.*;
Expand Down Expand Up @@ -173,15 +174,16 @@ public void render(MatrixStack stack, int slotIndex, int y, int x, int p_render_
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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
'''

0 comments on commit b077f25

Please sign in to comment.