33import com .mojang .brigadier .builder .LiteralArgumentBuilder ;
44import com .mojang .brigadier .context .CommandContext ;
55import gs .mclo .Constants ;
6- import gs .mclo .api . MclogsClient ;
6+ import gs .mclo .MclogsCommon ;
77import gs .mclo .components .ClickEventAction ;
88import gs .mclo .components .IComponent ;
99import gs .mclo .components .IComponentFactory ;
@@ -26,22 +26,22 @@ public abstract class Command<
2626 /**
2727 * The Mclogs API client
2828 */
29- protected final MclogsClient apiClient ;
29+ protected final MclogsCommon common ;
3030 /**
3131 * A component factory
3232 */
3333 protected final IComponentFactory <ComponentType , StyleType , ClickEventType > componentFactory ;
3434
3535 /**
3636 * Create a new command
37- * @param apiClient The Mclogs API client
37+ * @param common Common mod/plugin instance
3838 * @param componentFactory A component factory
3939 */
4040 public Command (
41- MclogsClient apiClient ,
41+ MclogsCommon common ,
4242 IComponentFactory <ComponentType , StyleType , ClickEventType > componentFactory
4343 ) {
44- this .apiClient = apiClient ;
44+ this .common = common ;
4545 this .componentFactory = componentFactory ;
4646 }
4747
@@ -86,7 +86,7 @@ public <T> int share(CommandContext<T> context, BuildContext<T, ComponentType> b
8686
8787 Constants .LOG .info ("Sharing {}" , source .getRootDirectory ().relativize (path ));
8888
89- apiClient .uploadLog (path ).thenAccept (response -> {
89+ common . getApiClient () .uploadLog (path ).thenAccept (response -> {
9090 if (response .isSuccess ()) {
9191 var link = componentFactory .literal (response .getUrl ()).style (openUrlStyle (response .getUrl ()));
9292 var message = componentFactory .literal ("Your log has been uploaded: " ).append (link );
0 commit comments