Commit Graph

26 Commits

Author SHA1 Message Date
tastybento f6f4da1c89 Added placeholders for island names and member lists #2329 2024-04-04 12:59:20 -07:00
tastybento af843aeb35 Unregister coded. 2024-02-19 10:55:15 -08:00
tastybento 83479ac8a4 Added placeholders for team online member counts #2299 2024-02-18 14:36:42 -08:00
tastybento 0e0c502e1d
Team gui (#2251)
* WIP - add GUI for teams.

* WIP teams GUI

* Moe WIP on team GUI

* Modified file to avoid an NPE.

* Minor refactor to prevent int to Integer warning.

* Use latest dependencies for tests to pass.

* Move to singleton pattern for RanksManager,

* Team GUI WIP

* Added support for kick, setowner, and leave.

* Added support for accepting and rejecting an invite.

* Fixed bugs with text and operations.

* WIP for team invites.

* Adds inviting to the GUI.

* Fix tests

* Fixed minor bugs reported by SonarCloud

* Up Minecraft version and paper to 1.20.4 in POM

* Added features based on Discord feedback.

1. added some lore to the invite button to explain the players shown are
from the game world
2. removed the team state in chat
3. added a search to the invite panel

* Added back button.

Refactored some code and templates.

* Fixed bugs with teams and uncoop untrust etc of Ops.

* Return to name search GUI if name not found.

* Added return to GUI for player search

* Use Path.of
2024-01-08 20:50:26 +09:00
tastybento 8d3be9c0ff Added island member placeholders
Relates to #2180
2023-09-03 10:50:47 -07:00
tastybento 872940011a Loads of minor code smell fixes
Mostly replacing instanceof check and cast with e.g. 'instanceof Player
player'
Replaced some "switch" statements by "if" statements to increase
readability.
Used the primitive boolean check to avoid potential NPEs.
Reordered field modifiers to comply with the Java Language
Specification. Mainly @NonNull position.
2022-12-31 18:19:25 -08:00
tastybento 056cff4b6f
Code clean up from Sonar Cloud analysis (#2068)
* Code clean up from Sonar Cloud analysis

* Fix tests

* Remove code smell

* Rename "island" which hides the field declared at line 25.

* Removed code smells.

* Rename variable record to rec

Renamed "record" variable to not match a restricted identifier.
Restricted Identifiers should not be used as identifiers. "record" is
using in Java 16.

* Added private constructor to prevent instantiation of static class

Changed variable name to rec instead of restricted "record".

* Remove Blueprint code smells.

* Use a record for database settings constructor

Code smell: Methods should not have too many parameters. I'm not sure
what methods are using this class though.

* Update MyWorlds version

The POM for MyWorlds is invalid and causes a warning, but this still
persists with this version.

* Extracted nested try block into a separate method.

Makes it clear when reading the code what might be caught

* Extracted nested try block into a separate method.

* Fixed JavaDoc /** instead of just /*

* Extracted nested try block into a separate method.

* Refactored to not assign loop counter from within the loop body.

* Better delete option. With results.

That said, this is legacy code to handle an issue that occurred a long
time ago and this whole set of code can probably be removed.

* Catch Exceptions not Throwable

* Log error with BentoBox logError

* Use computeIfAbsent

Using these instead leads to cleaner and more readable code.

* User can no longer be null

* Added the missing @Deprecated annotation and @since ref

* Added @since reference

* Merge if statements

* Use BentoBox error logging.

* Added JavaDoc @since

* Remove deprecated class and move used class

* Remove deprecated WoodType and use Type.

* Remove unused import

* Extracted nested try block into a separate method.

* Comment empty default statement

* Clean up logic; avoid switch

* Use Java instead of Guava

* private constructor to hide the implicit public one.

* Private constructor to hide the implicit public one.

Merged if statement.

* Add comment

* if merge

* Make variable constant

* Remove unused imports

* Remove deprecated and unused method

* Remove unused import

* Typo

* Remove instanceof and cast

* Remove superfluous null check

* Put constant at bottom of file because @BONNe likes it there.

* Simplify particle validation code
2022-12-31 16:41:17 -08:00
tastybento 2629e940c7
2046 null player placeholder support (#2048)
* Fixes #2046. Handles null players for placeholders.

* Remove unused import
2022-11-13 08:49:22 +02:00
tastybento 9dc4ebc2d1
Make variables final if they can be. (#1843)
* Make variables final if they can be.

* Do not use final so that test can pass.

For testing, we use a trick to set this variable, but it won't work if
it is final. Right now, I'd like to keep the test.
2021-08-29 18:17:21 -07:00
tastybento 54bc554763 Code smell reduction 2020-09-12 16:55:54 -07:00
tastybento 2a3ac0bd3b
Handles placeholder reloading. (#1503)
https://github.com/BentoBoxWorld/BentoBox/issues/1502
2020-09-10 18:36:41 -07:00
Florian CUNY 962b7d734a Removed MVdWPlaceholderAPIHook and all related methods
It was increasingly causing issues, ranging from long start times, unreliability with some of our placeholders, to much more...
There's a way for MVdWPAPI users to get PAPI's placeholders, so they should definitely use that instead.
2020-04-04 15:38:29 +02:00
tastybento 60d7dfef85 Adds constructor to IslandResetCommand to allow no pasting
This is for games like SkyGrid that do not need pasting of a blueprint.
2019-08-30 10:16:05 -07:00
Florian CUNY 612683f728 Removed the legacy placeholder format for gamemode default placeholders 2019-08-17 13:27:13 +02:00
tastybento b1f66eb31b Fixes bugs and code smells from Sonarcloud. 2019-07-04 16:54:05 -07:00
Florian CUNY eebb2a982d Added MVdWPlaceholderAPI support and improved placeholders integration
#651
2019-05-31 10:56:03 +02:00
tastybento 338764e452 Fix code smell on placeholder replacement 2019-05-18 16:04:33 -07:00
Florian CUNY 3f83a89215 Added placeholders replacement in BentoBox's own messages
It is now possible to use external placeholders into BentoBox's messages.
2019-05-11 16:11:57 +02:00
Florian CUNY b0d4604c63 Renamed GameModePlaceholders to GameModePlaceholder
(enum names should be singular)
2019-04-11 10:47:25 +02:00
Florian CUNY 5dd7796be4 Deprecated GameModePlaceholderManager
GameModePlaceholderManager#registerGameModePlaceholders(...) is now handled by PlaceholdersManager#registerDefaultPlaceholders(...).
2019-04-07 20:59:21 +02:00
Florian CUNY 70749b0d16 Fixed another bunch of code smells 2019-03-24 15:51:45 +01:00
tastybento 2912ae18d2 Auto add default placeholders for GameModeAddons (#616)
https://github.com/BentoBoxWorld/BentoBox/issues/322
2019-03-24 15:30:58 +01:00
Florian CUNY c5dc7fcfad Added methods to unregister placeholders in PlaceholdersManager
#592
2019-03-03 16:29:46 +01:00
Florian CUNY 3f62e2f367 Slight optimization in PlaceholdersManager 2018-11-10 11:04:10 +01:00
Florian CUNY dcd8a4ea28 Added some javadoc in PlaceholdersManager 2018-11-02 15:44:36 +01:00
Florian CUNY 856dcb8b3d Added PlaceholderAPI support 🎉 2018-11-02 15:37:24 +01:00