Skip to content

Commit

Permalink
Merge pull request #729 from FTBTeam/1.20.4/dev
Browse files Browse the repository at this point in the history
1.20.4/dev
  • Loading branch information
desht committed Jun 5, 2024
2 parents f38443b + a06d8fd commit 1c6e678
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fixed issue where larger itemstack sizes when creating item tasks led to a "missing" (empty) item in the task
* Fixed positioning of text entry popup when adding XP or XP Levels rewards to a quest
* Popup was being positioned off-screen depending on game resolution and quest screen scroll position
* Fixed quest description editor "insert link" action inserting invalid JSON
* Quoted `"underlined" : "true"` needs to be `"underlined": true`

# [2004.2.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class MultilineTextEditorScreen extends BaseScreen {
private static final Pattern STRIP_FORMATTING_PATTERN = Pattern.compile("(?i)&[0-9A-FK-OR]");
private static final int MAX_UNDO = 10;
protected static final String LINK_TEXT_TEMPLATE = "{ \"text\": \"%s\", \"underlined\": \"true\", \"clickEvent\": { \"action\": \"change_page\", \"value\": \"%016X\" } }";
protected static final String LINK_TEXT_TEMPLATE = "{ \"text\": \"%s\", \"underlined\": true, \"clickEvent\": { \"action\": \"change_page\", \"value\": \"%016X\" } }";

private final Component title;
private final ListConfig<String, StringConfig> config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ public void drawOffsetBackground(GuiGraphics graphics, Theme theme, int x, int y
Color4I c = complete ?
ThemeProperties.DEPENDENCY_LINE_COMPLETED_COLOR.get(questScreen.selectedChapter) :
ThemeProperties.DEPENDENCY_LINE_UNCOMPLETED_COLOR.get(questScreen.selectedChapter);
if (unavailable || qb.quest.getProgressionMode() == ProgressionMode.FLEXIBLE && !questScreen.file.selfTeamData.areDependenciesComplete(qb.quest)) {
// dim connection lines for unavailable quests
c = c.withAlpha(Math.max(30, c.alphai() / 2));
}

for (QuestButton button : qb.getDependencies()) {
if (button.shouldDraw() && button.quest != selectedQuest && qb.quest != selectedQuest && !button.quest.shouldHideDependentLines()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public static ItemStack readItem(CompoundTag tag) {
return stack;
}

return ItemStack.of(tag);
// Kludge: vanilla serializes the stack size as a byte, which breaks for a stack >127 items,
// leading to the stack turning into an empty (air) stack
// (note: using ItemStack#copyWithCount will *not* work here)
ItemStack stack = ItemStack.of(tag);
stack.setCount(tag.getInt("Count"));
return stack;
}

public static CompoundTag writeItem(ItemStack stack) {
Expand All @@ -53,9 +58,7 @@ public static CompoundTag writeItem(ItemStack stack) {
SNBTCompoundTag tag = new SNBTCompoundTag();
stack.save(tag);

// kludge: vanilla saves the stack size as a byte, which means negative sizes for big stacks,
// leading to the stack turning into an empty (air) stack
// https://github.com/FTBTeam/FTB-Mods-Issues/issues/1182
// kludge: see above!
tag.putInt("Count", stack.getCount());

if (tag.size() == 2) {
Expand Down

0 comments on commit 1c6e678

Please sign in to comment.