fix function loading in commands
This commit is contained in:
parent
f4a8f9502d
commit
559117352e
@ -1,10 +1,22 @@
|
|||||||
@lazy
|
@lazy
|
||||||
function triggerCommand(objective, function) {
|
function triggerCommand(objective, function) {
|
||||||
scoreboard players enable @a $objective;
|
scoreboard players enable @a $objective;
|
||||||
execute as @a[scores={$objective=1..}] run function $function;
|
execute as @a[scores={$objective=1..}] run $function;
|
||||||
scoreboard players set @a $objective 0;
|
scoreboard players set @a $objective 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function command.transport_creative() {
|
||||||
|
transfer 10.0.0.13 25566;
|
||||||
|
}
|
||||||
|
|
||||||
|
function command.transport_SMP() {
|
||||||
|
transfer 10.0.0.13 25565;
|
||||||
|
}
|
||||||
|
|
||||||
|
function command.open_menu() {
|
||||||
|
guis open menu;
|
||||||
|
}
|
||||||
|
|
||||||
class command {
|
class command {
|
||||||
@add(__load__)
|
@add(__load__)
|
||||||
function commandsLoad() {
|
function commandsLoad() {
|
||||||
@ -15,20 +27,8 @@ class command {
|
|||||||
|
|
||||||
@add(__tick__)
|
@add(__tick__)
|
||||||
function commandsTick() {
|
function commandsTick() {
|
||||||
triggerCommand(transportCreative, this.transport_creative());
|
triggerCommand(transportCreative, command.transport_creative());
|
||||||
triggerCommand(transportSMP, this.transport_SMP());
|
triggerCommand(transportSMP, command.transport_SMP());
|
||||||
triggerCommand(menu, this.menu());
|
triggerCommand(menu, command.open_menu());
|
||||||
}
|
|
||||||
|
|
||||||
function transport_creative() {
|
|
||||||
transfer 10.0.0.13 25566;
|
|
||||||
}
|
|
||||||
|
|
||||||
function transport_SMP() {
|
|
||||||
transfer 10.0.0.13 25565;
|
|
||||||
}
|
|
||||||
|
|
||||||
function open_menu() {
|
|
||||||
guis open menu;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user