Skip to content

BreweryTeam/TheBrewingProject

Repository files navigation

TheBrewingProject
Typing SVG

What if you could get drunk in Minecraft? Like, actually experience nausea, stumbling, puking, tunnel vision... heck, even memory loss? You're in luck! You can simply install this plugin and find out today! Experience what's listed above and much more with TheBrewingProject.

Check it out on our demo server, where you can easily brew and drink, with no setup required whatsoever: showcase.breweryteam.dev


Get the Plugin

You can download the latest release on Hangar and Modrinth.

Important

TheBrewingProject only works on PaperMC and its forks!


Commands and Permissions

Command Permission Description
/tbp reload brewery.command.reload Reloads the plugin.
/tbp info [slot] brewery.command.info Displays information about a given brew.
/tbp create --cook/--distill/--age/--mix brewery.command.create Create a new brew with the given arguments.
/tbp status info/set/clear/consume brewery.command.status Inspect or modify your drunkenness status.
/tbp event <event_name> brewery.command.event Simulate an event, such as stumble.
/tbp seal [slot]/all brewery.command.seal Seal the given brew(s).
Permission Description
brewery.structure.create Allows creating TBP structures such as a distillery.
brewery.structure.access Allows accessing and using structures from TBP.
brewery.distillery.create Allows creating new TBP distilleries.
brewery.distillery.access Allows accessing TBP distilleries.
brewery.barrel.create Allows creating TBP custom barrels.
brewery.barrel.access Allows accessing TBP custom barrels.
brewery.cauldron.access Allows brewing brews in cauldrons.

Developers

API

Important

Classes outside the API package may change without notice!

Importing the API

repositories {
    maven("https://repo.breweryteam.dev/")
}

dependencies {
    compileOnly("dev.jsinco.brewery:thebrewingproject-bukkit:<version>")
}

Note

You can find versions here

Simple use of the API, your plugin needs to be loaded after TBP.

public void onLoad() {
    RegisteredServiceProvider<TheBrewingProjectApi> tbpProvider = Bukkit.getServicesManager().getRegistration(TheBrewingProjectApi.class);
    if (tbpProvider != null) {
        TheBrewingProjectApi tbp = tbpProvider.getProvider();
        // Add your integration
        tbp.getIntegrationManager().register(IntegrationTypes.ITEM,
                new MyItemIntegration()
        );
    }
}

An item integration might look like this. Note that TBP needs to know when the integration has completed loading its items, as it directly validates the config values against these on startup.

import java.util.Optional;
import java.util.concurrent.CompletableFuture;

public class MyItemIntegration extends ItemIntegration {

    CompletableFuture<Void> initialized = new CompletableFuture<>();

    @Override
    public Optional<ItemStack> createItem(String id) {
        return Optional.ofNullable(MyPlugin.createItemWithIdOrNull(id));
    }

    @Override
    public boolean isIngredient(String id) {
        return MyPlugin.isItem(id);
    }

    @Nullable
    @Override
    public Component displayName(String id) {
        return MyPlugin.itemDisplayName(id);
    }

    @Nullable
    @Override
    public String getItemId(ItemStack itemStack) {
        return MyPlugin.itemId(itemStack);
    }

    @Override
    public CompletableFuture<Void> initialized() {
        return initialized;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }

    @Override
    public String getId() {
        return "my_plugin_name";
    }

    /**
     * Plugin has completed its initialization?
     * <p> 
     * Now you can initialize the item integration and TBP will validate against its items. You have to run this method
     * when the plugin is done.
     */
    public void initialize(){
        initialized.complete(null);
    }
}

Build

gradlew bukkit:shadowJar

About

A complete rewrite of BreweryX to add new features and expand upon the plugin.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors