Skip to content

Commit

Permalink
Update to 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
waffle-stomper committed Sep 8, 2023
1 parent fd9dfde commit e9083cc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
}

version = '2.4.3'
version = '2.4.4'
group = 'wafflestomper'
archivesBaseName = '1.19.3-Ghostwriter'
archivesBaseName = '1.19.4-Ghostwriter'

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
Expand All @@ -22,11 +22,11 @@ minecraft {
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
// Additional setup is needed to use their mappings: https://parchmentmc.org/docs/getting-started
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.19.3'
mappings channel: 'official', version: '1.19.4'

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

Expand Down Expand Up @@ -129,7 +129,7 @@ dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.19.3-44.0.1'
minecraft 'net.minecraftforge:forge:1.19.4-45.1.0'

// Real mod deobf dependency examples - these get remapped to your current mappings
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,23 @@ private int getCurrPageLineCount() {

/**
* Visual patches:
* - Warn when the title is over the vanilla 15 character limit
* - Warn when the title is over the vanilla 15-character limit
* - Warn when the page is over the vanilla 14 line limit
* - Warn when the page is over the multiplayer 256 character limit
* - Warn when the page is over the multiplayer 256-character limit
* - Add a high contrast background behind extended length titles
*/
@Override // From BookEditScreen
@ParametersAreNonnullByDefault
public void render(PoseStack PoseStack, int mouseX, int mouseY, float partialTicks) {
super.render(PoseStack, mouseX, mouseY, partialTicks);
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTicks) {
super.render(poseStack, mouseX, mouseY, partialTicks);

// Render long title and warning (if necessary)
if (this.isSigning && this.title.length() > 15) {
// Show the title length
String textLen = "Title length: " + this.title.length();
// params are PoseStack, x, y, color
// this was drawString() in the old money
this.font.draw(PoseStack, textLen, 169, 20, 0xFF3333);
this.font.draw(poseStack, textLen, 169, 20, 0xFF3333);

// Add extra background width amd re-render the title because the new background covers up the vanilla title
String textTitle = this.title;
Expand All @@ -132,15 +132,15 @@ public void render(PoseStack PoseStack, int mouseX, int mouseY, float partialTic
int titleMinX = bookLeftSide + 36 + (114 - titleWidth) / 2;
int titleMaxX = titleMinX + titleWidth;
// color for the fill() method is MSB->LSB: alpha, r, g, b, (each 8 bits)
GuiComponent.fill(PoseStack, titleMinX - 5, 48, titleMaxX + 5, 60, 0xFFFFF9EC);
this.font.draw(PoseStack, textTitle, (float) (titleMinX), 50.0F, 0);
GuiComponent.fill(poseStack, titleMinX - 5, 48, titleMaxX + 5, 60, 0xFFFFF9EC);
this.font.draw(poseStack, textTitle, (float) (titleMinX), 50.0F, 0);

// Show the long title warning
String s = "Warning: the vanilla client restricts titles to 15 characters. " +
"Set longer titles at your own risk";
Component lengthWarning = Component.translatable(s);
// params are text, x, y, width, color
this.font.drawWordWrap(lengthWarning, 153, 116, 114, 0xFF3333);
this.font.drawWordWrap(poseStack, lengthWarning, 153, 116, 114, 0xFF3333);
}

// Add warnings about character and line limits
Expand All @@ -153,9 +153,9 @@ public void render(PoseStack PoseStack, int mouseX, int mouseY, float partialTic
warning = "Over " + SharedConstants.BOOK_MAX_LINES + " line limit!";
}

if (warning.length() > 0) {
this.font.draw(PoseStack, "Warning:", 5, 176, 0xFF3333);
this.font.draw(PoseStack, warning, 5, 185, 0xFF3333);
if (!warning.isEmpty()) {
this.font.draw(poseStack, "Warning:", 5, 176, 0xFF3333);
this.font.draw(poseStack, warning, 5, 185, 0xFF3333);
}
}
}
Expand All @@ -179,7 +179,7 @@ public boolean titleKeyPressed(int keyCode, int scanCode, int modifiers) {
*/
@Override // From IGhostBook
public List<String> pagesAsList() {
// As of 1.16.1, unsigned books just use plain strings for book pages so we don't need to remove
// As of 1.16.1, unsigned books just use plain strings for book pages, so we don't need to remove
// any JSON weirdness
return new ArrayList<>(this.pages);
}
Expand Down Expand Up @@ -224,7 +224,7 @@ public void addFormattingCode(String formattingCode) {
extraCharCount = 4;
}

// Re-select the text (note that it's two characters longer and we have to deal with the case where
// Re-select the text (note that it's two characters longer, and we have to deal with the case where
// the text was selected right-to-left
if (cursorPos < selectionPos){
editor.setSelectionRange(cursorPos, selectionPos + extraCharCount);
Expand Down Expand Up @@ -293,7 +293,7 @@ public void removePage(int pageNum) {

this.pages.remove(pageNum);
// Add a blank page if the book is empty
if (this.pages.size() == 0) this.pages.add("");
if (this.pages.isEmpty()) this.pages.add("");
this.bookChanged(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void init() {
this.filenameField.setValue(defaultFilename);

// Focus on the filename field and highlight the filename (without the extension)
this.filenameField.setFocus(true);
this.filenameField.setFocused(true);
this.filenameField.highlightFilename();

// Prevent re-initializing element on resize
Expand Down Expand Up @@ -243,7 +243,7 @@ public void navigateUp() {

private boolean isFilenameValid() {
String fn = this.filenameField.getValue();
return !fn.equals("");
return !fn.isEmpty();
}


Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
modLoader="javafml"

# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[44,)" # 44 = 1.19.3
loaderVersion="[45,)" # 45 = 1.19.4

# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
license="GNU GPL v3"
Expand All @@ -27,12 +27,12 @@ issueTrackerURL="https://github.com/waffle-stomper/Ghostwriter/issues"
[[dependencies.ghostwriter]]
modId="forge"
mandatory=true
versionRange="[44,)"
versionRange="[45,)"
ordering="NONE"
side="CLIENT"
[[dependencies.ghostwriter]]
modId="minecraft"
mandatory=true
versionRange="[1.19.3,1.20)"
versionRange="[1.19.4,1.20)"
ordering="NONE"
side="CLIENT"
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.19.4-recommended": "2.4.4",
"1.19.3-recommended": "2.4.3",
"1.19.2-recommended": "2.4.0",
"1.19.1-recommended": "2.3.9",
Expand All @@ -23,6 +24,9 @@
"1.11-recommended": "1.8.7",
"1.10-recommended": "1.8.5"
},
"1.19.4": {
"2.4.4": "Update to 1.19.4"
},
"1.19.3": {
"2.4.3": "Fix bug where formatting characters replace selected text. Thanks to ZeliotL for the bug report",
"2.4.1": "Update to 1.19.3"
Expand Down

0 comments on commit e9083cc

Please sign in to comment.