Skip to content

Commit

Permalink
Merge pull request #731 from FTBTeam/1.19/dev
Browse files Browse the repository at this point in the history
1.19/dev
  • Loading branch information
MichaelHillcox committed Jun 11, 2024
2 parents f1e2142 + 10c87b1 commit bb9afba
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 26 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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).

## [1902.5.9]

### Fixed
* Fixed loading quest data from previous version leading to infinite loops and server timeouts in certain cases
* Related to quest book being in flexible mode
* Fixed right-clicking a quest (outside edit mode) ignoring the "Hide Details Until Startable" property

## [1902.5.8]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "com.matthewprenger.cursegradle" version "1.4.0" apply false
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package dev.ftb.mods.ftbquests.block.entity;

import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import java.util.Optional;
import java.util.UUID;

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

@Nonnull
@NotNull
UUID getTeamId();

boolean isInputOnly();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import java.lang.ref.WeakReference;
import java.util.Optional;
import java.util.UUID;

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

Expand Down Expand Up @@ -46,7 +45,7 @@ public Optional<TaskScreenBlockEntity> getCoreScreen() {
return Optional.ofNullable(coreScreen.get());
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import java.util.Optional;
import java.util.UUID;

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

Expand Down Expand Up @@ -109,13 +110,13 @@ public void setTextShadow(boolean textShadow) {
this.textShadow = textShadow;
}

public void setTeamId(@Nonnull UUID teamId) {
public void setTeamId(@NotNull UUID teamId) {
this.teamId = teamId;
cachedTeamData = null;
}

@Override
@Nonnull
@NotNull
public UUID getTeamId() {
return teamId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import net.minecraft.client.gui.components.Whence;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import java.util.*;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -233,7 +233,7 @@ private void resetFormatting() {
}
}

private static String stripFormatting(@Nonnull String selectedText) {
private static String stripFormatting(@NotNull String selectedText) {
return STRIP_FORMATTING_PATTERN.matcher(selectedText).replaceAll("");
}

Expand Down Expand Up @@ -462,6 +462,6 @@ public ToolbarButton withTooltip(Component... lines) {
}
}

private record HistoryElement(@Nonnull String text, int cursorPos) {
private record HistoryElement(@NotNull String text, int cursorPos) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void onClicked(MouseButton button) {
questScreen.toggleSelected(moveAndDeleteFocus());
} else if (!quest.guidePage.isEmpty() && quest.tasks.isEmpty() && quest.rewards.isEmpty() && quest.getDescription().length == 0) {
handleClick("guide", quest.guidePage);
} else if (questScreen.file.canEdit() || !quest.hideDetailsUntilStartable() || questScreen.file.self.canStartTasks(quest)) {
} else {
toggleQuestViewPanel();
}
} else if (questScreen.file.canEdit() && button.isMiddle()) {
Expand All @@ -207,6 +207,10 @@ public void onClicked(MouseButton button) {
}

private void toggleQuestViewPanel() {
if (!questScreen.file.canEdit() && quest.hideDetailsUntilStartable() && !questScreen.file.self.canStartTasks(quest)) {
return;
}

if (questScreen.getViewedQuest() != quest) {
questScreen.open(theQuestObject(), false);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import org.apache.commons.lang3.mutable.MutableInt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down Expand Up @@ -254,7 +254,7 @@ public Chapter getChapter(long id) {
return object instanceof Chapter ? (Chapter) object : null;
}

@Nonnull
@NotNull
public Chapter getChapterOrThrow(long id) {
if (getBase(id) instanceof Chapter c) return c;
throw new IllegalArgumentException("Unknown chapter ID: c");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,10 @@ public final void setProgress(Task task, long progress) {
}

public void markTaskCompleted(Task task) {
if (isCompleted(task)) {
return;
}

List<ServerPlayer> onlineMembers = getOnlineMembers();
List<ServerPlayer> notifiedPlayers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Fluids;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nullable;
import java.util.Optional;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import net.minecraft.nbt.StringTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nullable;
import java.util.Set;
import java.util.stream.IntStream;

Expand Down
6 changes: 3 additions & 3 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ processResources {

shadowJar {
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
setArchiveClassifier "dev-shadow"
}

remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveBaseName.set "${rootProject.archives_base_name}-${project.name}"
archiveClassifier.set null
setArchiveClassifier null
}

jar {
classifier "dev"
setArchiveClassifier "dev"
}

components.java {
Expand Down
6 changes: 3 additions & 3 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ shadowJar {
exclude "fabric.mod.json"

configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
setArchiveClassifier "dev-shadow"
}

remapJar {
input.set shadowJar.archiveFile
dependsOn shadowJar
archiveBaseName.set "${rootProject.archives_base_name}-${project.name}"
archiveClassifier.set null
setArchiveClassifier null
}

jar {
Expand All @@ -88,7 +88,7 @@ jar {
])
}

classifier "dev"
setArchiveClassifier "dev"
}

components.java {
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.19.2
# Build time
mod_version=1902.5.8
mod_version=1902.5.9
maven_group=dev.ftb.mods
mod_author=FTB Team
# Curse release
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit bb9afba

Please sign in to comment.