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

Rework of Scores: Scoreoperation Compiler #35

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: dart pub get
- name: Lint Code
run: dart analyze lib/
- name: Run tests
run: dart run coverage:test_with_coverage
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage/lcov.info
- name: Lint Code
run: dart analyze lib/
3 changes: 2 additions & 1 deletion example/files/load.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class LoadFile extends Widget {
Data.merge(Entity.All(), nbt: {
"uuid": UUID(1, 2, 3, 4),
'name': TextComponent('name'),
})
}),
Bossbar("test").get(BossbarOption.value) + 1
]);
}
}
15 changes: 15 additions & 0 deletions example/score_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:objd/core.dart';

void main(List<String> args) {
var s1 = Score(Entity.All(), "s1");
var s2 = Score.Self('s2');
var t = Bossbar("test").get(BossbarOption.value) + 1;

print(t);
// print(s1 + (s2 + s1));

final (_, ops) = t.copy();
print(ops);
//print(getCommands(For.of(ops)).join('\n'));
print(getCommands(t).join('\n')); //TODO: Caveat s1 + s2 != s2 + s1
}
1 change: 1 addition & 0 deletions folder name/data/minecraft/tags/functions/load.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"values":["mypack:load"]}
1 change: 1 addition & 0 deletions folder name/data/minecraft/tags/functions/tick.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"values":["mypack:main"]}
3 changes: 3 additions & 0 deletions folder name/data/mypack/functions/load.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scoreboard objectives add objd_temp dummy
data merge entity @a {uuid:[I;1,2,3,4],name:{"text":"name"}}
scoreboard players add #at6AbnE8 objd_temp 1
Empty file.
1 change: 1 addition & 0 deletions folder name/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"pack":{"pack_format":8,"description":"This is a datapack generated with objd by Stevertus"}}
Loading
Loading