@@ -106,23 +106,23 @@ private int getCurrPageLineCount() {
106
106
107
107
/**
108
108
* 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
110
110
* - 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
112
112
* - Add a high contrast background behind extended length titles
113
113
*/
114
114
@ Override // From BookEditScreen
115
115
@ 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 );
118
118
119
119
// Render long title and warning (if necessary)
120
120
if (this .isSigning && this .title .length () > 15 ) {
121
121
// Show the title length
122
122
String textLen = "Title length: " + this .title .length ();
123
123
// params are PoseStack, x, y, color
124
124
// 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 );
126
126
127
127
// Add extra background width amd re-render the title because the new background covers up the vanilla title
128
128
String textTitle = this .title ;
@@ -132,15 +132,15 @@ public void render(PoseStack PoseStack, int mouseX, int mouseY, float partialTic
132
132
int titleMinX = bookLeftSide + 36 + (114 - titleWidth ) / 2 ;
133
133
int titleMaxX = titleMinX + titleWidth ;
134
134
// 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 );
137
137
138
138
// Show the long title warning
139
139
String s = "Warning: the vanilla client restricts titles to 15 characters. " +
140
140
"Set longer titles at your own risk" ;
141
141
Component lengthWarning = Component .translatable (s );
142
142
// 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 );
144
144
}
145
145
146
146
// Add warnings about character and line limits
@@ -153,9 +153,9 @@ public void render(PoseStack PoseStack, int mouseX, int mouseY, float partialTic
153
153
warning = "Over " + SharedConstants .BOOK_MAX_LINES + " line limit!" ;
154
154
}
155
155
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 );
159
159
}
160
160
}
161
161
}
@@ -179,7 +179,7 @@ public boolean titleKeyPressed(int keyCode, int scanCode, int modifiers) {
179
179
*/
180
180
@ Override // From IGhostBook
181
181
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
183
183
// any JSON weirdness
184
184
return new ArrayList <>(this .pages );
185
185
}
@@ -224,7 +224,7 @@ public void addFormattingCode(String formattingCode) {
224
224
extraCharCount = 4 ;
225
225
}
226
226
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
228
228
// the text was selected right-to-left
229
229
if (cursorPos < selectionPos ){
230
230
editor .setSelectionRange (cursorPos , selectionPos + extraCharCount );
@@ -293,7 +293,7 @@ public void removePage(int pageNum) {
293
293
294
294
this .pages .remove (pageNum );
295
295
// 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 ("" );
297
297
this .bookChanged (true );
298
298
}
299
299
0 commit comments