Commit Graph

99 Commits

Author SHA1 Message Date
tastybento 1215a43766 Add feature to limit blueprint availability. 2024-03-31 17:29:18 -07:00
tastybento 12bf37d2c2
No tabs (#2243)
* Remove all tabs from source and replace with 4 spaces.
2023-12-04 20:55:40 -08:00
tastybento 63d092db93
Multi island api update (#2224)
* Fixes bug with island team joining and deletion. Include debug.

* Remove ambiguous API with mutli-island.

* Add back deprecated methods so developers can be wartned not to use them

* Added back in deprecated methods.

* Fix bugs and NPEs.

* Fix some code smells

* Remove debug logging.
2023-11-12 12:22:12 -08:00
tastybento a4bef159be
2 0 0 multi island (#2185)
* Multi world WIP - stashing

* Initial work on supporting multiple islands per player

The default allowed number is 5 for now, but will be set to 1 by
default.

Lots more work to do on this!

* More work on multi island. Fixed tests so clean compile.

* Remove unused imports

* Updated island go and homes command to multi island

Updated tests.

* Do not reload addons anymore.

* Add island name when entering or leaving own island

* Remove unused import

* Adds island names to /island go command.

* Enables more homes to be set if player has more than one island

* Switch to using a set for islands and explicit primary boolean in Island

* WIP

* Fix bugs with the go command.

* Be able to delete multiple islands, e.g. when joining a team

This is not fully tested.

* Do not remove all islands when a player does reset.

Players can reset just the island they are on.

* More fixes for go command

* Fix tests

* Fix @NonNull annotation

* Fix home syntax listing reference for IslandDeleteHome

* Fixed deletehome for multiple islands.

* Fix /island command teleport to current island default home.

* Remove deprecated code.

* Fix tag for concurrent island setting in config.yml

* Improve error when trying to make additional islands over limit

* Update config.yml

* Correctly assign invites for islands.

* Switch to canExecute API in prep for multi-island handling

* Prevent players from obtaining more concurrent islands by owner transfer

* Handle leaving and disbanding of teams

* Fix tests

* Fix minor bugs or code smells.

* Restore the quarantine code from deprecation.

This code can stay. It checks if islands can load, and if not puts them
in a trash. It does no harm.

* Remove unneeded eq()'s

* Fix tests
2023-09-16 15:55:52 -07:00
tastybento 08d73f232b Adds a config section in BentoBox to run commands when it is loaded
Commands are run as console.
2023-08-15 17:25:26 -07:00
BONNe 369001d368
Rework SQL database implementation. (#1993)
This change switches from plain JDBC driver implementation to a HikariCP Pool implementation.

Pool Implementation is complete for PostgreSQL and SQLite, while MariaDB and MySQL implementation still uses JDBC drivers, however with HikariCP pools.

Also, I added extra properties for SQL databases, where users could specify their own datasource properties.
2022-10-04 12:31:51 +03:00
BONNe 52bca66149 Add better config description for safe-spot-search-range. 2022-09-30 21:46:01 +03:00
BONNe 755aeb866e Rework player teleportation.
I reworked the classes and some teleportation operations. Now teleportation should find the closest available spot, instead of always being the highest block at original Y location. Part of #1994.
Also, I fixed an issue that portals stopped working if some conflicting options were enabled. Now portals will not work only if nether is disabled in config.
2022-09-30 01:26:31 +03:00
Huynh Tien ce1d8e5117
Rework the chunk deletion (#1897)
* delete island one by one

* register before IslandDeletionManager

* optimize imports

* setting

* just some indents

* config

* run synchronously

* a bit reformat before recoding

* proper delete chunks

* comment

* combine the task call

* expose the NMS Handler

* don't have to try-catch this

* we know that this is final

* expose copy chunk data so that it can be overridden

* Don't have to use Vector

* set block from minimum height

* remove NMS and use fallback if not set

* only get the height once

* fix test
2022-01-01 17:38:27 -08:00
Huynh Tien e3b99195ca
Optimize safe location searching with configurable range limit (#1892)
* better safe spot finder

* this should be better

* limit how far the y-coordinate will be expanded

* load chunks passively
2021-12-20 09:44:34 -08:00
tastybento 09bac48b5e Adjusted portal search radius to 64. 2021-04-25 09:35:45 -07:00
tastybento b1ab2ecece Corrected since reference, removed debug. 2021-04-24 09:02:47 -07:00
tastybento 33b49a2349 Set minimum portal search radius to 8. Added config option.
https://github.com/BentoBoxWorld/BentoBox/issues/1747
2021-04-24 08:45:05 -07:00
BONNe 79c3804603
Implements ability to use faster player head gatherer (relates to #1646). (#1679)
Adds 3 new BentoBox options:
- use-cache-server: option which allows to use mc-heads.net API for gathering player heads. It is a bit faster than Mojang API.
- heads-per-call: option which allows to specify how many heads will be requested at once per each API call.
- ticks-between-calls: option which allows to specify how many ticks should be waited until next API call.

All these options will allow much more faster player head gatherer.

Changes includes optimization for Mojang API too. For servers in online mode, HeadGetter will use Player UUID, instead of asking for UUID from API.
2021-02-16 15:57:04 -08:00
Gabriele C 232d9097cf
Limit island/player saves per tick (#1578)
* limit island/player saves per tick

* Whoops

* 20 players/islands per tick should be enough

20 players/islands * 20 tick * 60 seconds * 5 minutes (default interval) = 120000 saved entries :)
2020-11-27 10:12:10 -08:00
BONNe fa259611fe
Rework PlayerHead Getter. (#1446)
* Rework PlayerHead Getter.

Generate player head based on WebAPI (as it is faster) and GameProfile texture (require NMS).
Cache is suitable for storing into file format.
Add ability to add custom HeadCache object into local cache.
Add ability to modify cache keeping length.
Add ability to keep all, or just a single element into cache until server restart.

* Address issues/improvements suggested from review.

- config will store time in minutes.
- default value will be 1h.
2020-07-11 14:13:32 +02:00
tastybento bdbfd33a34
Fixed code smells (#1444)
* Code smell changes

* Fixes issues raised in reviews.
2020-07-09 09:03:01 +02:00
Florian CUNY f66fafd0aa Added config option to define the item to use to fill gaps in Panels
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1344
Addons should also use this setting as much as possible when dealing with Panels
2020-05-13 18:06:15 +02:00
Florian CUNY 321637b9b9 Added comment in config for close-on-click-outside 2020-05-13 17:46:32 +02:00
tastybento feab01cde8
Add ability for DataObjects to specify custom db table name (#1348)
Automated migration for existing databases is supported.
2020-05-13 10:49:42 +02:00
Clément P 6a28ba0b1d
Add support for MongoDB URI (#1330)
Implements #1311
2020-05-01 21:28:52 +02:00
Florian CUNY 91ccf51a54 Added option to keep old islands when resetting
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1188
2020-04-20 17:20:12 +02:00
tastybento 85d5a3a6ac
Adds a single character prefix to database tables (#1278)
* Adds a single character prefix to database tables

https://github.com/BentoBoxWorld/BentoBox/issues/1277

* Fix tests

* Fix bug with substring
2020-04-18 14:16:36 -07:00
Florian CUNY 3f3ea689e6 Improved useSSL config comment 2020-03-21 10:45:44 +01:00
Florian CUNY 9aa6122a83
Fixed 'useSSL' option path in Settings 2020-03-20 10:23:25 +01:00
NotMyFault 530a76b0a8
Improve bStats playersPerServer chart (#1225)
Updated bStats to 1.7.
Removed the "metrics" config option as it is now part of bStats's own `config.yml`.
2020-03-18 08:32:35 +01:00
BONNe f111bb9244
Implement option to enable SSL connection for MongoDB, MariaDB, MySQL and PostgreSQL connectors. (#1206) 2020-03-08 19:35:31 -07:00
Florian CUNY 64fbbf8815 Fixed typos in config comments 2020-01-25 09:37:29 +01:00
tastybento 5ab5954f47
Postgres implementation (#1142)
* WIP for https://github.com/BentoBoxWorld/BentoBox/issues/1093

* JSON based PostGresql

* Completes PostgreSQL suport

* Changed Postgres connector comments

* Put back rest of Postgres jdbc URL

* Update PostgreSQLDatabaseHandler.java
2020-01-23 07:56:30 -08:00
tastybento 6ac51453a0 Removed Postgres DB from config until it is implemented.
Put minimum version numbers into config for databases.
https://github.com/BentoBoxWorld/BentoBox/issues/1149
2020-01-21 13:29:51 -08:00
Florian CUNY 35ecd61a11 Reduced default paste speed to 64 blocks/tick
Should help mitigate issues such as https://github.com/BentoBoxWorld/BentoBox/issues/1051 for new servers.
2019-12-01 12:11:12 +01:00
tastybento 2f4dae52e4 Changes island deletion loop to per second.
Previous setting was per tick, and the lowest value of 1 was set in the
config. By changing to per second, this value can be increased if
required. In testing, I see that smaller servers cannot cope even with a
setting of 1 per tick so I made this change. Also, island deletion can
occur slowly without issue.
2019-11-16 09:55:16 -08:00
Florian CUNY ca6f344c70 Improved the configuration file introduction 2019-10-30 14:15:33 +01:00
tastybento 6f96f47ae5 Adds invites to trust and coop (#971)
Implements https://github.com/BentoBoxWorld/BentoBox/issues/800

* WIP

* Generic invites for team, coop and trusting.

Needs play testing.

https://github.com/BentoBoxWorld/BentoBox/issues/800

* Fixed tests and added handling in trust and coop commands

* Completes invite, trust and coops command and tests.

* Minor documentation/settings improvements

* Renamed InviteType to Invite.Type

* Fixed compilation error
2019-10-13 09:28:49 +02:00
Florian CUNY 835f152a45 Decreased default values for 'island.paste-speed' and 'island.delete-speed'
Also updated config comments.
These new values are more suitable to 1.14+ servers, on which chunk loading causes a lot of performance issues.
2019-09-08 15:35:00 +02:00
Florian CUNY 06893223d9 Added 'since' and improved comments for 'island.delete-speed' in config.yml 2019-09-08 15:12:50 +02:00
tastybento f9a5f05987 Adds a delete speed option to BentoBox's config.yml
Reduces the chunk regen speed to 1 chunk per tick or 3 chunks/tick if
there is a nether and end world.
2019-08-31 17:13:19 -07:00
Florian CUNY eea91b6269 Added 'island.name.uniqueness' in the config
Implements https://github.com/BentoBoxWorld/BentoBox/issues/899
Edited IslandsManager#nameExists(...) to strip colors.
2019-08-28 14:44:55 +02:00
Florian CUNY d41f35e58d Improved config comments for island name related settings 2019-08-28 13:45:38 +02:00
Florian CUNY 9dafeb1d19 Added "since 1.6.0" to Settings#clearRadius 2019-08-28 13:45:11 +02:00
tastybento e99f84f7c7 Prevents named mobs from being cleared on teleport.
Adds a setting in BentoBox config to set the clear radius.
Adds defensive code to avoid clearing mobs in non game worlds.

https://github.com/BentoBoxWorld/BentoBox/issues/847
https://github.com/BentoBoxWorld/BentoBox/issues/819
2019-07-18 21:58:16 -07:00
tastybento e284a6b57a Adds ability to require players to stand still for a command to execute
https://github.com/BentoBoxWorld/BentoBox/issues/837
2019-07-13 22:32:09 -07:00
tastybento 060c602009
Makes command ranks a protection setting (#823) 2019-07-08 20:02:58 -07:00
tastybento b1f66eb31b Fixes bugs and code smells from Sonarcloud. 2019-07-04 16:54:05 -07:00
Florian CUNY 00ac8dd12a Added PostgreSQL database type
https://github.com/BentoBoxWorld/BentoBox/issues/789
2019-07-04 13:49:20 +02:00
Florian CUNY 563465ad14 Increased the minimum time between connections to the GH API to 60 minutes 2019-06-30 08:56:38 +02:00
BONNe 94a884b425 Added more transition databases (#794)
Fixes #793

Add missing database transitions from YAML to MongoDB and SQLite.
Add missing database transitions from JSON to MongoDB and SQLite.
Add database transitions from SQLite to JSON.
Add database transitions from MongoDB to JSON.
Add database transitions from MariaDB to JSON.
2019-06-28 15:42:01 +02:00
Florian CUNY e7133b2176
Added SQLite database (#791)
* Added SQLite database
#570

* Makes SQLite work. Added config.yml option.

Tested on SQLite 3.24.0 2018-06-04 14:10:15
95fbac39baaab1c3a84fdfc82ccb7f42398b2e92f18a2a57bce1d4a713cbaapl

* Fix mariaDB test for close.

* Added test to MySQLDatabaseConnector and Handler
2019-06-28 08:33:43 +02:00
Florian CUNY f13fe4d225 Added a video to the "general.database.type" config option 2019-06-18 15:26:19 +02:00
Florian CUNY 284de9e288 Added config option 'logs.github-download-data' 2019-06-09 09:18:30 +02:00