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 #765

Merged
merged 2 commits into from
Jan 28, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
* Fixed some reliability issues with the reward table editor (backported improvements from 1.21)
* Fixed quest completion toasts appearing more than once if a quest has multiple optional tasks
* Fixed Quest Barrier blocks crashing in SMP environments
* Improvements and fixes for ru_ru translations (thanks @j-tap)

## [2001.4.9]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import dev.ftb.mods.ftbquests.util.NetUtils;
import dev.ftb.mods.ftbteams.api.FTBTeamsAPI;
import dev.ftb.mods.ftbteams.api.Team;
import dev.ftb.mods.ftbteams.api.client.ClientTeamManager;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
Expand Down Expand Up @@ -999,9 +1000,18 @@ public TeamData getOrCreateTeamData(Team team) {

@Override
public TeamData getOrCreateTeamData(Entity player) {
return FTBTeamsAPI.api().getManager().getTeamForPlayerID(player.getUUID())
.map(this::getOrCreateTeamData)
.orElse(null);
return player.level().isClientSide && player instanceof Player p ?
getClientTeamData(p).orElse(null) :
FTBTeamsAPI.api().getManager().getTeamForPlayerID(player.getUUID())
.map(this::getOrCreateTeamData)
.orElse(null);
}

private Optional<TeamData> getClientTeamData(Player player) {
ClientTeamManager mgr = FTBTeamsAPI.api().getClientManager();
return mgr.getKnownPlayer(player.getUUID())
.map(kcp -> mgr.getTeamByID(kcp.teamId()))
.flatMap(team -> team.map(this::getOrCreateTeamData));
}

@Override
Expand Down
Loading