-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ServerCommand interface, Advancements logic refactor
*Breaking*: the advancement save file now saves only the advancement Identifier, you can just remove the `,` and what is after it in old save files. Moved the grantCriterion logic to the `PLAYER_ADVANCEMENT` event from architectury. The Discord bot will now cycle presence when the server saves. Added Uptime to the `/status` slash command which had a makeover. Added new Link server command, this will link the item the player is currently holding when using the `/link` command. Added new TimeSince helper.
- Loading branch information
Showing
12 changed files
with
324 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
common/src/main/java/com/cooptweaks/advancements/commands/Progress.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.cooptweaks.advancements.commands; | ||
|
||
import com.cooptweaks.advancements.Advancements; | ||
import com.cooptweaks.commands.ServerCommand; | ||
import com.mojang.brigadier.CommandDispatcher; | ||
import com.mojang.brigadier.context.CommandContext; | ||
import net.minecraft.command.CommandRegistryAccess; | ||
import net.minecraft.server.command.CommandManager; | ||
import net.minecraft.server.command.ServerCommandSource; | ||
import net.minecraft.text.Text; | ||
|
||
public class Progress implements ServerCommand { | ||
@Override | ||
public void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess registryAccess, CommandManager.RegistrationEnvironment environment) { | ||
dispatcher | ||
.register(CommandManager.literal("cooptweaks") | ||
.then(CommandManager.literal("advancements") | ||
.then(CommandManager.literal("progress") | ||
.executes(this::execute)))); | ||
} | ||
|
||
@Override | ||
public int execute(CommandContext<ServerCommandSource> context) { | ||
context.getSource().sendFeedback(() -> Text.literal(String.format("%s advancements completed.", Advancements.getAdvancementsProgress())), false); | ||
return 0; | ||
} | ||
} |
Oops, something went wrong.