Skip to content

Commit

Permalink
Merge pull request #728 from FTBTeam/1.20.1/dev
Browse files Browse the repository at this point in the history
1.20.1/dev
  • Loading branch information
desht authored May 28, 2024
2 parents cd9bbea + 8ca39a6 commit a47b1af
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2001.4.5]

### Fixed
* _Actually_ fixed the issue that should have been fixed in 2001.4.4
* The previous fix worked for 50% of possible stack sizes, and the wrong 50% was used in testing...

## [2001.4.4]

### Fixed
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mod_id=ftbquests
archives_base_name=ftb-quests
minecraft_version=1.20.1
# Build time
mod_version=2001.4.4
mod_version=2001.4.5
maven_group=dev.ftb.mods
mod_author=FTB Team
# Curse release
Expand Down

0 comments on commit a47b1af

Please sign in to comment.