@@ -32,67 +32,65 @@ internal object TimeCommand : VanillaCommandBase("time") {
3232 aliases()
3333
3434 dispatcher.register(
35- literal(" time" ).then(
36- literal(" set" ).then(
37- literal(" day" ).requires { permission(it, " set" ) }.executes {
35+ literal(" time" ).requires {
36+ isAllowedAny(it) {
37+ listOf (" time.change.set" to 2 , " time.change.add" to 2 , " time.query" to 2 )
38+ }
39+ }.then(
40+ literal(" set" ).requires { permission(it, " set" ) }.then(
41+ literal(" day" ).executes {
3842 TimeCommand .setTime(it.source, 1000 )
3943 }
4044 ).then(
41- literal(" noon" ).requires { permission(it, " set " ) }. executes {
45+ literal(" noon" ).executes {
4246 TimeCommand .setTime(it.source, 6000 )
4347 }
4448 ).then(
45- literal(" sunset" ).requires { permission(it, " set " ) }. executes {
49+ literal(" sunset" ).executes {
4650 TimeCommand .setTime(it.source, 12000 )
4751 }
4852 ).then(
49- literal(" night" ).requires { permission(it, " set " ) }. executes {
53+ literal(" night" ).executes {
5054 TimeCommand .setTime(it.source, 13000 )
5155 }
5256 ).then(
53- literal(" midnight" ).requires { permission(it, " set " ) }. executes {
57+ literal(" midnight" ).executes {
5458 TimeCommand .setTime(it.source, 18000 )
5559 }
5660 ).then(
57- literal(" sunrise" ).requires { permission(it, " set " ) }. executes {
61+ literal(" sunrise" ).executes {
5862 TimeCommand .setTime(it.source, 23000 )
5963 }
6064 ).then(
6165 Commands .argument(
6266 " time" , TimeArgument .func_218091_a()
63- ).requires { permission(it, " set " ) }. executes {
67+ ).executes {
6468 TimeCommand .setTime(it.source, IntegerArgumentType .getInteger(it, " time" ))
6569 }
6670 )
6771 ).then(
68- literal(" add" ).then(
72+ literal(" add" ).requires { permission(it, " add " ) }. then(
6973 Commands .argument(
7074 " time" , TimeArgument .func_218091_a()
71- ).requires { permission(it, " add " ) }. executes {
75+ ).executes {
7276 TimeCommand .addTime(it.source, IntegerArgumentType .getInteger(it, " time" ))
7377 }
7478 )
7579 ).then(
76- literal(" query" ).then(
77- literal(" daytime" ).requires {
78- permission(it, " query" )
79- }.executes {
80+ literal(" query" ).requires { permission(it, " query" ) }.then(
81+ literal(" daytime" ).executes {
8082 TimeCommand .sendQueryResults(
8183 it.source, TimeCommand .getDayTime(it.source.world)
8284 )
8385 }
8486 ).then(
85- literal(" gametime" ).requires {
86- permission(it, " query" )
87- }.executes {
87+ literal(" gametime" ).executes {
8888 TimeCommand .sendQueryResults(
8989 it.source, (it.source.world.gameTime % 2147483647L ).toInt()
9090 )
9191 }
9292 ).then(
93- literal(" day" ).requires {
94- permission(it, " query" )
95- }.executes {
93+ literal(" day" ).executes {
9694 TimeCommand .sendQueryResults(
9795 it.source, (it.source.world.dayTime / 24000L % 2147483647L ).toInt()
9896 )
0 commit comments