Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20.1/dev #764

Merged
merged 4 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Java CI - Build Release

on:
release:
types: [ published ]
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+\.[0-9]+'

jobs:
build:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [2001.4.10]

### Added
* Added a new "All Table" reward type
* This works on an existing reward table, and rewards the player with one of every reward in the table

### Fixed
* Fixed some reliability issues with the reward table editor (backported improvements from 1.21)

Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
id "com.matthewprenger.cursegradle" version "1.4.0" apply false
}

apply from: 'https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/changelog.gradle'

architectury {
minecraft = rootProject.minecraft_version
}
Expand Down
23 changes: 13 additions & 10 deletions common/src/main/java/dev/ftb/mods/ftbquests/quest/Quest.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,20 +542,23 @@ public void onStarted(QuestProgressEventData<?> data) {

@Override
public void onCompleted(QuestProgressEventData<?> data) {
data.setCompleted(id);
ObjectCompletedEvent.QUEST.invoker().act(new ObjectCompletedEvent.QuestEvent(data.withObject(this)));
if (!data.getTeamData().isCompleted(this)) {
// it's possible this quest is already completed, if it has one or more optional tasks
data.setCompleted(id);
ObjectCompletedEvent.QUEST.invoker().act(new ObjectCompletedEvent.QuestEvent(data.withObject(this)));

if (!disableToast) {
data.notifyPlayers(id);
}
if (!disableToast) {
data.notifyPlayers(id);
}

if (chapter.isCompletedRaw(data.getTeamData())) {
chapter.onCompleted(data.withObject(chapter));
}
if (chapter.isCompletedRaw(data.getTeamData())) {
chapter.onCompleted(data.withObject(chapter));
}

data.getTeamData().checkAutoCompletion(this);
data.getTeamData().checkAutoCompletion(this);

checkForDependantCompletion(data.getTeamData());
checkForDependantCompletion(data.getTeamData());
}
}

private void checkForDependantCompletion(TeamData data) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.ftb.mods.ftbquests.quest.reward;

import dev.ftb.mods.ftbquests.quest.Quest;
import dev.ftb.mods.ftbquests.quest.loot.RewardTable;
import dev.ftb.mods.ftbquests.quest.loot.WeightedReward;
import net.minecraft.server.level.ServerPlayer;

public class AllTableReward extends LootReward {
public AllTableReward(long id, Quest parent) {
super(id, parent);
}

@Override
public RewardType getType() {
return RewardTypes.ALL_TABLE;
}

@Override
public void claim(ServerPlayer player, boolean notify) {
RewardTable table = getTable();

if (table != null) {
for (WeightedReward wr : table.getWeightedRewards()) {
wr.getReward().claim(player, notify);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ static RewardType register(ResourceLocation name, RewardType.Provider p, Supplie
() -> Icon.getIcon("minecraft:item/diamond"));
RewardType CHOICE = register(new ResourceLocation(FTBQuestsAPI.MOD_ID, "choice"), ChoiceReward::new,
() -> Icons.COLOR_RGB).setExcludeFromListRewards(true);
RewardType ALL_TABLE = register(new ResourceLocation(FTBQuestsAPI.MOD_ID, "all_table"), AllTableReward::new,
() -> Icons.COLOR_HSB).setExcludeFromListRewards(true);
RewardType RANDOM = register(new ResourceLocation(FTBQuestsAPI.MOD_ID, "random"), RandomReward::new,
() -> Icons.DICE).setExcludeFromListRewards(true);
RewardType LOOT = register(new ResourceLocation(FTBQuestsAPI.MOD_ID, "loot"), LootReward::new,
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/assets/ftbquests/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@
"ftbquests.reward.ftbquests.item.count": "Count",
"ftbquests.reward.ftbquests.item.only_one": "Only One",
"ftbquests.reward.ftbquests.item.only_one.tooltip": "If inventory has that item, doesn't give it. Ignores NBT.",
"ftbquests.reward.ftbquests.all_table": "All Table Reward",
"ftbquests.reward.ftbquests.choice": "Choice Reward",
"ftbquests.reward.ftbquests.random": "Random Reward",
"ftbquests.reward.ftbquests.loot": "Loot Reward",
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if (ENV.CURSEFORGE_KEY) {
requiredDependency 'ftb-teams-fabric'
optionalDependency 'ftb-xmod-compat'
}
changelog = ENV.CHANGELOG // expected to exist if ENV.CURSEFORGE_KEY does
changelog = createChangelog(project)
changelogType = 'markdown'
}
}
Expand Down
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if (ENV.CURSEFORGE_KEY) {
requiredDependency 'ftb-teams-forge'
optionalDependency 'ftb-xmod-compat'
}
changelog = ENV.CHANGELOG // expected to exist if ENV.CURSEFORGE_KEY does
changelog = createChangelog(project)
changelogType = 'markdown'
}
}
Expand Down
Loading