Skip to content

Commit 5b88f08

Browse files
Update to 1.16.5, fix lectern screen crash, add license
1 parent 25c1fb3 commit 5b88f08

10 files changed

+710
-29
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# local nonsense
2-
Run Server.*
2+
*.log
33
*.ods
44
*.xcf
55
Issues
@@ -36,6 +36,5 @@ run
3636
forge*changelog.txt
3737
changelog.txt
3838
CREDITS.txt
39-
LICENSE.txt
4039
README.txt
4140

LICENSE.txt

+674
Large diffs are not rendered by default.

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ apply plugin: 'net.minecraftforge.gradle'
1313
apply plugin: 'eclipse'
1414
apply plugin: 'maven-publish'
1515

16-
version = '2.2.5'
16+
version = '2.2.6'
1717
group = 'wafflestomper' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
18-
archivesBaseName = '1.16.1-Ghostwriter'
18+
archivesBaseName = '1.16.5-Ghostwriter'
1919

2020
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
2121

@@ -26,7 +26,7 @@ minecraft {
2626
// stable_# Stables are built at the discretion of the MCP team.
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: 'snapshot', version: '20200820-1.16.1'
29+
mappings channel: 'snapshot', version: '20201028-1.16.3'
3030
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
3131

3232
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -90,7 +90,7 @@ dependencies {
9090
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
9191
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
9292
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
93-
minecraft 'net.minecraftforge:forge:1.16.1-32.0.108'
93+
minecraft 'net.minecraftforge:forge:1.16.5-36.0.42'
9494

9595
// You may put jars on which you depend on in ./libs or you may define them like so..
9696
// compile "some.group:artifact:version:classifier"

src/main/java/wafflestomper/ghostwriter/BookUtilities.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public static Pages splitIntoPages(String inStr, int maxLinesPerPage) {
107107
List<String> lines = new ArrayList<>();
108108
List<ITextComponent> stylizedLines = new ArrayList<>();
109109
MutableInt pageStartPos = new MutableInt(0);
110-
CharacterManager charactermanager = Minecraft.getInstance().fontRenderer.func_238420_b_();
110+
CharacterManager charactermanager = Minecraft.getInstance().fontRenderer.getCharacterManager();
111111
charactermanager.func_238353_a_(inStr, SharedConstants.BOOK_TEXT_WIDTH, Style.EMPTY, true,
112112
(style, start, end) -> {
113113
lineStartIndices.add(start - pageStartPos.getValue());
@@ -159,8 +159,7 @@ public static Pages splitIntoPages(String strIn, int maxLinesPerPage, String pag
159159
*/
160160
public static String deJSONify(String jsonIn) {
161161
try {
162-
// func_240643_a_() is fromJson()
163-
ITextComponent i = ITextComponent.Serializer.func_240643_a_(jsonIn);
162+
ITextComponent i = ITextComponent.Serializer.getComponentFromJson(jsonIn);
164163
if (i != null) {
165164
return (i.getString());
166165
}

src/main/java/wafflestomper/ghostwriter/Ghostwriter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private void setup(final FMLClientSetupEvent event) {
5151
@SubscribeEvent
5252
public void tick(TickEvent event) {
5353
if (MC.currentScreen == null) return;
54-
if (!lecternArmed || MC.currentScreen.getClass().equals(LecternScreen.class)) return;
54+
if (!lecternArmed || !MC.currentScreen.getClass().equals(LecternScreen.class)) return;
5555

5656
lecternArmed = false;
5757
LOG.debug("Lectern screen detected!");

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partia
122122
String textTitle = this.bookTitle;
123123
textTitle += (this.updateCount / 6 % 2 == 0 ? TextFormatting.BLACK : TextFormatting.GRAY) + "_";
124124
int bookLeftSide = (this.width - 192) / 2;
125-
int titleWidth = this.getTextWidth(textTitle);
125+
int titleWidth = this.font.getStringWidth(textTitle);
126126
int titleMinX = bookLeftSide + 36 + (114 - titleWidth) / 2;
127127
int titleMaxX = titleMinX + titleWidth;
128128
// color for the fill() method is MSB->LSB: alpha, r, g, b, (each 8 bits)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partia
224224
int allowedSize = DISPLAY_PATH_WIDTH - this.font.getStringWidth("...");
225225
String reversed = new StringBuilder(displayPath).reverse().toString();
226226
// func_238361_b_() is trimStringToWidth()
227-
reversed = this.font.func_238420_b_().func_238361_b_(reversed, allowedSize, Style.EMPTY);
227+
reversed = this.font.getCharacterManager().func_238361_b_(reversed, allowedSize, Style.EMPTY);
228228
displayPath = "..." + new StringBuilder(reversed).reverse().toString();
229229
}
230-
this.drawCenteredString(matrixStack, this.font, displayPath, this.width / 2, 20, 0xDDDDDD);
230+
drawCenteredString(matrixStack, this.font, displayPath, this.width / 2, 20, 0xDDDDDD);
231231

232232
this.filenameField.render(matrixStack, mouseX, mouseY, partialTicks);
233233

src/main/java/wafflestomper/ghostwriter/SelectableFilenameField.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ public class SelectableFilenameField extends TextFieldWidget {
1515

1616
public SelectableFilenameField(FontRenderer fontRenderer, int x, int y, int width, int height, ITextComponent text) {
1717
super(fontRenderer, x, y, width, height, text);
18-
this.CHARACTER_MANAGER = fontRenderer.func_238420_b_();
18+
this.CHARACTER_MANAGER = fontRenderer.getCharacterManager();
19+
}
20+
21+
22+
/**
23+
* 1.16.5 patch because Widget.getHeight() was removed
24+
*/
25+
public int getHeight(){
26+
return this.height;
1927
}
2028

2129

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

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,38 @@
1-
# This is an example mods.toml file. It contains the data relating to the loading mods.
2-
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
3-
# The overall format is standard TOML format, v0.5.0.
4-
# Note that there are a couple of TOML lists in this file.
5-
# Find more information on toml format here: https://github.com/toml-lang/toml
6-
71
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
8-
modLoader="javafml" #mandatory
2+
modLoader="javafml"
93

104
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
11-
loaderVersion="[28,)"
5+
loaderVersion="[36,)" # 36 = 1.16.5
6+
7+
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
8+
license="GNU GPL v3"
129

1310
# A URL to refer people to when problems occur with this mod
14-
issueTrackerURL="http://my.issue.tracker/" #optional
11+
issueTrackerURL="https://github.com/waffle-stomper/Ghostwriter/issues"
1512

1613
# A list of mods - how many allowed here is determined by the individual mod loader
17-
[[mods]] #mandatory
18-
modId="ghostwriter" #mandatory
14+
[[mods]]
15+
modId="ghostwriter"
1916
version="${file.jarVersion}"
2017
displayName="Ghostwriter"
2118
updateJSONURL="https://raw.githubusercontent.com/waffle-stomper/Ghostwriter/master/update.json"
2219
displayURL="https://github.com/waffle-stomper/Ghostwriter"
2320
logoFile="icon.png"
24-
credits="maester_flaminius, SortByNode, and all of the other wonderful people I've met through Minecraft"
25-
authors="waffle_stomper and maester_flaminius" #optional
21+
credits="maester_flaminius, SortByNode, Lodish, and all of the other wonderful people I've met through Minecraft"
22+
authors="waffle_stomper and maester_flaminius"
2623
description='''
2724
Utility for dealing with books (backup, restore, copy, paste, etc.).
2825
'''
2926

3027
[[dependencies.ghostwriter]]
3128
modId="forge"
3229
mandatory=true
33-
versionRange="[32.0.108,)"
30+
versionRange="[36,)" # 36 = 1.16.5
3431
ordering="NONE"
3532
side="CLIENT"
3633
[[dependencies.ghostwriter]]
3734
modId="minecraft"
3835
mandatory=true
39-
versionRange="[1.16.1]"
36+
versionRange="[1.16.5,1.17]"
4037
ordering="NONE"
4138
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.16.5-recommended": "2.2.6",
45
"1.16.1-recommended": "2.2.5",
56
"1.15.2-recommended": "2.0.6",
67
"1.15.1-recommended": "2.0.5",
@@ -12,6 +13,9 @@
1213
"1.11-recommended": "1.8.7",
1314
"1.10-recommended": "1.8.5"
1415
},
16+
"1.16.5": {
17+
"2.2.6": "Beta 1.16.5 release"
18+
},
1519
"1.16.1":{
1620
"2.2.5": "Fix index out of range error when removing book pages\nEsc in signed preview now returns to edit screen\nMore internal changes to improve maintainability",
1721
"2.2.4": "Add optional protection to filename extension in file browser\nRemove 16 character title limit when loading bookworm books\nRefactor constants\nRemove some single use functions\nPressing escape in file browser now reverts back to the book, rather than exiting completely\nMassive internal code shuffle to make the project easier to maintain",

0 commit comments

Comments
 (0)