Giter Club home page Giter Club logo

harvester's Introduction

Harvester Github Action Reliability Rating License sponge version

Harvester is a Sponge Minecraft plugin that restricts block break events for every non-creative players, according to the rules described in a configuration file. It handles block reappearance, so you can have a mining system with regenerating resources.

Installation

On a sponge server 1.12, download our latest release, and drop the file into your server's mods/ folder. Restart your server.
Default configuration files should be generated into your /config folder, and your server logs should include a line about Harvester being loaded.

Configuration file

Different configuration files exist to declare how Harvester should change block breaks and drop events.
They can be found in your config/harvester/ folder.

Global configuration

Global configuration is used for a few settings. It should be set within a global.conf file if you wish to override the default behavior.

  • You can set worlds where you want Harvester to be enabled within the global.conf. Please note that world name are case sensitive. (by default, every worlds will be taken into account)
  • You can also prevent block growth by setting the blockGrowth boolean to false. Useful if you don't want crops to grow (for instance if you use the crops different stage textures for multiple purpose). If equal to true or non specified, crops will grow normally.
worlds = ["worldName1","WorldName2"]
blockGrowth = true

Harvest regeneration

A file named harvestables.conf is required within the harvester config folder.
This file is going to describe which blocks can be broken, and when they will respawn.

The file uses HOCON format, and must begin with the array harvestables.
For each block that can be mined, you must specify some data :

  • The type field must contain the blocktype id (ex : minecraft:iron_ore)
  • respawnmin is the minimum amount of minutes before block respawn
  • respawnmax is the maximum amount of minutes before block respawn
  • (Optional) The state object can contain a list of BlockState to authorize only a given subtype of block to be mined (like log/stone variants)
harvestables = [
    {
        type: "minecraft:dirt",
        respawnmin: 2,
        respawnmax: 5
    },
    {
        type: "minecraft:stone",
        state {
            variant { value = "andesite" }
        },
        respawnmin: 5,
        respawnmax: 10
    }
]

Following the above example, dirt can be mined and will respawn between 2 and 5 minutes later. Only the andesite variant of stone can be broken, and it will respawn between 5 and 10 minutes later.

Harvest drops

The config file named drops.conf is used to define the items that will come out of the mined blocks.

The file also uses HOCON and contains two arrays :

  • The default array contains the resources that will use vanilla drops. By default, all vanilla drops won't happen.
    It can be used in addition to harvest_items if you'd like a resource to drop its normal loot plus something else.
  • The harvest_items array contains the data specifying which item we want to be dropped for a block
    • type is the name of the block affected
    • (Optional) The state object, if present, specify that only a subtype of a block is affected
    • (Optional) The item_name, when present, defines an item by its name
    • (Optional) The item_ref, when present, mean that the plugin will try to communicate with Itemizer plugin to retrieve a configured item identified by its id
    • (Optional) The pool_ref, when present, will fetch an item (or nothing) from an itempool from the plugin Itemizer
default = [
   	"minecraft:dirt",
   	"minecraft:stone"
]
harvest_items = [
   {
       type: "minecraft:stone",
       state {
           variant { value = "diorite" }
       },
       item_name: "minecraft:cobblestone",
       item_ref: 2,
       pool_ref: 1
   }
]

Following the above example, dirt and stone are going to drop their default drop, but diorite stone will drop a cobblestone block, the item number 2 of Itemizer, and an item from the first Itemizer pool, as well as its default drop (since diorite is a type of stone).

Commands and permissions

  • Granting a player with the harvester.block.breaking permission will allow him to break blocks normally, without being restricted by the plugin.
    People in creative mode can also break blocks normally.
  • The /harvester reload command will reloads configuration files without needing to restart the server.
    Permission: harvester.command.reload

harvester's People

Contributors

aaron1011 avatar hbeau avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

aaron1011

harvester's Issues

Handle multiple worlds

Instead of getting the default world labelled "world", get the corresponding world to enable harvester to work on multiple worlds.
We will probably have to add the world column in SQLite database.

Set H2 database timezone

The timezone is currently manually adjusted by adding 2 hours to the "date_diff" segment.
It would be better to set the timezone instead.

Extend the drop system to mob

Use the harvester drop system already in place for block to manage monster loot. I see several advantages to this choice (insted of use two systems with brawlator).

  • Monster and block drop are bind to the same event.
  • the code for each fonction is almost the same
  • drop management is in the responsability of harvester
  • easier to add new features

Modded block variants not harvestable

Hello,
I am having an issue with modded blocks with variants, specifically those from Conquest Reforged.
the items in question are Tin Ore and Bronze Ore
they share a name "conquest:stone_full_hard2" but they are variants of one another.

How would i set this up? I cannot even get them breakable at the moment.
within Itemizer i have added the line: "Tin" : "conquest:stone_full_hard2"
but that does not seem to function.

If it helps the NBT data of the two blocks are listed as variant 9 and variant 10

[REQUEST] Default drop plus defined drop

If part is defined in default and in harvest_items on break event drop both the default item and the defined harvest item

Example:

default = [
   	"minecraft:obsidian",
]
harvest_items = [
   {
       type: "minecraft:obsidian",
       item_name: "minecraft:cobblestone",
       item_ref: 2,
       pool_ref: 1
   }
]

would drop the default obsidian block, a cobblestone block, Item_ref 2 from Itemizer, and attempt to get an item from pool 1 of itemizer.

Allow multiple configuration files

Allow the use of multiple configuration files, basing the stuff that needs to be imported on JSON object keys (harvestables, default, harvest_items) and allow the files to be moved to harvester folder.

Bonemeal doing nothing. Grass not growing.

Grass is not growing and bonemeal does nothing on grass or saplings. Trees do not grow on their own neither wheat or other plants.

I tested if any other plugin does this, but as soon as i remove the harvester plugin everything is working again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.