Skip to content

Commit 9649267

Browse files
committed
Added a thing for the about command.
1 parent 3d4ee30 commit 9649267

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/main/java/net/foxdenstudio/foxcore/FoxCoreMain.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
import java.io.File;
4848

49-
@Plugin(id = "foxcore", name = "FoxCore", version = FoxCoreMain.PLUGIN_VERSION, dependencies = "before:foxguard")
49+
@Plugin(id = "foxcore", name = "FoxCore", version = FoxCoreMain.PLUGIN_VERSION)
5050
public class FoxCoreMain {
5151

5252
public static final String PLUGIN_VERSION = "SNAPSHOT";
@@ -77,19 +77,20 @@ public void gameConstruct(GameConstructionEvent event) {
7777
@Listener
7878
public void gamePreInit(GamePreInitializationEvent event) {
7979
FCStateRegistry.init();
80+
registerCommands();
8081
}
8182

8283
@Listener
8384
public void gameInit(GameInitializationEvent event) {
84-
registerCommands();
85+
game.getCommandManager().register(this, fcDispatcher, "foxcore", "foxc", "fcommon", "fc");
8586
FCStateRegistry.instance().registerStateFactory(new PositionStateFieldFactory(), PositionsStateField.ID, Aliases.POSITIONS_ALIASES);
8687
}
8788

8889
private void registerCommands() {
8990
TextBuilder builder = Texts.builder();
90-
builder.append(Texts.of(TextColors.GOLD, "FoxCore \n"));
91+
builder.append(Texts.of(TextColors.GOLD, "FoxCore\n"));
9192
builder.append(Texts.of("Version: " + FoxCoreMain.PLUGIN_VERSION + "\n"));
92-
builder.append(Texts.of("Author: gravityfox"));
93+
builder.append(Texts.of("Author: gravityfox\n"));
9394

9495
FCCommandMainDispatcher fcDispatcher = new FCCommandMainDispatcher("/foxcore");
9596
this.fcDispatcher = fcDispatcher;
@@ -99,7 +100,7 @@ private void registerCommands() {
99100
fcDispatcher.register(new CommandSubtract(), "subtract", "sub", "pop");
100101
fcDispatcher.register(new CommandFlush(), "flush", "clear", "wipe");
101102

102-
game.getCommandManager().register(this, fcDispatcher, "foxcore", "foxc", "fcommon", "fc");
103+
fcDispatcher.register(new CommandAbout(builder.build()), "about", "info");
103104
}
104105

105106
public Logger logger() {

src/main/java/net/foxdenstudio/foxcore/commands/CommandAbout.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,8 @@ public Optional<? extends Text> getHelp(CommandSource source) {
8383
public Text getUsage(CommandSource source) {
8484
return Texts.of("about");
8585
}
86+
87+
public void addText(Text text){
88+
this.pluginTexts.add(text);
89+
}
8690
}

0 commit comments

Comments
 (0)