If some addon has code in Addon#allLoaded that crashes the call, then it did not disable addon as well as did not call allLoaded for every other addon that was left in the list.
This should be solved by adding an extra try-catch.
The kick command has an unnecessary owner check. As command should be configurable by island owners, then limiting it to an owner is wrong.
Add a code that allows kicking only lower-ranked players.
Add message that shows who kicked from the island.
Add message that shows that rank does not allow to kick.
* WIP - make easier to understand.
* Small refactor of paster to make it easier to understand
* Fix tabs to spaces. Sorry - new editor!
* Fix tabs to spaces
* Fix tab to spaces
There was no option to cancel teleportation if SafeSpotTeleport could not find a valid spot. This option could be used to avoid creating "backup" blocks in situations when teleportation is avoidable, f.e. visiting an island.
If a player is teleporting on the same island in the same dimension, it keeps spamming that PVP is enabled in dimension.
It should be enough with sending messages when the player teleports to the island.
Fixes#1885
There was an issue in PanelItemTemplate that prevented fallback buttons to be "reusable" things.
The issue was that reusable items were not passed to the panel item reader.
This change implements a new way how to define actions via a custom panel template.
Previously there were 2 options how to define an action:
- by click-type
- as an array list
This adds the third type: by action type. It means that now developers could code that action is the main key for defining what happens when button is clicked:
```
actions:
visit:
click-type: LEFT
tooltip: Tooltip text for left click action
```
#1932 implemented a feature that allows reading multiple panels from a single file, however, there was a missing builder in TemplatedPanelBuilder class that would allow to use it.
This fixes it and adds the missing builder method.
Add new Protection Flag: CHANGE_SETTINGS. This flag allows set which rank can change island settings. By default, it is set to OWNER rank and minimal value is MEMBER rank.
Fixes#1493
* Implement parameter adding to the templated panel title.
There was an issue when templated panels were always static, and api did not have a way how to change it. This will allow passing parameters to the tile, and allow adding dynamic texts.
* Implement parameter adding to the templated panel title.
There was an issue when templated panels were always static, and api did not have a way how to change it. This will allow passing parameters to the tile, and allow adding dynamic texts.
The existing template file reader could read a single configuration section from a file, and the section was required to start with the same name as the file.
This changes it and allows to read any configuration section from the panel.
This change is backward compatible and does not influence existing panels.
In discord, it was reported that running the admin delete command produces a null-pointer if `[player]` placeholder is used.
With fast checking I found out the issue: incorrect user was passed to the command.
Also, I moved runCommands below all resets, so commands could be used to give items, or xp or other stuff that is removed.
* Add CompositeCommand#defaultCommandRank variable.
This variable stores default rank for a command. This adds more flexibility to the Island#commandRanks object. This change allows specifying default rank for each command.
* Add more commands for users to configure on their islands.
Owners now can specify who can use:
- sethome command
- renamehome command
- deletehome command
- setname command
- resetname command
* Adds bonus range elements to Island object.
Admin commands still need to be adjusted or added to support management
of the bonus ranges.
* Changed to mutable class
Fixed bugs.
Some addons may want to introduce two different actions with the same click type.
This change will allow to do it, as now actions may be defined as lists instead of configuration sections.
To use it, action must be defined a bit differently:
```
actions:
- click-type: <value of enum ClickType> # required
type: <value of String> # not required
content: <value of String> # not required
tooltip: <value of String> # not required
- click-type: <value of enum ClickType> # required
type: <value of String> # not required
content: <value of String> # not required
tooltip: <value of String> # not required
```
Co-authored-by: tastybento <tastybento@users.noreply.github.com>
If create-and-link-portals is true, then teleporting to the nether will
not go to a central portal point and instead create a portal in the
nether at the same coordinates as the portal in the overworld.
Teleporting back will not be affected.
https://github.com/BentoBoxWorld/BSkyBlock/issues/464
I am not 100% sure if this would fix https://github.com/BentoBoxWorld/BSkyBlock/issues/451
However, searching google I found that others had a similar issue with the absolute path and they changed it to canonical.
As I was not able to reproduce the main reported issue, I do not know if this fixes it.
* add Block Explosion support for TNT_DAMAGE flag
* prevent block explosion from damaging entities
* seperated flags for block explode
* invert and cancel
* pattern instanceof
* 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
Since Minecraft 1.18 renamed and removed a lot of biomes, some addons that stored them in the database may require migration.
This Adapter will fix that as now BentoBox itself will do migration for all Biome.class objects.
* Update to Minecraft 1.18 (#1887)
* Make BlockEndDragon support custom max world height (#1888)
Use max world height instead of magic 255 value.
* Send PVP toggle messages only to on-island players.
https://github.com/BentoBoxWorld/BentoBox/issues/1885
* Add 1.18.1
Co-authored-by: BONNe <bonne@bonne.id.lv>
* Version 1.18.1
* Added snapshot repo to Maven info.
* Fixes console teleporting.
https://github.com/BentoBoxWorld/BentoBox/issues/1877
* Address potential NPE's
* Preveent NPEs and other items.
* Remove dead paper forks (#1884)
Tuinity has since merged with Paper, and is now not a valid fork
Airplane is shutting down / not updating to 1.18.x
* Added toString to resolve issue with arrays
* Fix minor JavaDoc mistake
Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com>
## Change Log
* Island range perms could be 2x island distance
This could allow protection ranges to be much greater than the island
range and therefore overflow into adjacent islands.
https://github.com/BentoBoxWorld/BentoBox/issues/1851
* Ensure maxEverProtectionRange is less than range.
https://github.com/BentoBoxWorld/BentoBox/issues/1851
* Added test class for Island.
* Added access to private fields for JUnit tests
* Added Sonar Properties to POM
* Changes to analyze using sonar.
* Remove zip reference
* Avoid zipSlip vulnerability.
* Removed the unused WorldEdit hook. (#1853)
If someone wants to add it back later they can, but this code does
nothing right now.
* Requires nonNull parameters for User.instanceOf (#1852)
* Requires nonNull parameters for User.instanceOf
The only reason why User.instanceOf was returning a potential null was
if the parameter was null. Further absolutely no null checking was being
done, so the assumption was that User.instanceOf should never return a
null. This corrects the annotations and requires non-Null parameters.
* Remove null player test
* Fix JavaDoc for GameModeAddon inWorld method
* Fix max-range bug
* Remove illegal tag as it's not needed
* Code smell reduction
* Add missing packages so tests can pass.
* Non null user methods (#1856)
* This makes some User methods non-null.
Instead of returning null, some methods will throw an error if they are
called on non-Players. This means code does not have to do null checks.
* Perform null check in method.
* Null check
* Fix test
* Fix test.
* Npe squashing (#1857)
* Fix hanging [uuid] in info.
* NPE checking
* Make getProtectionCenter nonNull
* More NPE fixes.
* Fix test
* Make getPlayer() and getOfflinePlayer() nonNull returns
This requires addons to not use null checks and instead us the isPlayer
or isOfflinePlayer methods.
* NPE blockers
* Deprecate CompositeCommand isPlayer method.
* Fix test
* Use isPlayer instead of null check.
Refactor code to be easier to understand.
* Fix
* Fix some code smells.
* Prevent NPE possibility.
* Fix "ugly" enchant name. (#1858)
Enchant names did not have a touch of Util#prettifyText code.
* Remove deprecated events.
* Fix IslandSethomeCommand test
* Fix tests - just counts of events.
* Added API to get a translation without color conversion
It may be necessary to read the translation without converting colors to
Bukkit colors.
* Fix tests.
* Fix test.
* Version NPE protections.
* 1.18.0 (#1860)
* Mark all home-related methods in PlayersManager as deprecated.
* Fix bug where maxHomes was shown as null
* Version 1.18.0
API changes may break compatibility with Addons.
* Remove usage of deprecated methods except for migration code.
* Prevent NPE. Check isPlayer instead of getWorld() == null
* Fix nullability issue and added to @Deprecated annotations
* Added deprecation notices to home methods in Players
* Fix missing color conversion for translations.
* Fix mis-statement of island protection coordinates in info command.
* Fix tests
* Fix missing edge deletion of island.
The bounding box was erroneously being made smaller when it was not
required because the inBounds check does that already.
https://github.com/BentoBoxWorld/BentoBox/issues/1863
* Prevent rare NPE
* Ensure oldIsland is never null.
* Refactored setowner command and added test class
* API: Require getWorldSettings to be a game mode world
* Fix tests and refactor code
* Fix test
IWM inWworld needs to return true
* Fix test
IWM inWorld must return true
* Put default getHandlers back in for backwards compatibility
Without them, too many older addons break. They need updating to have
their own handlers. Once that is done, the default ones can be removed
maybe.
* Refactor code for clarity.
* NPE protections
* Prevent NPE
@Poslovich - you were right!
* Throw an error if player is null
* Prevent NPE
* Prevent NPE
* Do a null check
* World should never be null.
* Require non-null world
* Require owner to be non-null. It should never be null
* Prevent NPEs
* Clear the going home flag for edge cases
There were a few potential times when the flag may not have been
cleared. These were mostly teleport failure scenarios. Hopefully, this
is all of them.
https://github.com/BentoBoxWorld/BentoBox/issues/1864
* Shift priority of EntityPortalEnterEvent to HIGH
https://github.com/BentoBoxWorld/BentoBox/issues/1866
This will allow other plugins running at NORMAL to cancel the event
before BentoBox does something.
* Increase priority of EntityPortalEvent listener
https://github.com/BentoBoxWorld/BentoBox/issues/1866
* Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1868
* Code refactoring around User.getInstance(player)
Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com>
Co-authored-by: Justin <jstnf@users.noreply.github.com>
Co-authored-by: gecko10000 <60494179+levtey@users.noreply.github.com>