Skip to content

Vortex is a in java written template for complex java applications with mysql support and custom configs.

License

Notifications You must be signed in to change notification settings

maxi-schaefer/vortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vortex

Vortex is a in java written template for complex java applications with mysql support and custom configs.

Preview

Installing Vortex

Make sure you've installed following things:

Java Development Kit 20 Installation Guide

Maven Installation Guide


Initialize IntelliJ Project
  1. Start cloning this repository

     git clone "https://github.com/maxi-schaefer/vortex"
  2. Open your Project in Intellij File > Open > "Path to Vortex"

  3. And your done!

Start using Vortex

Commands

You can create commands in dev.max.vortex.commands.impl, just create your command class and implement Command.java. Implement the methods and change the return values. Example:

public class YourCommand implements Command {
  @Override
  public String name() {
    return "MyFirstCommand";
  }

  @Override
  public String description() {
    return "I like to code with vortex";
  }

  @Override
  public void execute(String[] args) {
    System.out.println("Hello World");
  }
}

Register your command in the CommandManager with:

commands.add(new YourCommand());

After that your command should be registered and you can start coding it with the execute method. If you want your command to have aliases use the aliases method like this:

  @Override
  public List<String> aliases() {
    return List.of(new String[]{ "test", "myAlias" });
  }

Configs

Create your config class in dev.max.vortex.config.impl, add all your variables, getter, setter and a constructor Example:

@Getter
@Setter
@AllArgsConstructor
public class TestConfig {

  private int testInt;
  private String testString;
  private double testDouble;
  private float testFloat;
  private boolean testBoolean;

}

Now add your new Config to the Configs class in dev.max.vortex.config like this:

@Setter
@Getter
public class Configs {

  private TestConfig testConfig;

}

After this you need to initialize it VortexInstance you can do it like this:

public class VortexInstance {
  private final TestConfig testConfig;

  public VortexInstance() {
    //...

    testConfig = new TestConfig(1, "String", 2D, 0.3f, false);
  }
}

In the ConfigSaver and ConfigLoader class you need to add following code:

ConfigSaver | saveConfig()

  config.setTestConfig(VortexInstance.getInstance().getTestConfig();

ConfigLoader | loadConfig()

  TestConfig testConfig = VortexInstance.getInstance().getTestConfig();
  testConfig.setTestInt(config.getTestConfig().getTestInt());
  testConfig.setTestString(config.getTestConfig().getTestString());
  testConfig.setTestDouble(config.getTestConfig().getTestDouble());
  testConfig.setTestFloat(config.getTestConfig().getTestFloat());
  testConfig.setTestBoolean(config.getTestConfig().getTestBoolean());

Now you've added your first config!

About

Vortex is a in java written template for complex java applications with mysql support and custom configs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages