Skip to content

Commit d0d6445

Browse files
committed
feat: Update UUID generation to v7 for item stacks
Updated the `ItemStack` constructor to use `Uuid().v7()` for generating default item IDs instead of `v4()`. This change leverages the time-based nature of UUIDv7 for potentially better performance and ordering. A minor syntax update was also made in `lib/ui/game/campfire/campfire.dart` to use a cascade operator for `BorderRadius`.
1 parent 7806b3a commit d0d6445

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/core/item/item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class ItemStack with ExtraMixin implements JConvertibleProtocol {
359359

360360
int get stackMass => mass ?? meta.mass;
361361

362-
ItemStack(this.meta, {int? id, this.mass}) : id = id ?? const Uuid().v4().hashCode;
362+
ItemStack(this.meta, {int? id, this.mass}) : id = id ?? const Uuid().v7().hashCode;
363363

364364
String displayName() => meta.l10nName();
365365

lib/ui/game/campfire/campfire.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ class _DynamicCampfireImageState extends AnimatedWidgetBaseState<DynamicCampfire
490490

491491
@override
492492
Widget build(BuildContext context) {
493-
return ClipRRect(borderRadius: const BorderRadius.all(Radius.circular(8)), child: buildBar());
493+
return ClipRRect(borderRadius: const .all(.circular(8)), child: buildBar());
494494
}
495495

496496
Widget buildBar() {

0 commit comments

Comments
 (0)