Brewery

Brewery

101k Downloads

Automation and Hoppers

Sn0wStorm opened this issue ยท 3 comments

commented

Using Hoppers many steps of the Brewing process could be allowed to be automated.

The two biggest concerns with this are catching all possible cases of hopper move and the performance impact.

Implementing extended Hopper support could allow for:

  • Adding Items to Cauldron
  • (Removing Potions from Cauldron)
  • Adding items to Distiller and starting the process
  • Removing Brews from distiller when process stopped
  • Adding/Removing Brews from Barrels

Also maybe possible:

  • Redstone output from
    • Cauldron by cooking time
    • Distiller by distillcycles
    • Barrel by Ageing time

As the InventoryMoveItemEvent of Hoppers is called so often (many times per tick depending on the amount of hoppers), doing a lot of processing in this event can get very bad for the performance very quickly and is already a leading cause of lag for most Servers.

But if you would like to see this feature added, please comment or thumbs up so i know this is something to think about

commented

I think implementing hopper-distiller compatibility is doable without taking that much server resources. What would be needed to be done is something like this:

@EventHandler(ignoreCancelled = true)
void onInventoryMoveItem(InventoryMoveItemEvent event){
    if(event.getDestination().getType() != InventoryType.BREWING){
        return;
    }
    // Check if the transferred item is an potion
    // Do the same processing as is done when adding an item to the inventory by hand
}

I think I will open a pull request for this, as I wanted to make an autodestiller

commented

Very useful feature.
Lags can be fixed by good server optimization.
I wanted to ask you something else.
Can you add permission to all recipe?
For example, to brew whisky, player must have brew.recipe.whisky permission.
Can you add it?

commented

I'd like to see this added. A lot of people on a server I play on have been wanting automated brewing for a while.