Welcome

Welcome to my docs! This is the place to look for everything to do with my projects. Feel free to look around, or just go straight to what you're looking for.

These docs are sorted, for the most part, alphabetically. Nothing here is ranked as being better than another project.


These docs are generated with mdBook, like Gitbook but in Rust.

Minecraft

Welcome to the Minecraft section of my documentation! This is just the place for you to find documentation for any libraries I've made, or for any of the public plugins I've made.

Libraries

Plugins

such empty, much wow.

Apollo Core

Apollo Core is a Java library for making Bukkit plugins faster and easier. I have personally used it for quick plugins for messing around, and for larger projects. It has saved me countless hours of work and I hope it will for you too!

Getting Started

Installation

It's hard to get started with a library if you don't have it installed, so let's take care of that:

Maven

To install AC in your Maven managed plugin, just insert these lines where appropriate, and update the version numbers:

<repository>
    <id>brettb-repo</id>
    <url>https://repo.brettb.xyz</url>
</repository>
<dependency>
    <groupId>xyz.brettb</groupId>
    <artifactId>ac</artifactId>
    <version>0.13.0</version>
    <scope>provided</scope>
</dependency>

Gradle

Installing AC in you Gradle managed plugin is just as easy, insert these lines where they apply, updating the version numbers when appropriate.

repositories {
    maven {
        name = 'brettb-repo'
        url = 'https://repo.brettb.xyz'
    }
}

dependencies {
    compileOnly group: 'xyz.brettb', name: 'ac', version: '0.13.0'
}

Usage

Using AC in your plugin is also quite easy:

package xyz.brettb.example;

import org.bukkit.ChatColor;
import xyz.brettb.ac.commands.CommandContext;
import xyz.brettb.ac.commands.CorePluginCommand;
import xyz.brettb.ac.commands.CorePluginCommandMeta;
import xyz.brettb.ac.plugin.CorePlugin;
import xyz.brettb.ac.plugin.CorePluginMeta;

// The prefix for chat messages
@CorePluginMeta(chatPrefix = "&l&8[&bAEX&8]&r")
public class example extends CorePlugin {

    @Override
    public void onModuleEnable() {
        // Register the command to the module
        registerCommand(new ExampleCommand());
    }

    // Example command definition
    @CorePluginCommandMeta(description = "Just an example", aliases = {"ex"})
    private static class ExampleCommand extends CorePluginCommand {
        public ApolloCoreCommand() {
            // Sets the command's name
            super("example");
        }

        // Called when the command is executed
        @Override
        public void handleCommandUnspecific(CommandContext ctx) {
            ctx.reply(ChatColor.translateAlternateColorCodes('&', getPlugin().getChatPrefix()) +
                    ChatColor.DARK_AQUA + " This is an example!");
        }

    }

}

Help

If you need help with AC feel free to message me on Discord @ apollo#9292, or opening an issue on GitHub

Further Documentation

At this time no further documentation exists, my best recommendation is to look at the source code and figure things out for yourself. If you'd like to write better documentation for me, be my guest!

Prevue

Prevue (ESQ) was the software behind the Prevue Channel. Prevue ran on the Amiga platform. The software displays a grid of channels and the current listings. Randomly learning about it from a friend, I decided to write a CLI to help generate the listing files (curday.dat).

genday

Genday is my version of a CLI to generate curday.dat files. For now, it both exposes a public API to define curdays in code, and a JSON converter. If this sounds useful to you, head on over to the Installation page.

Installation

To start it all off, you're going to need to install genday, which can be done one of two ways, either by directly downloading the executable, or via go get

Standard Download

If you don't have go installed, you can just head on over to the releases page and download the latest release for your platform. Extract it using something like 7-Zip for Windows or tar on other platforms (tar -zxvf genday*.tar.gz).

That's it! Although you'll probably want to also add the binary to your path for ease of use.

go get

If you do have go installed, you can just run a single command to install genday:

$ go get -u github.com/GreatGodApollo/genday

Scoop

If you happen to have scoop installed, I happen to have a scoop bucket. Said bucket's name is Trough.

$ scoop bucket add trough https://github.com/GreatGodApollo/trough.git
$ scoop install genday

Usage

$ genday --help
    Usage: genday [--version] [--verbose] COMMAND [arg...]

    Generate a curday.dat file

    Options:
    -v, --version   Show the version and exit
    -V, --verbose   Verbose debug mode

    Commands:
    json            generate a file from JSON

    Run 'genday COMMAND --help' for more information on a command.

genday is pretty straight forward to generate a curday.dat from a JSON file:

$ genday json input.json -o output.dat
    [GD] Successfully saved to output.dat
    [GD] Generated X listings

To learn more about this JSON format, read on.

JSON Format

I'd like to think that the JSON format is pretty straightforward, but that's pretty difficult to argue.

First up: We need to define a few settings. Now I'm not gonna lie, I don't really understand what any of these do.

{
    "settings": "AE3366N",
    ...
}

Then we just need to set up a few local things; once again, I don't understand the different values for timezone, all I know is that 6 is CST, work from there.

{
    ...
    "timezone": 6,
    "dst": false,
    "city": "Madison",
    "airport": "MSN",
    ...
}

From there, the world is your oyster, add a few channels with a few listings, they're pretty darn simple!

{
  ...
  "channels": [
    {
      "number": 1,
      "id": "TST001",
      "callsign": "TST",
      "hilite": false,
      "althilite": false,
      "summary": false,
      "listings": [
        {
          "time": "00:00",
          "name": "Listing #1"
        },
        {
          "time": "01:00",
          "name": "Listing #2"
        },
        {
          "time": "02:00",
          "name": "Listing #3"
        }
      ]
    }
  ]
}

The only things that could use a little bit of exlpaining are the flags:

{
  ...
      "hilite": false,
      "althilite": false,
      "summary": false,
  ...
}

hilite is the red background highlight, althilite is the blue background highlight, and summary marks it as a summary channel as well. Unfortunately, due to the way I programmed things, you do need to specify all of these options as false, even if you aren't using them.

Spacebin

Spacebin is text sharing for the final frontier. It's essentially a redesign of haste in Go, using Svelte for the web interface, and Fiber for the backend. I decided to build an API client & library for Go, mostly because it's one of my favorite languages, but also because I needed a project.

gospacebin

gospacebin is a Spacebin API library written in Go. If you don't feel like reading these docs, head on over to pkg.go.dev to see the automatically generated package documentation. However, if you're too lazy to read technical docs, keep on reading.

Usage

To get started with gospacebin, just import it into your project:

import "github.com/GreatGodApollo/gospacebin"

Proceeding to construct and use a spacebin client is also super easy:

// The single argument is the API instance
spacebin := gospacebin.NewClient("https://api.spaceb.in")

// Do something with the client ie:

// The single argument is the content of the document
opts := gospacebin.NewCreateDocOpts("test")
doc, err := spacebin.CreateDocument(opts)
// etc, etc...

For more technical documentation, please look at pkg.go.dev

lunar

Lunar is my Go rendition of a Spacebin CLI. As of right now it supports specifying a document via the command line, or piping one directly in. If you're ready to get going, head on over to Installation.

Installation

To start it all off, you're going to need to install lunar, which can be done one of two ways, either by directly downloading the executable, or via go get

Standard Download

If you don't have go installed, you can just head on over to the releases page and download the latest release for your platform. Extract it using something like 7-Zip for Windows or tar on other platforms (tar -zxvf lunar*.tar.gz).

That's it! Although you'll probably want to also add the binary to your path for ease of use.

go get

If you do have go installed, you can just run a single command to install lunar:

$ go get -u github.com/GreatGodApollo/lunar

Usage

$ lunar --help
    Lunar is a CLI for Spacebin that allows you to easily make documents.
    This application can be used in a couple of different ways
    to quickly create a document on an instance.
    
    You can either pipe a document into lunar by doing:
    'command | lunar'
    
    or upload a document directly:
    'lunar -f file.txt'
    
    Usage:
      lunar [flags]
    
    Flags:
          --config string       config file (default is $HOME/.lunar.yaml)
      -f, --file string         the file to upload
      -h, --help                help for lunar
      -i, --instance string     the spacebin instance (default "https://api.spaceb.in")
      -r, --raw                 do you want the raw url
          --result-url string   the base url for response (default "https://spaceb.in")
      -v, --version             version for lunar

lunar is pretty straight forward to use. You can either pipe a document into lunar by doing:

# *unix
$ cat file.txt | lunar

# Windows
$ type file.txt | lunar

or specify a document to upload:

$ lunar -f file.txt

Configuration

As of yet, there are only two values you can configure via $HOME/.lunar.yaml:

instance

This is the API instance that you're uploading your documents to. The default is https://api.spaceb.in.

result-url

This is the base of the final URL that is output, defaulting to https://spaceb.in/. Currently the default URL does not actually resolve to your document (as the frontend for Spacebin has not been finished), so I recommend switching it to https://api.spaceb.in/api/v1/document/ and using the -r flag until the frontend is finished.