File tree Expand file tree Collapse file tree
fabric-example/src/main/java/net/blay09/mods/shogi/fabric Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package net .blay09 .mods .shogi .fabric ;
22
33import net .blay09 .mods .shogi .Shogi ;
4+ import net .blay09 .mods .shogi .scope .ShogiScope ;
45import net .fabricmc .api .ModInitializer ;
56import net .fabricmc .fabric .api .event .lifecycle .v1 .ServerTickEvents ;
67import net .minecraft .resources .Identifier ;
@@ -16,6 +17,9 @@ public void onInitialize() {
1617 final var booleanValue = Shogi .booleanValue (id ("boolean" ), _ -> false ).networked ();
1718 final var nameValue = Shogi .componentValue (id ("name" ), Player ::getName );
1819
20+ final var clientScope = Shogi .scope (id ("client" ), ShogiScope ::loadOnClient );
21+ final var clientIntValue = clientScope .intValue (id ("int" ), _ -> 1337 );
22+
1923 ServerTickEvents .START_SERVER_TICK .register (server -> {
2024 for (final var player : server .getPlayerList ().getPlayers ()) {
2125 if (player .isShiftKeyDown ()) {
@@ -24,6 +28,7 @@ public void onInitialize() {
2428 System .out .println (stringValue .get (player ));
2529 System .out .println (booleanValue .get (player ));
2630 System .out .println (nameValue .get (player ));
31+ System .out .println (clientIntValue .get (player ));
2732 }
2833 }
2934 });
You can’t perform that action at this time.
0 commit comments