Skip to content

Commit

Permalink
chore: bump arch & neoforge dep versions
Browse files Browse the repository at this point in the history
Fixes null empty fluid stacks and newest arch loom allows building
with up-to-date NeoForge
  • Loading branch information
desht committed May 8, 2024
1 parent 6f433a2 commit c7c939b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
55 changes: 30 additions & 25 deletions common/src/main/java/dev/ftb/mods/ftblibrary/ui/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,31 +189,36 @@ public final int drawString(GuiGraphics graphics, @Nullable Object text, int x,
return x;
}

if (text instanceof FormattedCharSequence fcs) {
if (Bits.getFlag(flags, CENTERED)) {
x -= getStringWidth(fcs) / 2F;
}
int i = graphics.drawString(getFont(), (FormattedCharSequence) text, x, y, color.rgba(), Bits.getFlag(flags, SHADOW));
GuiHelper.setupDrawing();
return i;
} else if (text instanceof Component comp) {
if (Bits.getFlag(flags, CENTERED)) {
x -= getStringWidth(comp) / 2F;
}
int i = graphics.drawString(getFont(), comp, x, y, color.rgba(), Bits.getFlag(flags, SHADOW));
GuiHelper.setupDrawing();
return i;
} else if (text instanceof FormattedText) {
return drawString(graphics, Language.getInstance().getVisualOrder((FormattedText) text), x, y, color, flags);
} else {
var s = String.valueOf(text);
if (Bits.getFlag(flags, CENTERED)) {
x -= getStringWidth(s) / 2F;
}
int i = graphics.drawString(getFont(), s, x, y, color.rgba(), Bits.getFlag(flags, SHADOW));
GuiHelper.setupDrawing();
return i;
}
switch (text) {
case FormattedCharSequence fcs -> {
if (Bits.getFlag(flags, CENTERED)) {
x -= getStringWidth(fcs) / 2;
}
int i = graphics.drawString(getFont(), (FormattedCharSequence) text, x, y, color.rgba(), Bits.getFlag(flags, SHADOW));
GuiHelper.setupDrawing();
return i;
}
case Component comp -> {
if (Bits.getFlag(flags, CENTERED)) {
x -= getStringWidth(comp) / 2;
}
int i = graphics.drawString(getFont(), comp, x, y, color.rgba(), Bits.getFlag(flags, SHADOW));
GuiHelper.setupDrawing();
return i;
}
case FormattedText formattedText -> {
return drawString(graphics, Language.getInstance().getVisualOrder(formattedText), x, y, color, flags);
}
default -> {
var s = String.valueOf(text);
if (Bits.getFlag(flags, CENTERED)) {
x -= getStringWidth(s) / 2;
}
int i = graphics.drawString(getFont(), s, x, y, color.rgba(), Bits.getFlag(flags, SHADOW));
GuiHelper.setupDrawing();
return i;
}
}
}

public final int drawString(GuiGraphics graphics, @Nullable Object text, int x, int y, int flags) {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ minecraft_version=1.20.6
# Deps
forge_version=49.0.31
# note: can't use a newer NF version until https://github.com/architectury/architectury-loom/pull/207 is merged
neoforge_version=20.6.2-beta
neoforge_version=20.6.48-beta
neoforge_loader_version=1
fabric_loader_version=0.15.10
fabric_api_version=0.97.8+1.20.6

architectury_version=12.0.27
architectury_version=12.0.28

# There are too many of these now
rei_version=15.0.728
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginManagement {
repositories {
maven { url "https://maven.creeperhost.net/" }
maven { url "https://maven.architectury.dev/" }
maven { url "https://maven.creeperhost.net/" }
gradlePluginPortal()
}
}
Expand Down

0 comments on commit c7c939b

Please sign in to comment.