Skip to content

Vanilla

Flow Arg edited this page Nov 17, 2022 · 2 revisions

VanillaVersion

In this tutorial, you will learn how to set up and use a vanilla version on FlowUpdater.

Introduction

You need to setup a Fabric, Forge or MCP version? So you need to build a VanillaVersion.

VanillaVersion is a buildable class only. Its builder is a static-class in VanillaVersion.

Refer you to the JavaDoc to see the utility of each parameter.

Example Usage

Build an VanillaVersion object as a classic builder. Then, just add an instance of your freshly built VanillaVersion object as a FlowUpdater's argument:

import fr.flowarg.flowupdater.FlowUpdater;
import fr.flowarg.flowupdater.versions.VanillaVersion;
import fr.flowarg.flowupdater.versions.VersionType;

import java.nio.file.Paths;

public class Main
{
    public static void update() throws Exception
    {
        VanillaVersion vanillaVersion = new VanillaVersion.VanillaVersionBuilder()
                .withName("1.19.2")
                .build();
        FlowUpdater flowUpdater = new FlowUpdater.FlowUpdaterBuilder()
                .withVanillaVersion(vanillaVersion)
                .build();
        flowUpdater.update(Paths.get("test")); // Paths.get can be replaced with Path.of starting of Java 11
    }
}

In this case, FlowUpdater will download/update Minecraft 1.19.2 vanilla version.

Note: If you replace "1.19.2" by "latest", FlowUpdater will download the latest release of the game. If you add .withSnapshot(true) in the VanillaVersionBuilder instance with "latest" as the version, FlowUpdater will download the latest snapshot of the game.

Clone this wiki locally