Skip to content

Commit

Permalink
fix entity tag bug + project versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevertus committed Jan 4, 2024
1 parent 1997366 commit 9ed9f0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/src/basic/types/entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1133,10 +1133,11 @@ class Entity extends GsonValue implements EntityClass {
ret += '[';
for (var key in arguments.keys) {
if (arguments[key] is List) {
arguments[key].forEach((item) {
ret += _addArg(item, key);
if (item != arguments[key].last) ret += ',';
});
final list = arguments[key] as List;
if (list.isEmpty) continue;

ret += list.map((item) => _addArg(item, key)).join(',');

if (key != arguments.keys.last) ret += ',';
} else {
ret += _addArg(arguments[key], key);
Expand Down
8 changes: 7 additions & 1 deletion lib/src/build/project.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Project {
final String name;
final String description;
final double version;
final int? packFormat;
Widget generate;

/// The project is a special Widget which is just defined once.
Expand All @@ -25,8 +26,9 @@ class Project {
Project({
required this.name,
required this.generate,
this.version = 16,
this.version = 20.4,
this.target = './',
this.packFormat,
this.description = 'This is a datapack generated with objd by Stevertus',
});

Expand All @@ -48,6 +50,10 @@ class Project {
};

int getPackFormat() {
if (packFormat != null) return packFormat!;
if (version >= 20.3) return 26;
if (version >= 20.2) return 18;
if (version >= 20) return 15;
if (version >= 19.4) return 12;
if (version > 19.3) return 11;
if (version >= 19) return 10;
Expand Down

0 comments on commit 9ed9f0d

Please sign in to comment.