From d9ca6c8cf22409f7036b9e0df1b522d01f8eb02b Mon Sep 17 00:00:00 2001 From: waffle-stomper <5958168+waffle-stomper@users.noreply.github.com> Date: Wed, 27 Mar 2024 12:53:30 +1000 Subject: [PATCH] Update to 1.20.2, lectern support is still disabled --- build.gradle | 2 +- gradle.properties | 14 ++-- settings.gradle | 9 +- .../screen/GhostwriterFileBrowserScreen.java | 1 - .../gui/widget/SelectableFilenameField.java | 30 +------ src/main/resources/META-INF/mods.toml | 82 +++++++++++++------ src/main/resources/pack.mcmeta | 13 +-- update.json | 4 + 8 files changed, 89 insertions(+), 66 deletions(-) diff --git a/build.gradle b/build.gradle index 3f7c72f..12f1b88 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'eclipse' id 'idea' id 'maven-publish' - id 'net.minecraftforge.gradle' version '[6.0,6.2)' + id 'net.minecraftforge.gradle' version '[6.0.16,6.2)' } version = mod_version diff --git a/gradle.properties b/gradle.properties index 3bcbd25..99dc7a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,17 +7,17 @@ org.gradle.daemon=false ## Environment Properties # The Minecraft version must agree with the Forge version to get a valid artifact -minecraft_version=1.20.1 +minecraft_version=1.20.2 # The Minecraft version range can use any release version of Minecraft as bounds. # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # as they do not follow standard versioning conventions. -minecraft_version_range=[1.20.1,1.21) +minecraft_version_range=[1.20.2,1.21) # The Forge version must agree with the Minecraft version to get a valid artifact -forge_version=47.1.0 +forge_version=48.1.0 # The Forge version range can use any version of Forge as bounds or match the loader version range -forge_version_range=[47,) +forge_version_range=[48,) # The loader version range can only use the major version of Forge/FML as bounds -loader_version_range=[47,) +loader_version_range=[48,) # The mapping channel to use for mappings. # The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"]. # Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin. @@ -35,7 +35,7 @@ loader_version_range=[47,) mapping_channel=official # The mapping version to query from the mapping channel. # This must match the format required by the mapping channel. -mapping_version=1.20.1 +mapping_version=1.20.2 ## Mod Properties @@ -48,7 +48,7 @@ mod_name=Ghostwriter # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GNU GPL v3.0 # The mod version. See https://semver.org/ -mod_version=2.4.6 +mod_version=2.4.7 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/settings.gradle b/settings.gradle index 3703f36..93f1b80 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,13 @@ pluginManagement { repositories { gradlePluginPortal() - maven { url = 'https://maven.minecraftforge.net/' } + maven { + name = 'MinecraftForge' + url = 'https://maven.minecraftforge.net/' + } } +} + +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' } \ No newline at end of file diff --git a/src/main/java/wafflestomper/ghostwriter/gui/screen/GhostwriterFileBrowserScreen.java b/src/main/java/wafflestomper/ghostwriter/gui/screen/GhostwriterFileBrowserScreen.java index be41eb9..aa50ab6 100644 --- a/src/main/java/wafflestomper/ghostwriter/gui/screen/GhostwriterFileBrowserScreen.java +++ b/src/main/java/wafflestomper/ghostwriter/gui/screen/GhostwriterFileBrowserScreen.java @@ -300,7 +300,6 @@ public void setSelectedSlot(FileSelectionList.Entry entry) { @Override public void tick() { - this.filenameField.tick(); this.btnSave.active = this.isFilenameValid(); if (this.FILE_HANDLER.currentPath != this.cachedPath) { this.directoryDirty = true; // This probably isn't necessary - it forces a refresh diff --git a/src/main/java/wafflestomper/ghostwriter/gui/widget/SelectableFilenameField.java b/src/main/java/wafflestomper/ghostwriter/gui/widget/SelectableFilenameField.java index 0c86fe7..23d64e0 100644 --- a/src/main/java/wafflestomper/ghostwriter/gui/widget/SelectableFilenameField.java +++ b/src/main/java/wafflestomper/ghostwriter/gui/widget/SelectableFilenameField.java @@ -53,20 +53,11 @@ public int getEditableLength() { * Selects the filename */ public void highlightFilename() { - this.moveCursorToStart(); + this.moveCursorToStart(false); this.setHighlightPos(this.getEditableLength()); } - /** - * This field in EditBox was causing the bug where single clicking after using the shift key - * to type upper case text would erroneously select text - */ - public void updateShiftKeyStatus() { - this.shiftPressed = Screen.hasShiftDown(); - } - - /** * Prevents deleting from or moving into the 'uneditable' region * and adds Up and Down keys as Home and End aliases @@ -74,8 +65,6 @@ public void updateShiftKeyStatus() { public boolean keyPressed(int keyCode, int scanCode, int modifiers) { if (!this.canConsumeInput()) return false; - this.updateShiftKeyStatus(); - // Handle select all if (Screen.isSelectAll(keyCode)) { this.highlightFilename(); @@ -91,32 +80,21 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { case SharedConstants.KEY_DOWN: case SharedConstants.KEY_END: - this.setCursorPosition(this.getEditableLength()); + this.moveCursorTo(this.getEditableLength(), Screen.hasShiftDown()); return true; case SharedConstants.KEY_UP: - this.moveCursorToStart(); + this.moveCursorToStart(Screen.hasShiftDown()); return true; } return super.keyPressed(keyCode, scanCode, modifiers); } - - + /** * Selects the editable part of the filename on double-click and cancels text selection on single click - *
- * This also fixes a bug where single clicking will cause text to be selected - * Steps to reproduce (with this method disabled): - * 1) Hold shift and type S, then release shift - * 2) Click somewhere in the text field. - * 3) Note that text is erroneously selected - * Moving the cursor with the arrow keys seems to fix it */ public boolean mouseClicked(double mouseX, double mouseY, int button) { - // This should fix the bug described above - this.updateShiftKeyStatus(); - if (super.mouseClicked(mouseX, mouseY, button)) { // Mouse was clicked within this component if (Util.getMillis() - this.lastClickTime < 250L) { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 1083c8c..95e8668 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,36 +1,70 @@ +# This is an example mods.toml file. It contains the data relating to the loading mods. +# There are several mandatory fields (#mandatory), and many more that are optional (#optional). +# The overall format is standard TOML format, v0.5.0. +# Note that there are a couple of TOML lists in this file. +# Find more information on toml format here: https://github.com/toml-lang/toml # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml -modLoader="javafml" - +modLoader="javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion="${loader_version_range}" - +loaderVersion="${loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. +# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. license="${mod_license}" - # A URL to refer people to when problems occur with this mod -issueTrackerURL="https://github.com/waffle-stomper/Ghostwriter/issues" - +#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional # A list of mods - how many allowed here is determined by the individual mod loader -[[mods]] - modId="${mod_id}" - version="${mod_version}" - displayName="${mod_name}" - updateJSONURL="https://raw.githubusercontent.com/waffle-stomper/Ghostwriter/master/update.json" - displayURL="https://github.com/waffle-stomper/Ghostwriter" - logoFile="icon.png" - credits="maester_flaminius, SortByNode, Lodish, and all of the other wonderful people I've met through Minecraft" - authors="${mod_authors}" - description='''${mod_description}''' +[[mods]] #mandatory +# The modid of the mod +modId="${mod_id}" #mandatory +# The version number of the mod +version="${mod_version}" #mandatory +# A display name for the mod +displayName="${mod_name}" #mandatory +# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/ +#updateJSONURL="https://change.me.example.invalid/updates.json" #optional +# A URL for the "homepage" for this mod, displayed in the mod UI +#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional +# A file name (in the root of the mod JAR) containing a logo for display +#logoFile="examplemod.png" #optional +# A text field displayed in the mod UI +#credits="" #optional +# A text field displayed in the mod UI +authors="${mod_authors}" #optional +# Display Test controls the display for your mod in the server connection screen +# MATCH_VERSION means that your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod. +# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod. +# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component. +# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value. +# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself. +#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional) -[[dependencies.ghostwriter]] - modId="forge" - mandatory=true - versionRange="${forge_version_range}" +# The description text for the mod (multi line!) (#mandatory) +description='''${mod_description}''' +# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. +[[dependencies.${mod_id}]] #optional + # the modid of the dependency + modId="forge" #mandatory + # Does this dependency have to exist - if not, ordering below must be specified + mandatory=true #mandatory + # The version range of the dependency + versionRange="${forge_version_range}" #mandatory + # An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory + # BEFORE - This mod is loaded BEFORE the dependency + # AFTER - This mod is loaded AFTER the dependency ordering="NONE" - side="CLIENT" -[[dependencies.ghostwriter]] + # Side this dependency is applied on - BOTH, CLIENT, or SERVER + side="BOTH" +# Here's another dependency +[[dependencies.${mod_id}]] modId="minecraft" mandatory=true + # This version range declares a minimum of the current minecraft version up to but not including the next major version versionRange="${minecraft_version_range}" ordering="NONE" - side="CLIENT" + side="BOTH" + +# Features are specific properties of the game environment, that you may want to declare you require. This example declares +# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't +# stop your mod loading on the server for example. +#[features.${mod_id}] +#openGLVersion="[3.2,)" \ No newline at end of file diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index abbce99..2a62706 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,8 @@ { - "pack": { - "description": "ghostwriter resources", - "pack_format": 4, - "_comment": "I don't really understand why this is necessary, but OK I guess" - } -} + "pack": { + "description": { + "text": "${mod_id} resources" + }, + "pack_format": 18 + } +} \ No newline at end of file diff --git a/update.json b/update.json index 69887d2..5c1bb4d 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,7 @@ { "homepage": "https://github.com/waffle-stomper/Ghostwriter/releases", "promos":{ + "1.20.2-recommended": "2.4.7", "1.20.1-recommended": "2.4.6", "1.20-recommended": "2.4.5", "1.19.4-recommended": "2.4.4", @@ -26,6 +27,9 @@ "1.11-recommended": "1.8.7", "1.10-recommended": "1.8.5" }, + "1.20.2": { + "2.4.7": "Update to 1.20.1. Lectern support temporarily disabled" + }, "1.20.1": { "2.4.6": "Update to 1.20.1. Lectern support temporarily disabled" },