Skip to content

Commit

Permalink
Update to 1.20.2, lectern support is still disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
waffle-stomper committed Mar 27, 2024
1 parent 21b5a71 commit d9ca6c8
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 66 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand Down
9 changes: 8 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,18 @@ 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
*/
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();
Expand All @@ -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
* <p>
* 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) {
Expand Down
82 changes: 58 additions & 24 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -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,)"
13 changes: 7 additions & 6 deletions src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -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
}
}
4 changes: 4 additions & 0 deletions update.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
},
Expand Down

0 comments on commit d9ca6c8

Please sign in to comment.