Skip to content

Commit

Permalink
Fixed exception
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterJulsen committed Oct 12, 2024
1 parent 78ce181 commit e712621
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"commentTranslate.hover.enabled": false,
"java.compile.nullAnalysis.mode": "disabled"
"java.compile.nullAnalysis.mode": "disabled",
"java.configuration.updateBuildConfiguration": "automatic"
}
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,9 @@ public static record DeparturesData(UUID stationTagId, UUID trainId) {}
return new DeparturesData(nbt.getUUID("Tag"), nbt.getUUID("Train"));
}, (player, in, temp, nbt, iteration) -> {
try {
if (!GlobalSettings.getInstance().stationTagExists(in.stationTagId())) {
return false;
}
StationTag tag = GlobalSettings.getInstance().getStationTag(in.stationTagId()).get();
ListTag list = new ListTag();
list.addAll(TrainUtils.getDeparturesAt(tag, in.trainId()).stream().map(x -> x.toNbt(true)).toList());
Expand All @@ -871,7 +874,7 @@ public static record DeparturesData(UUID stationTagId, UUID trainId) {}
}
return false;
}, (hasMore, data, iteration, nbt) -> {
return nbt.getList(DataAccessorType.DEFAULT_NBT_DATA, Tag.TAG_COMPOUND).stream().map(x -> (ClientTrainStop)ClientTrainStop.fromNbt((CompoundTag)x)).toList();
return nbt.contains(DataAccessorType.DEFAULT_NBT_DATA) ? nbt.getList(DataAccessorType.DEFAULT_NBT_DATA, Tag.TAG_COMPOUND).stream().map(x -> (ClientTrainStop)ClientTrainStop.fromNbt((CompoundTag)x)).toList() : List.of();
}
));

Expand Down

0 comments on commit e712621

Please sign in to comment.