Skip to content

Commit

Permalink
Release 2.0.0 (#59)
Browse files Browse the repository at this point in the history
* Add ignoreCancelled to BlockFromToEvent to avoid issues when addon allows to place water where it should not be.

* Fix issue when water stop flowing, if cobblestone generation is triggered by water flow (#24)

* Add generation sound effect and particles (#23)

* Add Spanish translation (#25)

* Update config.yml to include info on decimals and total chance values per tier (#22)

* Update config.yml to include info on decimals and max chance values

Update config.yml to include info on decimals for chances and max chance values for tiers.

* Translate es.yml via GitLocalize

* Translate es.yml via GitLocalize

* Remove unnecessary templates un translation files.
Update dependencies in pom.

* Remove bug reported by SonarCloud.

* Fixes a few code smells.

* Added MainGeneratorListener test class.

* Adds support for decimal block chances

#27
#21

* Don't use physics on new generated blocks.

* Fixes code smells and duplications

* Fixes gamemode setting bug introduced by refactoring.

#29

* Added StoneGeneratorAddon test class

* Updated travis.yml

* Fixed code smells in tests.

* Gitignore

* Seeding was preventing randomness within same millisecond

#31

* Version up 1.9.0

* Changed build numbers to use 'b' instead of '#'

* Update to use BentoBox 1.9.2 API

* Fixed indentation and made minor improvements in the main class

* Added %MagicCobblestoneGenerator_[gamemode]_island_generator_tier% placeholder
Implements #30

* Fixed and improved tests

* Improved en-US

* Fixed code smell

* Added "MAGIC_COBBLESTONE_GENERATOR" flag (SETTING)
Implemented #11

* Fixed tests

* Translate de.yml via GitLocalize (#32)

Co-authored-by: xXjojojXx <36734820+xXjojojXx@users.noreply.github.com>

* Czech translation. Credit @Polda18

* make use of physics configurable (#34)

* Generator range option (#38)

* Added a setting that allows the generator to only work if there is a member of the island in x range. This can be disabled by setting it the range in the config to 0 or any lower value.

* Made a couple of improvements based on feedback.

* Fixes tests and adds new tests for MainGeneratorListener

* Optimized isInRangeToGenerate method

* Fix grass block (#40)

* Version 1.9.1

* Handles cobble generation via other means

#47

* Fixes tests

* Fixes #48

* Update to BentoBox 1.14.0-SNAPSHOT

* Reformat code with better reading format.

* Removed alpha stage text

* Improved explanation

* Do some more cleanUps.

Add better placeholders that follows `[gamemode]_[addon]_[placeholder]`

* Create fr.yml (#45)

* Update to spigot 1.16.1

* Rework addon in progress.

- Split Vanilla and Magic generator listeners in 2 classes.
Vanilla generator replaces block in the next tick, while Magic Generator will work with custom implementation.

- Add 3 types of generators: cobblestone, stone and basalt in MagicGenerator class. Remove one general method, as it is time to split them appart.
- Use vanilla generator listener for now only, as other is not finished.

* Change vanilla generator listener priority to monitor, as it does not cancels it, and should always be processed at the end.

* MagicCobblestone Generator 2.0.0 (#53)

* Create GeneratorTierObject

This object will contain all information for each generator tier.

* Add Getters and Setters for all variables.

* Add Database processing for generator tiers.

* Add description to the generator tier object.

* Add gameMode nether and end worlds only if island type are enabled.

* Implement GeneratorDataObject that stores data per island.

Allows to switch active generators.

* Add MaxTreasureAmount variable in GeneratorTierObject.

* Add ability to define generator tier as default generator.

* Split active generator into 3 different objects for cobblestone, stone and basalt.

* Replace separate active generators with a single set.

* Implement priority setting in generator tier object.

* Rework StoneGeneratorManager.

Add new data object loading and saving.
Create method that returns generator tier for given location and given generator type.
Create method that finds default generator tier for given world and given type.

Remove all commands, as they need complete rework.

* Remove main command and placeholders.
Must be reworked.

* Add Reload method.

* Rework settings file.
Remove generators from settings file. Will be implemented in separate file.

* Rework MagicGenerator class.
Use new methods and abilities.

* Create template file for generators.

* Move manager to separate package.

* Change from required-biome to required-biomes :)

* Add small protection against negative values

* Add method that can clear all generators for certain gamemode.

* Add generator file readed.

* Implement activation-cost variable.
This allows to define price for activating generator.
Rename upgrade-cost to more proper purchase-cost.

Add messages about Level addon and Upgrades addon requirements.

* Rename method from getManager to getAddonManager.

* Add method that allows to find all generators in given world.
Fix failing test.

* Start to create GeneratorUserPanel

* Add general Utils class.

* Implement ability to find out purchased generator tiers, purchased count of active generators and store working range in generator data object.

* Add generator data object validation, which populates unlocked generators and sets value for active generator count and working range.

* Add MAGIC_COBBLESTONE_GENERATOR_PERMISSION flag, that allows island owner change who can activate generators.

* Add VaultHook and UpgradesAddon getters and checks.

* Finish GeneratorUserPanel

Current implementation have some basic functionality for activating and deactivating generators.

* Implement Player command that opens gui.
Implement Admin command that allows to import generators.

Add ability to load generator tiers into gamemode, if it does not have it.

* Add missing need-restart message for some config options.

* Fixes missing flag method error.

* Add AOneBlock and Upgrades to softDepend list.

* Implement ability to create nested GUI's.

Create method that generates generator description based on input variables.

* Add world as parameter for constructor.

* Change visibility to build method.

* Rename button to Action.

* Create template for GeneratorViewPanel.

* Fix issue when generatorTier icon get broken over time.

* Continue to implement GeneratorViewPanel.

* Add material and treasure list to GeneratorViewPanel

* Add rightClick option to view Generator tier properties.

* Add View player command that opens Generator Tier view panel from command.

* Implement Data loading on player joining the server.

* Add proper generator data creation and removing on island creation and deleting.

* Add generator that operates only in the nether.

* Fix some issues in generatorTemplate

* Update default config file.

* Update permission list in addon.yml.

* Fix logging message.

* Create Constants file that contains most of used strings in guis an messages.
Update and fix locale usage in whole addon.

* Fixes locales file.

* A lot of small debug fixes.

- Init maps with collections that can be populated.
- Use TreeMap instead of simple Map, as it would avoid any casting.
- Add nonNull filter while getting existing islands in worlds.
- Prevent generator description to add text to it when user opens GUI.

* Fix an issue when activeFilterButton cause null-pointer when opening gui.

* Create 'generator why' command that will allow easier debugging.
Add a separate Why class that will manage reporting.

* Fix generator descriptions in template.

* Add GeneratorTierAdapter that will manage storing generator tier sets into database.
Change string sets to object sets in GeneratorDataObject.

Fix some other small bugs related to object saving and loading.

* Implement ability to purchase generator tiers from GeneratorViewPanel.

* Add 1.15.2 compatibility.

Note: Basalt generators will not work.

* Use jetbrains annotations instead of istack internal.

* Fixes tests.

Supports database storage and new onEnable messages

* Fixes permission checking bug.

#54

* Update `default-active-generators` comment.

* Fixes #55

* Update to BentoBox 1.14.0

* Return snapshot version.
Misunderstand the announcement message.

* Removed reference to Likes in config.yml

* Fix issue when generator were not imported into memory

* Fix issue when generators did not work.

The issue was that I changed how active generators are stored. Instead of storing generatorId in island data, I am now storing generatoTierObjects, to avoid mapping and make if faster.
However If forgot to change it there.

* Fix issue when users were not able to import basalt generator. (#57)

* Fix an issue when displayed chance number was not relevant to player.
Implement ability to specify number for chance with calculated value and 1-5 digits after comma.

Fixes #57 and #43

* Fixes #56

Use island delete event instead of deleted.

* Add placeholders for generator:

- `[gamemode]_magiccobblestonegenerator_active_generator_count` - returns number of currently active generators on player island.
- `[gamemode]_magiccobblestonegenerator_max_active_generator_count` - returns number of maximal allowed active generators at the same time.

- `[gamemode]_magiccobblestonegenerator_active_generator_names` - returns list of active generator names separated with `,`/
- `[gamemode]_magiccobblestonegenerator_unlocked_generator_names` - returns list of unlocked generator names separated with `,`/
- `[gamemode]_magiccobblestonegenerator_purchased_generator_names` - returns list of purchased generator names separated with `,`/

* Preprare release (#58)

* Add toUppercase for material reading from template file.

* Prepare release

Co-authored-by: gitlocalize-app[bot] <55277160+gitlocalize-app[bot]@users.noreply.github.com>
Co-authored-by: tastybento <tastybento@wasteofplastic.com>
Co-authored-by: Florian CUNY <poslovitch@gmail.com>
Co-authored-by: xXjojojXx <36734820+xXjojojXx@users.noreply.github.com>
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
Co-authored-by: mindw0rm <mindw0rm@web.de>
Co-authored-by: ChimpGamer <Tim.Cremers@Ziggo.nl>
Co-authored-by: András Marczinkó <andris155@users.noreply.github.com>
Co-authored-by: Pierre LAGOUTTE <pierre.lagoutte@free.fr>
  • Loading branch information
10 people committed Jul 9, 2020
1 parent d2cf3ad commit a774d8e
Show file tree
Hide file tree
Showing 37 changed files with 7,611 additions and 1,758 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ hs_err_pid*
/.settings/
/.classpath
/.project
/dependency-reduced-pom.xml
/.DS_Store
/MagicCobblestoneGenerator.iml
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ sudo: false
addons:
sonarcloud:
organization: "bentobox-world"
token:
secure: $SONAR_TOKEN

jdk:
- openjdk8
- openjdk11
Expand Down
120 changes: 108 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,138 @@
[![Discord](https://img.shields.io/discord/272499714048524288.svg?logo=discord)](https://discord.bentobox.world)
[![Build Status](https://ci.codemc.org/buildStatus/icon?job=BentoBoxWorld/MagicCobblestoneGenerator)](https://ci.codemc.org/job/BentoBoxWorld/job/MagicCobblestoneGenerator/)

Add-on for BentoBox to provide ability to generate any blocks in cobblestone generators for any BentoBox GameMode.
Add-on for BentoBox to provide ability to generate additional block types in cobblestone generators for any BentoBox GameMode. For example, have diamond ore generated, or iron ore. It's magic!

## Where to find

Currently Magic Cobblestone Generator Addon is in **Alpha stage**, so it may or may not contain bugs... a lot of bugs. Also it means, that some features are not working or implemented.
You can download it from [Release tab](https://github.com/BentoBoxWorld/MagicCobblestoneGenerator/releases)

Or you can try **nightly builds** where you can check and test new features that will be implemented in next release from [Jenkins Server](https://ci.codemc.org/job/BentoBoxWorld/job/MagicCobblestoneGenerator/lastStableBuild/).

If you like this addon but something is missing or is not working as you want, you can always submit an [Issue request](https://github.com/BentoBoxWorld/MagicCobblestoneGenerator/issues) or get a support in Discord [BentoBox ![icon](https://avatars2.githubusercontent.com/u/41555324?s=15&v=4)](https://discord.bentobox.world)

## What to expect

Magic Cobblestone Generator is changed a lot since it first creation, and since Minecraft 1.16, it now operates with all 3 lava based block generations:
- Classic cobblestone generation
- Stone generation
- New basalt generation

Addon also do not work in static progression based on island level. Now it allows users to toggle which generator they want to activate.

Server owner can specify different block generation for each generator, as well as set up small chance to generate treasure on block generation.

Generators can also be limited by a biome and permissions, as well as old island level.

Monetary system is implemented and now users can purchase generators. Server owners can also enable payment cost for activating each generator.

## How to use

1. Place the addon jar in the addons folder of the BentoBox plugin
2. Restart the server
3. The addon will create a data folder and inside the folder will be a config.yml that contains all information.
3. The addon will create a data folder and inside the folder will be a config.yml and generatorTemplate.yml
4. Edit the config.yml how you want.
5. Restart the server

To change generators, you can simply edit generatorTemplate.yml at any point. However, to apply changes for GameMode addon, you need to write `/[gamemode_admin_command] generator import`.

Magic Cobblestone Generator does not limit how many generators are active. You can activate multiple generators at the same time, but only best suitable for given location will be used.
Users have a nice GUI that allows interacting with generators by executing command: `/[gamemode_user_command] generator`.
By right clicking on GUI element, users can see detailed information about each generator. However, the same view can be accessed with `/[gamemode_user_command] generator view <generator>` command.

There are 2 new permissions that could be useful to customize experience:
- `[gamemode].stone-generator.active-generators.[NUMBER]` - permission for island owner that allows increasing active generator number.
- `[gamemode].stone-generator.max-range.[NUMBER]` - permission for island owner that allows increasing range in which generator will work. Be aware, it must be enabled in the config.

## Compatibility

- [x] BentoBox - 1.5.0 version
- [x] BSkyBlock - 1.5.0 version
- [x] AcidIsland - 1.5.0 version
- [x] SkyGrid - 1.5.0 version
- [x] CaveBlock - 1.5.0 version
- [x] BentoBox - 1.14 version

## Config.yml

The config.yml has the following sections:

* **Offline Generation** - ability to disable addon processing on islands where none of members are online.
* **Disabled GameModes** - specify Game Modes where challenges will not work.
* **Generator Tiers** - ability to specify default generator tiers
* **GameMode Tiers** - ability to specify generator tiers for specific game mode.
* **Physic Usage** - ability to specify if block generation should use game physic. Disabling will allow floating gravel, however some redstone machines may stop working.
* **Working Range** - specify working range for the generator to work. If players are not in the given range, then generator will not work.
* **Active Generator Count** - specify how many generators users can activate at the same time.

## generatorTemplate.yml

This is just a template that shows how each generator is set up.
Only generator ID must be specified. Other parts can be skipped.
```
# Unique Id for generator. Used in internal storage and accessing to each generator data.
generator_unique_id:
# Display name for users. Supports colour codes.
# Default value: generator_unique_id without _
name: "Something fancy"
# Description in lore message. Supports colour codes.
# Can be defined empty by replacing eveything with [].
# Default value: []
description: -|
First Line Of lore Message
&2Second Line Of lore Message
# Icon used in GUI's. Number at the end allows to specify stack size for item.
# Default value: Paper.
icon: "PAPER:1"
# Generator type: COBBLESTONE, STONE or BASALT. Self explanatory.
# Default value: COBBLESTONE
type: COBBLESTONE
# Indicates if genertor is default generator. Default generators ignores requirement section.
# It is activated for each new island. Can be only one per each generator type.
# Default value: false
default: false
# Users selects active generators.
# Priority indicates which generator will be used
# if multiple of them fulfills requirements.
# Default value: 1
priority: 1
# There are several requirements that can be defined here.
requirements:
# Can define minimal island level for generator to work. Required Level Addon.
# Default value: 0
island-level: 10
# List of required permissions for users to select this generator.
# Default value: []
required-permissions: []
# List of required biomes for generator to work.
# Empty means that there is no limitation in which biome generator works.
# Default value: [].
required-biomes: []
# Cost for purchasing this generator. Requires Vault and any economy plugin.
# Currently implemented by clicking on purchase icon in generator view GUI.
# Default value: 0
purchase-cost: 5.0
# Cost for activating current generator tier. Requires Vault and any economy plugin.
# Will be payed only on active switching between generators.
# Default value: 0.
activation-cost: 0.0
# Materials and their chances. Use actual blocks please.
# Chance supports any positive number, including double value.
# Everything in the end will be normalized.
# Default value: []
blocks:
FIRST_BLOCK_NAME_ID: NUMBER
SECOND_BLOCK_NAME_ID: NUMBER
# Treasure that has a chance to be dropped when block is generated.
# ONLY on generation, not on block break.
# Default value: []
treasure:
# Chance from 0 till 1. 0 - will not be possible to get a treasure.
# Default value: 0
chance: 0.001
# Materials that can be dropped. Applies to the same rules as block section.
# Default value: []
material:
FIRST_BLOCK_NAME_ID: NUMBER
SECOND_BLOCK_NAME_ID: NUMBER
# Maximal amount of items dropped.
# It will be from 1 till defined amount.
# Default value: 1
amount: 1
```

## Information

More information can be found in [Wiki Pages](https://github.com/BentoBoxWorld/MagicCobblestoneGenerator/wiki).
More information can be found in [Wiki Pages](https://docs.bentobox.world/addons/MagicCobblestoneGenerator/).
32 changes: 20 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<powermock.version>1.7.4</powermock.version>
<powermock.version>2.0.2</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.14.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.7.0</bentobox.version>
<level.version>1.6.0</level.version>
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.14.0</bentobox.version>
<level.version>2.3.0-SNAPSHOT</level.version>
<upgrades.version>0.2.0-SNAPSHOT</upgrades.version>
<vault.version>68f14ec</vault.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>1.7.0.2</build.version>
<build.version>2.0.0</build.version>
<build.number>-LOCAL</build.number>
</properties>

Expand All @@ -56,7 +57,7 @@
</activation>
<properties>
<!-- Override only if necessary -->
<build.number>-#${env.BUILD_NUMBER}</build.number>
<build.number>-b${env.BUILD_NUMBER}</build.number>
<!-- GIT_BRANCH -->
</properties>
</profile>
Expand Down Expand Up @@ -143,10 +144,11 @@
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<!-- Mockito (Unit testing) -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -157,7 +159,7 @@
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
Expand All @@ -173,16 +175,22 @@
<version>${level.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>upgrades</artifactId>
<version>${upgrades.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>${vault.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.2.1-SNAPSHOT</version>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>18.0.0</version>
</dependency>
</dependencies>

Expand Down

0 comments on commit a774d8e

Please sign in to comment.