Skip to content

Commit e9083cc

Browse files
Update to 1.19.4
1 parent fd9dfde commit e9083cc

File tree

5 files changed

+28
-24
lines changed

5 files changed

+28
-24
lines changed

build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ plugins {
44
id 'net.minecraftforge.gradle' version '5.1.+'
55
}
66

7-
version = '2.4.3'
7+
version = '2.4.4'
88
group = 'wafflestomper'
9-
archivesBaseName = '1.19.3-Ghostwriter'
9+
archivesBaseName = '1.19.4-Ghostwriter'
1010

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

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

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

134134
// Real mod deobf dependency examples - these get remapped to your current mappings
135135
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency

src/main/java/wafflestomper/ghostwriter/gui/screen/GhostwriterEditBookScreen.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,23 @@ private int getCurrPageLineCount() {
106106

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

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

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

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

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

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

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

294294
this.pages.remove(pageNum);
295295
// Add a blank page if the book is empty
296-
if (this.pages.size() == 0) this.pages.add("");
296+
if (this.pages.isEmpty()) this.pages.add("");
297297
this.bookChanged(true);
298298
}
299299

src/main/java/wafflestomper/ghostwriter/gui/screen/GhostwriterFileBrowserScreen.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void init() {
148148
this.filenameField.setValue(defaultFilename);
149149

150150
// Focus on the filename field and highlight the filename (without the extension)
151-
this.filenameField.setFocus(true);
151+
this.filenameField.setFocused(true);
152152
this.filenameField.highlightFilename();
153153

154154
// Prevent re-initializing element on resize
@@ -243,7 +243,7 @@ public void navigateUp() {
243243

244244
private boolean isFilenameValid() {
245245
String fn = this.filenameField.getValue();
246-
return !fn.equals("");
246+
return !fn.isEmpty();
247247
}
248248

249249

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
modLoader="javafml"
33

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

77
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
88
license="GNU GPL v3"
@@ -27,12 +27,12 @@ issueTrackerURL="https://github.com/waffle-stomper/Ghostwriter/issues"
2727
[[dependencies.ghostwriter]]
2828
modId="forge"
2929
mandatory=true
30-
versionRange="[44,)"
30+
versionRange="[45,)"
3131
ordering="NONE"
3232
side="CLIENT"
3333
[[dependencies.ghostwriter]]
3434
modId="minecraft"
3535
mandatory=true
36-
versionRange="[1.19.3,1.20)"
36+
versionRange="[1.19.4,1.20)"
3737
ordering="NONE"
3838
side="CLIENT"

update.json

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"homepage": "https://github.com/waffle-stomper/Ghostwriter/releases",
33
"promos":{
4+
"1.19.4-recommended": "2.4.4",
45
"1.19.3-recommended": "2.4.3",
56
"1.19.2-recommended": "2.4.0",
67
"1.19.1-recommended": "2.3.9",
@@ -23,6 +24,9 @@
2324
"1.11-recommended": "1.8.7",
2425
"1.10-recommended": "1.8.5"
2526
},
27+
"1.19.4": {
28+
"2.4.4": "Update to 1.19.4"
29+
},
2630
"1.19.3": {
2731
"2.4.3": "Fix bug where formatting characters replace selected text. Thanks to ZeliotL for the bug report",
2832
"2.4.1": "Update to 1.19.3"

0 commit comments

Comments
 (0)