Skip to content

Commit

Permalink
Update to 1.16.4
Browse files Browse the repository at this point in the history
  • Loading branch information
waffle-stomper committed Mar 21, 2021
1 parent 2b987c8 commit 11d4cfc
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 19 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '2.2.8'
version = '2.2.9'
group = 'wafflestomper' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = '1.16.1-Ghostwriter'
archivesBaseName = '1.16.4-Ghostwriter'

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

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

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
Expand Down Expand Up @@ -90,7 +90,7 @@ dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's 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.16.1-32.0.108'
minecraft 'net.minecraftforge:forge:1.16.4-35.1.4'

// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partia
String textTitle = this.bookTitle;
textTitle += (this.updateCount / 6 % 2 == 0 ? TextFormatting.BLACK : TextFormatting.GRAY) + "_";
int bookLeftSide = (this.width - 192) / 2;
int titleWidth = this.getTextWidth(textTitle);
int titleWidth = this.font.getStringWidth(textTitle);
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.Style;
import wafflestomper.ghostwriter.*;
import wafflestomper.ghostwriter.gui.widget.FileSelectionList;
import wafflestomper.ghostwriter.Ghostwriter;
import wafflestomper.ghostwriter.gui.GhostLayer;
import wafflestomper.ghostwriter.gui.widget.FileSelectionList;
import wafflestomper.ghostwriter.gui.widget.SelectableFilenameField;
import wafflestomper.ghostwriter.utilities.Clipboard;
import wafflestomper.ghostwriter.utilities.FileHandler;
Expand Down Expand Up @@ -232,10 +232,10 @@ public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partia
int allowedSize = DISPLAY_PATH_WIDTH - this.font.getStringWidth("...");
String reversed = new StringBuilder(displayPath).reverse().toString();
// func_238361_b_() is trimStringToWidth()
reversed = this.font.func_238420_b_().func_238361_b_(reversed, allowedSize, Style.EMPTY);
reversed = this.font.getCharacterManager().func_238361_b_(reversed, allowedSize, Style.EMPTY);
displayPath = "..." + new StringBuilder(reversed).reverse().toString();
}
this.drawCenteredString(matrixStack, this.font, displayPath, this.width / 2, 20, 0xDDDDDD);
drawCenteredString(matrixStack, this.font, displayPath, this.width / 2, 20, 0xDDDDDD);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ public void render(MatrixStack matrixStack, int p_render_1_, int p_render_2_, in
}

// Draw the trimmed filename in the slot
// I think func_238412_a_ is the new trimStringToWidth but I'm not sure
String s = this.mc.fontRenderer.func_238412_a_(this.path.getName(), slotWidth);
String s = this.mc.fontRenderer.trimStringToWidth(this.path.getName(), slotWidth);
this.mc.fontRenderer.drawString(matrixStack, s, (float) (slotX), (float) (p_render_2_ + 1), color);

// Set up the hover text if the mouse is hovering over this slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SelectableFilenameField extends TextFieldWidget {

public SelectableFilenameField(FontRenderer fontRenderer, int x, int y, int width, int height, ITextComponent text) {
super(fontRenderer, x, y, width, height, text);
this.CHARACTER_MANAGER = fontRenderer.func_238420_b_();
this.CHARACTER_MANAGER = fontRenderer.getCharacterManager();
}


Expand Down Expand Up @@ -63,7 +63,7 @@ public void highlightFilename() {
* to type upper case text would erroneously select text
*/
public void updateShiftKeyStatus() {
this.field_212956_h = Screen.hasShiftDown();
this.isShiftDown = Screen.hasShiftDown();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static Pages splitIntoPages(String inStr, int maxLinesPerPage) {
List<String> lines = new ArrayList<>();
List<ITextComponent> stylizedLines = new ArrayList<>();
MutableInt pageStartPos = new MutableInt(0);
CharacterManager charactermanager = Minecraft.getInstance().fontRenderer.func_238420_b_();
CharacterManager charactermanager = Minecraft.getInstance().fontRenderer.getCharacterManager();
charactermanager.func_238353_a_(inStr, SharedConstants.BOOK_TEXT_WIDTH, Style.EMPTY, true,
(style, start, end) -> {
lineStartIndices.add(start - pageStartPos.getValue());
Expand Down Expand Up @@ -161,8 +161,7 @@ public static Pages splitIntoPages(String strIn, int maxLinesPerPage, String pag
*/
public static String deJSONify(String jsonIn) {
try {
// func_240643_a_() is fromJson()
ITextComponent i = ITextComponent.Serializer.func_240643_a_(jsonIn);
ITextComponent i = ITextComponent.Serializer.getComponentFromJson(jsonIn);
if (i != null) {
return (i.getString());
}
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="[32,)" # 32 = 1.16.1
loaderVersion="[35,)" # 35 = 1.16.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="[32,)"
versionRange="[35,)"
ordering="NONE"
side="CLIENT"
[[dependencies.ghostwriter]]
modId="minecraft"
mandatory=true
versionRange="[1.16.1,1.17]"
versionRange="[1.16.4,1.17]"
ordering="NONE"
side="CLIENT"

0 comments on commit 11d4cfc

Please sign in to comment.