Skip to content

Commit bb9afba

Browse files
Merge pull request #731 from FTBTeam/1.19/dev
1.19/dev
2 parents f1e2142 + 10c87b1 commit bb9afba

15 files changed

Lines changed: 41 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1902.5.9]
8+
9+
### Fixed
10+
* Fixed loading quest data from previous version leading to infinite loops and server timeouts in certain cases
11+
* Related to quest book being in flexible mode
12+
* Fixed right-clicking a quest (outside edit mode) ignoring the "Hide Details Until Startable" property
13+
714
## [1902.5.8]
815

916
### Fixed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "architectury-plugin" version "3.4-SNAPSHOT"
3-
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
3+
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
44
id "com.matthewprenger.cursegradle" version "1.4.0" apply false
55
}
66

common/src/main/java/dev/ftb/mods/ftbquests/block/entity/ITaskScreen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package dev.ftb.mods.ftbquests.block.entity;
22

33
import net.minecraft.world.item.ItemStack;
4+
import org.jetbrains.annotations.NotNull;
45

5-
import javax.annotation.Nonnull;
66
import java.util.Optional;
77
import java.util.UUID;
88

99
public interface ITaskScreen {
1010
Optional<TaskScreenBlockEntity> getCoreScreen();
1111

12-
@Nonnull
12+
@NotNull
1313
UUID getTeamId();
1414

1515
boolean isInputOnly();

common/src/main/java/dev/ftb/mods/ftbquests/block/entity/TaskScreenAuxBlockEntity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
import net.minecraft.world.level.block.state.BlockState;
1212
import org.jetbrains.annotations.NotNull;
1313

14-
import javax.annotation.Nonnull;
1514
import java.lang.ref.WeakReference;
1615
import java.util.Optional;
1716
import java.util.UUID;
1817

1918
public class TaskScreenAuxBlockEntity extends BlockEntity implements ITaskScreen, Nameable {
20-
@Nonnull
19+
@NotNull
2120
private WeakReference<TaskScreenBlockEntity> coreScreen = new WeakReference<>(null);
2221
private BlockPos corePosPending; // non-null after NBT load & before querying/resolving
2322

@@ -46,7 +45,7 @@ public Optional<TaskScreenBlockEntity> getCoreScreen() {
4645
return Optional.ofNullable(coreScreen.get());
4746
}
4847

49-
public void setCoreScreen(@Nonnull TaskScreenBlockEntity coreScreen) {
48+
public void setCoreScreen(@NotNull TaskScreenBlockEntity coreScreen) {
5049
// this must ONLY be called from TaskScreenBlock#onPlacedBy() !
5150
if (this.coreScreen.get() != null) throw new IllegalStateException("coreScreen is already set and can't be changed!");
5251

common/src/main/java/dev/ftb/mods/ftbquests/block/entity/TaskScreenBlockEntity.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
import net.minecraft.world.level.block.entity.BlockEntity;
2525
import net.minecraft.world.level.block.state.BlockState;
2626
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
27+
import org.jetbrains.annotations.NotNull;
2728
import org.jetbrains.annotations.Nullable;
2829

29-
import javax.annotation.Nonnull;
3030
import java.util.Optional;
3131
import java.util.UUID;
3232

@@ -40,7 +40,8 @@ public class TaskScreenBlockEntity extends BlockEntity implements ITaskScreen {
4040
private boolean textShadow = false;
4141
private ItemStack inputModeIcon = ItemStack.EMPTY;
4242
private ItemStack skin = ItemStack.EMPTY;
43-
@Nonnull private UUID teamId = Util.NIL_UUID;
43+
@NotNull
44+
private UUID teamId = Util.NIL_UUID;
4445
public float[] fakeTextureUV = null; // null for unknown, 0-array for no texture, 4-array for a texture
4546
private TeamData cachedTeamData = null;
4647

@@ -109,13 +110,13 @@ public void setTextShadow(boolean textShadow) {
109110
this.textShadow = textShadow;
110111
}
111112

112-
public void setTeamId(@Nonnull UUID teamId) {
113+
public void setTeamId(@NotNull UUID teamId) {
113114
this.teamId = teamId;
114115
cachedTeamData = null;
115116
}
116117

117118
@Override
118-
@Nonnull
119+
@NotNull
119120
public UUID getTeamId() {
120121
return teamId;
121122
}

common/src/main/java/dev/ftb/mods/ftbquests/gui/MultilineTextEditorScreen.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import net.minecraft.client.gui.components.Whence;
2323
import net.minecraft.client.gui.screens.Screen;
2424
import net.minecraft.network.chat.Component;
25+
import org.jetbrains.annotations.NotNull;
2526

26-
import javax.annotation.Nonnull;
2727
import java.util.*;
2828
import java.util.regex.Pattern;
2929

@@ -233,7 +233,7 @@ private void resetFormatting() {
233233
}
234234
}
235235

236-
private static String stripFormatting(@Nonnull String selectedText) {
236+
private static String stripFormatting(@NotNull String selectedText) {
237237
return STRIP_FORMATTING_PATTERN.matcher(selectedText).replaceAll("");
238238
}
239239

@@ -462,6 +462,6 @@ public ToolbarButton withTooltip(Component... lines) {
462462
}
463463
}
464464

465-
private record HistoryElement(@Nonnull String text, int cursorPos) {
465+
private record HistoryElement(@NotNull String text, int cursorPos) {
466466
}
467467
}

common/src/main/java/dev/ftb/mods/ftbquests/gui/quests/QuestButton.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void onClicked(MouseButton button) {
191191
questScreen.toggleSelected(moveAndDeleteFocus());
192192
} else if (!quest.guidePage.isEmpty() && quest.tasks.isEmpty() && quest.rewards.isEmpty() && quest.getDescription().length == 0) {
193193
handleClick("guide", quest.guidePage);
194-
} else if (questScreen.file.canEdit() || !quest.hideDetailsUntilStartable() || questScreen.file.self.canStartTasks(quest)) {
194+
} else {
195195
toggleQuestViewPanel();
196196
}
197197
} else if (questScreen.file.canEdit() && button.isMiddle()) {
@@ -207,6 +207,10 @@ public void onClicked(MouseButton button) {
207207
}
208208

209209
private void toggleQuestViewPanel() {
210+
if (!questScreen.file.canEdit() && quest.hideDetailsUntilStartable() && !questScreen.file.self.canStartTasks(quest)) {
211+
return;
212+
}
213+
210214
if (questScreen.getViewedQuest() != quest) {
211215
questScreen.open(theQuestObject(), false);
212216
} else {

common/src/main/java/dev/ftb/mods/ftbquests/quest/QuestFile.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
import net.minecraft.world.entity.player.Player;
3838
import net.minecraft.world.item.ItemStack;
3939
import org.apache.commons.lang3.mutable.MutableInt;
40+
import org.jetbrains.annotations.NotNull;
4041
import org.jetbrains.annotations.Nullable;
4142

42-
import javax.annotation.Nonnull;
4343
import java.io.IOException;
4444
import java.nio.file.Files;
4545
import java.nio.file.Path;
@@ -254,7 +254,7 @@ public Chapter getChapter(long id) {
254254
return object instanceof Chapter ? (Chapter) object : null;
255255
}
256256

257-
@Nonnull
257+
@NotNull
258258
public Chapter getChapterOrThrow(long id) {
259259
if (getBase(id) instanceof Chapter c) return c;
260260
throw new IllegalArgumentException("Unknown chapter ID: c");

common/src/main/java/dev/ftb/mods/ftbquests/quest/TeamData.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,10 @@ public final void setProgress(Task task, long progress) {
640640
}
641641

642642
public void markTaskCompleted(Task task) {
643+
if (isCompleted(task)) {
644+
return;
645+
}
646+
643647
List<ServerPlayer> onlineMembers = getOnlineMembers();
644648
List<ServerPlayer> notifiedPlayers;
645649

common/src/main/java/dev/ftb/mods/ftbquests/quest/task/FluidTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import net.minecraft.resources.ResourceLocation;
2222
import net.minecraft.world.level.material.Fluid;
2323
import net.minecraft.world.level.material.Fluids;
24+
import org.jetbrains.annotations.Nullable;
2425

25-
import javax.annotation.Nullable;
2626
import java.util.Optional;
2727

2828
/**

0 commit comments

Comments
 (0)