Skip to content

Commit e57e0c1

Browse files
committed
Data Storage improvements
1 parent a51671c commit e57e0c1

19 files changed

Lines changed: 237 additions & 136 deletions

File tree

.github/workflows/dart.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@ jobs:
2323
- name: Install dependencies
2424
run: dart pub get
2525
- name: Run tests
26-
run: dart run test
26+
run: pub run test --coverage="coverage"
27+
- name: Convert coverage to ICOV
28+
run: pub run coverage:format_coverage --lcov --in=coverage --out=coverage.lcov --packages=.packages --report-on=lib
29+
- name: Upload coverage to Codecov
30+
uses: codecov/codecov-action@v1.0.2
31+
with:
32+
token: ${{secrets.CODECOV_TOKEN}}
33+
file: coverage.lcov

example/files/load.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class LoadFile extends Widget {
1010
Data.merge(Entity.All(), nbt: {
1111
"uuid": UUID(1, 2, 3, 4),
1212
'name': TextComponent('name'),
13-
})
13+
}),
14+
Bossbar("test").get(BossbarOption.value) + 1
1415
]);
1516
}
1617
}

example/score_test.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ import 'package:objd/core.dart';
33
void main(List<String> args) {
44
var s1 = Score(Entity.All(), "s1");
55
var s2 = Score.Self('s2');
6-
var t = (s1 + s2) +
7-
s1 / (s2 + 2) +
8-
(Bossbar("test") << s1) +
9-
Bossbar("test").get(BossbarOption.value);
6+
var t = Bossbar("test").get(BossbarOption.value) + 1;
107

11-
//print(t);
12-
print(s1 + (s2 + s1));
8+
print(t);
9+
// print(s1 + (s2 + s1));
1310

1411
final (_, ops) = t.copy();
12+
print(ops);
1513
//print(getCommands(For.of(ops)).join('\n'));
16-
print(getCommands(s1 + s2 + s1).join('\n')); //TODO: Caveat s1 + s2 != s2 + s1
14+
print(getCommands(t).join('\n')); //TODO: Caveat s1 + s2 != s2 + s1
1715
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"values":["mypack:load"]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"values":["mypack:main"]}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
scoreboard objectives add objd_temp dummy
2+
data merge entity @a {uuid:[I;1,2,3,4],name:{"text":"name"}}
3+
scoreboard players add #at6AbnE8 objd_temp 1

folder name/data/mypack/functions/main.mcfunction

Whitespace-only changes.

folder name/pack.mcmeta

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"pack":{"pack_format":8,"description":"This is a datapack generated with objd by Stevertus"}}

lib/src/basic/pack.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ class Pack extends Widget {
5757
'name': name,
5858
'main': main?.toMap(),
5959
'load': load?.toMap(),
60-
'modules':
61-
modules == null ? null : modules!.map((x) => x.toMap()).toList(),
62-
'files': files == null ? null : files!.map((x) => x.toMap()).toList(),
60+
'modules': modules?.map((x) => x.toMap()).toList(),
61+
'files': files?.map((x) => x.toMap()).toList(),
6362
}
6463
};
6564
}

lib/src/basic/parsable.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import 'package:gson/parsable.dart';
22

33
class Parsable extends GsonParsable {
44
/// ObjD's own type of a Parsable
5-
Parsable(String parsable) : super(parsable);
5+
Parsable(super.parsable);
66
}

0 commit comments

Comments
 (0)