Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into sign-calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
olim88 committed May 9, 2024
2 parents f5d73d6 + 6d1a731 commit f1e643b
Show file tree
Hide file tree
Showing 179 changed files with 7,956 additions and 7,549 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/webhook_translate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@ jobs:
shell: bash
run: |
OUTPUT=$(go run github.com/josephburnett/jd@latest <(git show HEAD^:src/main/resources/assets/skyblocker/lang/en_us.json) <(git show HEAD:src/main/resources/assets/skyblocker/lang/en_us.json) || true)
MAX_LENGTH=4070
if [ "${#OUTPUT}" -gt "$MAX_LENGTH" ]; then
OUTPUT="${OUTPUT:0:$MAX_LENGTH}"
LAST_INDEX=-1
for (( i=${#OUTPUT}-1; i>=0; i-- )); do
if [[ "${OUTPUT:$i:1}" =~ [-+@] ]]; then
LAST_INDEX=$i
break
fi
done
if [[ $LAST_INDEX -ne -1 && "${OUTPUT:$LAST_INDEX:1}" =~ [-+] ]]; then
for (( i=LAST_INDEX-1; i>=0; i-- )); do
if [[ "${OUTPUT:$i:1}" == "@" ]]; then
OUTPUT="${OUTPUT:0:i}"
break
fi
done
else
OUTPUT="${OUTPUT:0:LAST_INDEX}"
fi
fi
OUTPUT+="..."
OUTPUT="\`\`\`diff
$OUTPUT
\`\`\`"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ publishMods {
accessToken = System.getenv("MODRINTH_TOKEN")
projectId = modrinth_id
minecraftVersions.add(minecraft_version)
announcementTitle = "<:modrinth:900697862206287882> Download from Modrinth"
announcementTitle = "<:modrinth:1237114573354438696> Download from Modrinth"
requires("fabric-api")
optional("modmenu", "rei", "emi")
}
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/de/hysky/skyblocker/SkyblockerScreen.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package de.hysky.skyblocker;

import java.time.LocalDate;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.Tips;
import de.hysky.skyblocker.utils.scheduler.Scheduler;
Expand All @@ -26,7 +28,7 @@ public class SkyblockerScreen extends Screen {
private static final int BUTTON_WIDTH = 210;
private static final int HALF_BUTTON_WIDTH = 101; //Same as (210 - 8) / 2
private static final Text TITLE = Text.literal("Skyblocker " + SkyblockerMod.VERSION);
private static final Identifier ICON = new Identifier(SkyblockerMod.NAMESPACE, "icon.png");
private static final Identifier ICON;
private static final Text CONFIGURATION_TEXT = Text.translatable("text.skyblocker.config");
private static final Text SOURCE_TEXT = Text.translatable("text.skyblocker.source");
private static final Text REPORT_BUGS_TEXT = Text.translatable("menu.reportBugs");
Expand All @@ -36,6 +38,12 @@ public class SkyblockerScreen extends Screen {
private static final Text DISCORD_TEXT = Text.translatable("text.skyblocker.discord");
private final ThreePartsLayoutWidget layout = new ThreePartsLayoutWidget(this);

static {
LocalDate date = LocalDate.now();

ICON = date.getMonthValue() == 4 && date.getDayOfMonth() == 1 ? new Identifier(SkyblockerMod.NAMESPACE, "icons.png") : new Identifier(SkyblockerMod.NAMESPACE, "icon.png");
}

private SkyblockerScreen() {
super(TITLE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public List<Widget> setupDisplay(SkyblockCraftingDisplay display, Rectangle boun
slots.get(i).entries(input.get(i)).markInput();
}
out.addAll(slots);
out.add(Widgets.createSlot(resultPoint).entries(display.getOutputEntries().get(0)).disableBackground().markOutput());
out.add(Widgets.createSlot(resultPoint).entries(display.getOutputEntries().getFirst()).disableBackground().markOutput());

// Add craftingText Label
Label craftTextLabel = Widgets.createLabel(new Point(bounds.getCenterX(), startPoint.y + 55), Text.of(display.getCraftText()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public final void render(DrawContext context, int mouseX, int mouseY, float delt
*/
protected void renderWidget(DrawContext context, List<Widget> widgets) {
for (Widget widget : widgets) {
widget.render(context, SkyblockerConfigManager.get().general.tabHud.enableHudBackground);
widget.render(context, SkyblockerConfigManager.get().uiAndVisuals.tabHud.enableHudBackground);
}
}

Expand Down
Loading

0 comments on commit f1e643b

Please sign in to comment.