Commit Graph

2823 Commits

Author SHA1 Message Date
BONNe
bf87cca754 Implement proper entity teleportation between dimension.
Teleportation via portals for entities was in a mixed state. It was not fully implemented and not fully prevented. Especially when portal linking was enabled.

Now I implemented world settings flag: ENTITY_PORTAL_TELEPORT.
Enabling this flag will allow entities to use portals to switch dimensions.

Fixes #2023 and #966
2022-09-30 21:33:17 +03:00
BONNe
682d835961 Add all dimension checks for methods. 2022-09-30 14:34:28 +03:00
BONNe
4458d16274 Fixes incorrect condition for missing island check. 2022-09-30 14:34:12 +03:00
BONNe
d197ce8bea Add class description. 2022-09-30 02:34:46 +03:00
BONNe
aa7abe02bf Teleport island-less player to the spawn if he exits nether 2022-09-30 02:33:07 +03:00
BONNe
97c4cf883f Implement proper end exit portal handling.
When players will exit the end-gate, they will be teleported to proper island, instead of world spawn point.

The only way how players can be teleported to the spawn is if they do not have islands.
2022-09-30 02:25:44 +03:00
BONNe
eb5147e710 Change to direct PlayerTeleportListener#portalProcess method call. 2022-09-30 01:31:05 +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
BONNe
173808b787
Adds glow berries protection. (#2027)
Uuups... someone forgot to add them.

Fixes #2020
2022-09-29 18:58:53 +03:00
BONNe
35ce1a7d81
Rework blueprint and blueprint bundle names. (#2026)
* Fixes issue when blueprint clipboard was stuck after saving.

The issue was that Map#putIfAbsent still creates a new task, even if object is already in map. The usage requires to use Map#computeIfAbsent.

* Rework blueprint and blueprint bundle names.

There was an issue with using non-english characters in blueprint names. It was not possible, as all chars for names were converted to lower cased english letters. It included display names.

I reworked it a bit and now it should be possible to set non-english names for bundles and blueprints.

Fixes #1954
2022-09-29 18:44:07 +03:00
Huynh Tien
12926f9ee7
setBlock & setEntity as CompletableFuture (#2019)
* setBlock & setEntity as CompletableFuture

* use collectingAndThen toArray
2022-09-05 09:28:16 +03:00
BONNe
c7b48b3d2a
Update Spigot 1.19.2. (#2017)
Add 1.19.2 compatibility.
2022-08-26 12:17:19 +03:00
BONNe
6f791420e7
Proper dimension processing (#2015)
* Adds ProtectionBoundingBox for environment

Since minecraft introduced different island heights for different dimensions, protection bounding box were returned wrong area for nether and end dimensions.
This change adds a new method that allows to get proper protection bounding box for requested dimension.
Due to the fact, that nether and end islands can be disabled, then this method may return null.

Fixes #2014

* Adds BoundingBox for environment

Since minecraft introduced different island heights for different dimensions, bounding box were returned wrong area for nether and end dimensions.
This change adds a new method that allows to get proper bounding box for requested dimension.
Due to the fact, that nether and end islands can be disabled, then this method may return null.

Part of #2014

* Fixes Island#onIsland check for non-island worlds

Island#onIsland method was missing checks if island mode is enabled for requested dimension. It returned false positive situations in cases when island generation were disabled in nether or the end worlds.

* Fixes Island#inIslandSpace check for non-island worlds

Island#inIslandSpace method was missing checks if island mode is enabled for requested dimension. It returned false positive situations in cases when island generation were disabled in nether or the end worlds.

* Adds some helper methods in Island object.

- Island#getNetherWorld - returns the nether world or null
- Island#getEndWorld - returns the end world or null
- Island#getWorld(Environment) - returns world of requested environment or null
- Island#isNetherIslandEnabled - returns if nether is generated and nether islands are enabled.
- Island#isEndIslandEnabled - returns if end is generated and end islands are enabled.
2022-08-26 11:32:03 +03:00
BONNe
6c1399c2b4
Fixes wrong admin permission.
Default Amin command should have `admin` instead of admin.*
2022-08-14 20:12:15 +03:00
BONNe
44201afa1f Fixes an issue with missing parent permission check before command execution.
Implement a new method that recursively checks if player has access permission to all commands in whole hierarchy.

Fixes #2010
2022-08-03 19:00:42 +03:00
BONNe
64b4c43742 Revert 6e734fc343
The commit was wrong. Protection range should not be decreased, as that would mean that max X and Z blocks are not included in island protection bounding box.
This change is the same as 3c65194dfb but was missed when it was fixed.

Relate to #473
2022-07-25 00:16:16 +03:00
BONNe
a59697c14e Fixes particle spawning for older API usage.
Border addon used still older BentoBox API. This change fixes it, and fixes API compatibility with older addons/plugins.
2022-07-14 11:29:46 +03:00
BONNe
5a527d4119 Add parent for admin team's commands.
This is a parity change with player command.
2022-07-13 12:35:20 +03:00
BONNe
927fcba15a Disables biome copying by default in blueprints.
Biome will be copied only if it is required by copy command parameter.

Fixes #1862
2022-07-07 00:08:15 +03:00
BONNe
9ec8730359 Prevents liquids from being placed from dispenser outside island area.
Fixes #1869
2022-07-06 23:55:17 +03:00
BONNe
9643f617b6 Implement a command that allows to reset island name.
Fixes #1879
2022-07-06 23:30:51 +03:00
BONNe
3784aa48d7 Disables podzol and coarse dirt from becoming path.
This protection reuses Flags.COARSE_DIRT_TILLING.

Fixes #1878
2022-07-06 23:00:20 +03:00
BONNe
2f244c0606 Fixes an issue when portals did not operate under 0.
Fixes #1977
2022-07-06 22:12:47 +03:00
BONNe
f969f2721f Disable DynmapHook as it is not implemented.
Fixes #1995
2022-07-06 20:39:15 +03:00
Galić Mijo
cbd063c9e8
Check if unique name contains chars not supported in regex expression (#1998)
* Check if unique name contains chars not supported in regex expression
Cannot start, contain, or end with special char, cannot contain any numbers.
Can only contain - for word separation

* Negation fix
2022-07-06 20:21:36 +03:00
BONNe
db323390cf
Implements adding unknown default island flag values in settings. (#2001)
* Implements option to define non-existing flags in WorldSettings.

This change adds 2 new methods in WorldSettings:
* WorldSettings#getDefaultIslandFlagNames
* WorldSettings#getDefaultIslandSettingNames

These methods replace getDefaultIslandFlags and getDefaultIslandSettings methods.
Default implementation just reads values from replaced methods.

Fixes #1830

* Implement conversion from flag id to actual flag object.

Replaces flag assignment to new island based on flag id's.

Fixes #1830

* Switch from Flag object to String object in Island class.

This switch allows to keep flags that are not present in current BentoBox installation. Otherwise, unknown flags may cause an issues.

Fixes #1830

* Implement FlagBooleanSerializer.

This serializer converts input map of String, Boolean to map of String, Integer.

This map is used to read island setting flags, and integer value is not classic boolean values. (0 for true and -1 for false).

Fixes #1830
2022-07-06 20:20:08 +03:00
BONNe
d8fa029ac9
Fixes an issue where Blueprint Pasting did not send or include nether and the end blueprints times. (#1979) 2022-06-16 22:44:38 +03:00
BONNe
c54358441d
Raid abuse fix (#1991)
* Implements new VISITOR_TRIGGER_RAID flag.

This world settings flag allows toggling if visitors can or cannot start a raid on an island they are visiting.

Relates to #1976

* Fixes abuse of Raid Mechanism and Mob Natural Spawn Rules.

Fixes to #1976

* Simplify raid abuse detection.
2022-06-14 02:42:48 +03:00
BONNe
e41f5ac24f
Fixes a bug that prevented mobs to attack
Commit 85b52f4b introduced a bug that prevented entities to target any island member. This should fix it.
2022-06-14 02:33:35 +03:00
BONNe
d984955af3 Fixes Range Display command crashes.
Spigot in 1.18 introduce new way how block particles should be displayed. However, BentoBox never fully implemented it.
To avoid such issues in-future, I added checks for each particle type that requires extra data object.

Fixes #1989
2022-06-14 01:18:52 +03:00
BONNe
85b52f4bfb
Implement new 1.19 materials and entities (#1990)
* Update to Spigot and Paper API 1.19 and Java 17

* Set minimal version to 1.18.

* Add breeding protection for Axolotl and Goats (1.18)
Add breeding protection for Frog and Allay (1.19)

* Clean up switch statement in BlockInteractionListener

* Add chest boat support to BreakBlocksListener.

Part of #1987

* Add powdered snow pickup with bucket protection.

* Add glow ink sac protection on signs.
Switch to SheepDyeWoolEvent as it now contains player variable.

* Clean up Hurting Listener

* Mark 1.16.5, 1.17 and 1.17.1 as incompatible.
Mark 1.18, 1.18.1 and 1.18.2 as supported.

Add 1.19 as compatible.
Part of 1987

* Add ChestBoat inventory protection.
Part of #1987

* Clean up LockAndBanListener

* Add MANGROVE_PRESSURE_PLATE protection.
Part of #1987

* Add Glow Item Frame protection to player interact event.

* Clean up MobSpawnListener

* Clean up ChestDamageListener

* Change from custom method to Tag.PRESSURE_PLATES to detect pressure plates.
Part of #1987

* Implement proper chest boat protection.
Part of #1987

* Move to 1.19 R1 world regenerator.
Part of #1987

* Add allay to the animal entity list.
Part of #1987

* Add axolotl and other fish scooping protection.
Part of #1987

* Fixes Bucket and Glass Bottle filling.

Buckets and bottles were not working since cauldron splitting by type. This change fixes that.

It also protects from filling bottles with water from water sources or waterlogged blocks.

* Remove 1.17.1 compatibility check for biome adapter.
Add cheezee 1.19.1 compatibility version.

* Fixes chest boat interactions.

Part of #1987

* Implement Allay protection.
New flag ALLAY is required to interact with allays.

Part of #1987

* Prevent visitors for being targeted by entities if ENTITY_ATTACK is enabled.

* Implement Sculk Sensor and Shrieker activation protection setting.

Part of #1987

* Add music discs to the LangUtilsHook
Part of #1987

* Fixes failing unit-tests.
2022-06-14 00:38:53 +03:00
BONNe
6f2a9929c0
Fixes Glowing Item frames protection (#1985)
* Fixes glowing item frame protection.
Glowing item frames were not protected.

Fixes #475

* Fixes check-style.
2022-06-05 21:52:37 +03:00
BONNe
345b9e2564
Fixes an incorrect <Material>:CMD-<number> parsing
The issue was that it used an incorrect value for parsing Material. Instead of stripped part[0] it used whole text with CMD in it.
2022-05-23 23:23:22 +03:00
BONNe
3ab7ac8484
Implement ability to create ItemStacks with Custom Model Data. (#1981) 2022-05-23 20:46:02 +03:00
Huynh Tien
0f815d8175
More abstract on Blueprint Paster (#1970)
* more abstract on Paster

* comment and stuff

* How about Impl

* ok, PasteHandler

* PasteUtil

* don't check other BlockState if there is one matched

* world as an argument

* forgot the impl

* createBlockData from BlueprintBlock

* fix remaining conflicts

Co-authored-by: tastybento <tastybento@users.noreply.github.com>
2022-05-03 18:39:27 +01:00
evlad
4ab579f2cd
Feat: Filtering spectators from visitors (#1974)
* support 1.18 negative y

* feat: visitor gamemode spectator check
2022-05-03 08:03:49 +03:00
Huynh Tien
6fba4bfbea
More abstract on World Regenerator (#1969)
* more abstract on delete chunks

* update NMS to 1.18.2

* at most abstract, requires only the island and the world

* it's weird that we can't use whenComplete

* rename to WorldRegenerator
2022-05-02 15:23:31 -07:00
evlad
d07c1b5a8c
support 1.18 negative y (#1973)
Fixes an issue where blueprint starting block could not be placed in negative area.
2022-05-01 08:44:42 +03:00
Huynh Tien
3e0368fbab
fix null on invitedPlayer (#1972) 2022-04-28 15:39:39 +03:00
BONNe
c4c51d00e2
Fixes wrong protection bounding box (#1971)
#1966 fixed a bounding box size for the whole island, while the protection bounding box was still wrong.

Fixes https://github.com/BentoBoxWorld/BSkyBlock/issues/473
2022-04-26 12:06:50 +03:00
tastybento
928f1eb1eb
Version 1.20.1 (#1966)
* Version 1.20.1

* Added name of the addon causing the issue.

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

* Use world min-height for island bounding box.

* Fixes a bug when fallback could not use reusable

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.

* Adjusted test to try to avoid errors

* Fix for random test failures.

* Added 1.18.2 support

* Address unnecessary PVP reports on each teleport (#1948)

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

* Fixes bug with Safe Spot Teleport (#1951)

There was a bug that prevented finding a safe spot if all valid blocks were in height with the `startY` location.

Reported via discord.

* Fix Exception error reported by IDE

I am not sure why Eclipse is saying this is an error.

* Fix for kicking offline players

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

* Add an option in SafeSpotTeleport to cancel if fail (#1952)

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.

* Replace peplaceAll with replace

It does the same thing if the first argument is not a regex.

* Use constants for common strings

* Use constants for common strings

* Go back to replaceAll

This is required.

* Clearer paster (#1953)

* 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

* Improve team kick command (#1957)

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.

* Solve crashes with Addon#allLoaded call (#1959)

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.

* using java 16 syntax (#1958)

* Fixes kick command (#1960)

PR #1957 broke kick command and noone could kick players from teams.
This should fix it.

* Fixes a bug with blueprint height (#1961)

Blueprint clipboard was preventing setting Y below 0 or above 255. 

The code was not adjusted to 1.18 changes.
Reported via discord.

* Fixes Lava Duplication Glitch (#1964)

Due to the fact, that Obsidian Scooping uses one tick delay to remove obsidian, a player with a bucket in hand and offhand duplicated lava. 
To avoid that, added an extra check that ignores the interact event if a player holds a bucket in both hands, and interacted hand is offhand.

Fixes #1963

* Fixes failures in obsidian cooping listener. (#1965)

Failures happened after implementing #1964

Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: Invvk <70810073+Invvk@users.noreply.github.com>
2022-04-17 09:04:37 -07:00
BONNe
9f163f0572
Fixes Lava Duplication Glitch (#1964)
Due to the fact, that Obsidian Scooping uses one tick delay to remove obsidian, a player with a bucket in hand and offhand duplicated lava. 
To avoid that, added an extra check that ignores the interact event if a player holds a bucket in both hands, and interacted hand is offhand.

Fixes #1963
2022-04-11 08:13:12 +03:00
BONNe
4341c28aca
Fixes a bug with blueprint height (#1961)
Blueprint clipboard was preventing setting Y below 0 or above 255. 

The code was not adjusted to 1.18 changes.
Reported via discord.
2022-04-03 21:36:51 +03:00
BONNe
ad0931ffcb
Fixes kick command (#1960)
PR #1957 broke kick command and noone could kick players from teams.
This should fix it.
2022-04-03 08:12:41 +03:00
Invvk
c02e566266
using java 16 syntax (#1958) 2022-04-01 00:12:47 +03:00
BONNe
36751d5573
Solve crashes with Addon#allLoaded call (#1959)
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.
2022-04-01 00:12:27 +03:00
BONNe
9f21314818
Improve team kick command (#1957)
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.
2022-03-25 23:29:14 +02:00
tastybento
6796fceee8
Clearer paster (#1953)
* 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
2022-03-19 16:19:31 +00:00
tastybento
51dbca0f99 Go back to replaceAll
This is required.
2022-03-19 15:12:04 +00:00
tastybento
b0f1417166 Use constants for common strings 2022-03-19 14:45:44 +00:00
tastybento
0b3ef8df6d Use constants for common strings 2022-03-19 14:43:52 +00:00
tastybento
bda56763a8 Replace peplaceAll with replace
It does the same thing if the first argument is not a regex.
2022-03-19 14:29:54 +00:00
BONNe
3ba6620e73
Add an option in SafeSpotTeleport to cancel if fail (#1952)
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.
2022-03-19 14:22:03 +00:00
tastybento
4e8ca6d22c Fix for kicking offline players
https://github.com/BentoBoxWorld/BentoBox/issues/1950
2022-03-18 13:59:41 +00:00
tastybento
fd44e03b7b Fix Exception error reported by IDE
I am not sure why Eclipse is saying this is an error.
2022-03-18 13:59:29 +00:00
BONNe
6d59e79e78
Fixes bug with Safe Spot Teleport (#1951)
There was a bug that prevented finding a safe spot if all valid blocks were in height with the `startY` location.

Reported via discord.
2022-03-18 15:06:31 +02:00
BONNe
0cf1d43a29
Address unnecessary PVP reports on each teleport (#1948)
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
2022-03-16 09:51:22 +02:00
tastybento
e7599ec805 Added 1.18.2 support 2022-03-12 19:20:53 -08:00
BONNe
50b677f4c5
Fixes a bug when fallback could not use reusable
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.
2022-03-12 12:15:10 +02:00
tastybento
6a009946f5 Use world min-height for island bounding box. 2022-02-26 10:22:41 -08:00
tastybento
6c7d77f093 Added name of the addon causing the issue.
https://github.com/BentoBoxWorld/BentoBox/issues/1944
2022-02-24 08:02:20 -08:00
tastybento
4e3079b623
Merge branch 'master' into develop 2022-02-19 09:57:05 -08:00
BONNe
d492539c51
Implement ACTION defining by ACTION TYPE (#1938)
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
```
2022-02-11 18:07:14 -08:00
BONNe
fa68f8f01c
Add missing templated panel builder method (#1935)
#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.
2022-02-11 18:06:56 -08:00
tastybento
937e8bf614 Fix island test and max ever range bug 2022-01-28 21:33:39 -08:00
BONNe
09ab327551
Implement a flag that rules all flags. (#1927)
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
2022-01-28 18:45:50 -08:00
BONNe
90ebe103c4
Templated Panel Title Parameters (#1934)
* 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.
2022-01-28 18:43:14 -08:00
Huynh Tien
178529adb1
Fix null in reject invite (#1933)
* remove debug

* fix null in reject invite
2022-01-28 18:42:56 -08:00
BONNe
52cc2a8593
Implement multiple panels in single file (#1932)
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.
2022-01-28 18:42:23 -08:00
BONNe
3ecdda65b5
Fixed bug with running onLeave commands (#1929)
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.
2022-01-28 18:42:02 -08:00
BONNe
da98bbcf38
Extend ranked commands (#1928)
* 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
2022-01-28 18:41:20 -08:00
tastybento
7b94aa0ea2
Adds bonus range elements to Island object. (#1921)
* 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.
2022-01-28 18:35:55 -08:00
BONNe
54869a400a
Implement duplicated actions click type (#1919)
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>
2022-01-28 18:35:27 -08:00
BONNe
56c9f5c28e
Fixes a bug with on-join commands not working when players join the team. #1925 (#1926) 2022-01-23 15:25:27 -08:00
tastybento
2f0869fd6e More voiding of event listeners
https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-22 18:04:00 -08:00
tastybento
d14ad977ab Clean up imports. 2022-01-22 13:14:57 -08:00
tastybento
9062aab34b Change behavior of teleporting to default nether
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
2022-01-22 13:14:34 -08:00
tastybento
94b982f644 Fix tests
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-22 12:16:27 -08:00
tastybento
5573e9f329 Fix TNTListener tests 2022-01-22 11:57:11 -08:00
tastybento
823bc5ceed Fix Fire tests 2022-01-22 11:54:00 -08:00
tastybento
f25e54f3c8 Return void for event listeners
https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-21 18:47:31 -08:00
tastybento
046c4fff35 Fix for double chest protection.
Double chests could be viewed but not accessed even if chest access or
trapped chest access was allowed.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1912
2022-01-09 20:53:47 -08:00
tastybento
bea9f0e394 List must be mutable. Remove debug. 2022-01-09 20:41:20 -08:00
tastybento
721f0271aa Dynamically grab flags
https://github.com/BentoBoxWorld/BentoBox/issues/1915
2022-01-09 19:44:44 -08:00
tastybento
00e174258e Hook into Vault after other plugins have loaded.
https://github.com/BentoBoxWorld/BentoBox/issues/1913
2022-01-07 19:08:15 -08:00
BONNe
eaf2236f7f
Fixes a bug that increased all button count by 1 (#1911)
This will fix an issue when the next button was not displayed when it was necessary.
2022-01-07 18:48:25 -08:00
BONNe
d1eb175e88
Change AbsolutePath to CanonicalPath (#1901)
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.
2022-01-01 17:45:05 -08:00
Huynh Tien
7088a2736f
Flags for Block Explode (#1899)
* add Block Explosion support for TNT_DAMAGE flag

* prevent block explosion from damaging entities

* seperated flags for block explode

* invert and cancel

* pattern instanceof
2022-01-01 17:42:46 -08:00
Huynh Tien
dffe8a811e
fix an exception when cleaning an offline player (#1898) 2022-01-01 17:39:25 -08: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
c9c9ea0389
Fix Biome compatibility on 1.17 (#1895)
* Fix Biome compatibility on 1.17

* check if it's not 1.17.1
2022-01-01 17:34:51 -08:00
tastybento
17ac4f688a Add an admin delete homes command
https://github.com/BentoBoxWorld/BentoBox/issues/1900

This admin command removes all homes from a specified island.
2021-12-31 10:51:16 -08:00
tastybento
acba363523 Added why to VisitorKeepInventory and test class
why reports can now be made by subclasses of FlagListener
2021-12-21 10:12:20 -08:00
tastybento
7fbae58bb2 Make check an NPE check and failure 2021-12-20 15:30:29 -08:00
tastybento
3ece0d049a Added test for SafeSpotTeleport and removed old test 2021-12-20 09:50:45 -08:00
tastybento
f049fc6941 Added SafeSpotTepeortTest 2021-12-20 09:46:04 -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
Huynh Tien
333c9a8272 load chunks passively 2021-12-20 19:37:50 +07:00
BONNe
ed50765b98
Addres Biome's changes in Minecraft 1.18. (#1893)
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.
2021-12-19 08:49:29 -08:00
Huynh Tien
168de622ea limit how far the y-coordinate will be expanded 2021-12-19 20:40:01 +07:00
Huynh Tien
f91ed4705a this should be better 2021-12-16 17:18:09 +07:00
Huynh Tien
6f01310f92 better safe spot finder 2021-12-16 08:58:41 +07:00
tastybento
60cde5334d
Release 1.19.0 (#1890)
* 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>
2021-12-12 20:26:48 -08:00
tastybento
6567104f94 Add 1.18.1 2021-12-11 10:50:09 -08:00
tastybento
524cb46e27 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-12-07 19:35:08 -08:00
tastybento
8a6cc39214 Send PVP toggle messages only to on-island players.
https://github.com/BentoBoxWorld/BentoBox/issues/1885
2021-12-07 19:34:58 -08:00
BONNe
3b64973c2b
Make BlockEndDragon support custom max world height (#1888)
Use max world height instead of magic 255 value.
2021-12-06 11:49:22 +01:00
tastybento
59de6a8efb
Update to Minecraft 1.18 (#1887) 2021-12-05 21:03:21 -08:00
tastybento
11a3bf9227
Release 1.18.1 (#1886)
* 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>
2021-12-05 13:46:54 -08:00
tastybento
79abf965f3 Fix minor JavaDoc mistake 2021-12-05 12:01:27 -08:00
tastybento
de951b6c4b Added toString to resolve issue with arrays 2021-12-05 11:58:20 -08:00
Fredthedoggy
2d032523c7
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
2021-12-05 11:33:42 -08:00
tastybento
7277432c41 Preveent NPEs and other items. 2021-11-12 15:39:52 -08:00
tastybento
7616f6aa2a Address potential NPE's 2021-11-12 13:19:19 -08:00
tastybento
6b6ab711e5 Fixes console teleporting.
https://github.com/BentoBoxWorld/BentoBox/issues/1877
2021-11-11 15:36:49 -08:00
tastybento
22c62c91b4 Merge branch 'master' into develop
Conflicts:
	src/main/java/world/bentobox/bentobox/api/events/team/TeamEvent.java
	src/main/java/world/bentobox/bentobox/api/panels/reader/TemplateReader.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardFormat.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardReader.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardWriter.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintSchematicConverter.java
	src/main/java/world/bentobox/bentobox/listeners/flags/settings/PVPListener.java
2021-11-11 10:40:17 -08:00
tastybento
df2b445002
Release 1.18.0 (#1876)
## 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>
2021-11-08 21:28:12 -08:00
tastybento
5e3cffbe11 Code refactoring around User.getInstance(player) 2021-10-30 14:02:30 -07:00
tastybento
1953caa7c5 Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1868 2021-10-30 13:44:34 -07:00
tastybento
8752e19e5d Increase priority of EntityPortalEvent listener
https://github.com/BentoBoxWorld/BentoBox/issues/1866
2021-10-26 20:49:38 -07:00
tastybento
6aa7869b17 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.
2021-10-23 16:39:36 -07:00
tastybento
930433b64b 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
2021-10-16 20:44:18 -07:00
tastybento
731d902d98 Prevent NPEs 2021-10-11 18:02:23 -07:00
tastybento
1a802a7510 Require owner to be non-null. It should never be null 2021-10-11 17:56:06 -07:00
tastybento
37e7846908 Require non-null world 2021-10-11 17:55:04 -07:00
tastybento
28a2ecfcfa World should never be null. 2021-10-11 17:52:38 -07:00
tastybento
081f74544b Do a null check 2021-10-11 17:48:41 -07:00
tastybento
2ffa4c9874 Prevent NPE 2021-10-11 17:43:04 -07:00
tastybento
907c6b3534 Prevent NPE 2021-10-11 17:27:24 -07:00
tastybento
8852b9d660 Throw an error if player is null 2021-10-11 17:21:07 -07:00
tastybento
765f774652 Prevent NPE
@Poslovich - you were right!
2021-10-11 17:15:51 -07:00
tastybento
db464d5c04 NPE protections 2021-10-09 11:40:15 -07:00
tastybento
f37226b115 Refactor code for clarity. 2021-10-09 11:20:48 -07:00
tastybento
536d7ef1c3 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.
2021-10-09 09:29:52 -07:00
tastybento
fe2e9e1a9e Fix tests and refactor code 2021-10-08 17:15:41 -07:00
tastybento
b5d9d2e52e API: Require getWorldSettings to be a game mode world 2021-10-03 20:33:50 -07:00
tastybento
cfad9879a5 Refactored setowner command and added test class 2021-10-03 19:20:45 -07:00
tastybento
3a43c40634 Ensure oldIsland is never null. 2021-10-03 16:16:58 -07:00
tastybento
60c62a5967 Prevent rare NPE 2021-10-03 16:08:49 -07:00
tastybento
3c65194dfb 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
2021-10-03 15:50:18 -07:00
tastybento
b5fd992fa7 Fix mis-statement of island protection coordinates in info command. 2021-10-03 15:29:57 -07:00
tastybento
bc6ec36f87 Fix missing color conversion for translations. 2021-10-03 15:04:14 -07:00
tastybento
d780bbd4c0
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
2021-09-26 13:35:18 -07:00
tastybento
f66eeed4a1 Version NPE protections. 2021-09-25 16:42:54 -07:00
tastybento
500f7292c6 Fix tests. 2021-09-25 09:34:02 -07:00
tastybento
af3c0a874c Added API to get a translation without color conversion
It may be necessary to read the translation without converting colors to
Bukkit colors.
2021-09-25 08:47:14 -07:00
tastybento
bc737d4d66 Remove deprecated events. 2021-09-25 08:00:04 -07:00
tastybento
3d2a99c036 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-09-25 07:51:13 -07:00
BONNe
16d5775c84
Fix "ugly" enchant name. (#1858)
Enchant names did not have a touch of Util#prettifyText code.
2021-09-22 19:35:22 -07:00
tastybento
690ea2f99e Prevent NPE possibility. 2021-09-19 18:36:37 -07:00
tastybento
29fa03976c Fix some code smells. 2021-09-19 18:29:19 -07:00
tastybento
f6f5b63110 Fix 2021-09-19 08:45:19 -07:00
tastybento
110a282deb Use isPlayer instead of null check.
Refactor code to be easier to understand.
2021-09-19 08:42:37 -07:00
tastybento
53f02ae686
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
2021-09-18 17:59:32 -07:00
tastybento
68890eba00 Fix test 2021-09-18 12:25:14 -07:00
tastybento
8eac5070f0 Null check 2021-09-18 11:37:33 -07:00
tastybento
25fe86d812
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.
2021-09-18 11:22:28 -07:00
tastybento
8eb45e817c Code smell reduction 2021-09-18 08:15:15 -07:00
tastybento
3282b1bd12 Fix max-range bug 2021-09-18 08:14:43 -07:00
tastybento
d92632341d Fix JavaDoc for GameModeAddon inWorld method 2021-09-16 16:47:42 -07:00
tastybento
02a14cab6e
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
2021-09-16 16:41:27 -07:00
tastybento
063fa97cf3
Removed the unused WorldEdit hook. (#1853)
If someone wants to add it back later they can, but this code does
nothing right now.
2021-09-13 19:46:10 -07:00
tastybento
bb7f124066 Avoid zipSlip vulnerability. 2021-09-12 21:53:26 -07:00
tastybento
0e744cae81 Added test class for Island. 2021-09-12 17:35:52 -07:00
tastybento
7271096ace Ensure maxEverProtectionRange is less than range.
https://github.com/BentoBoxWorld/BentoBox/issues/1851
2021-09-11 16:53:27 -07:00
tastybento
3dd9e973fb 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
2021-09-11 16:50:43 -07:00
tastybento
a6d70d6e90
Release 1.17.3 (#1827)
* Version 1.17.1

* Add homes command to default player options.

* Implements better online player counter. (#1791)

Current one is based on online player count when bStats sends data to the server.
This one will send data about amount of players who logged in the server.

* Add Boxed Gamemode to the list. (#1793)

* Add Bank addon (#1792)

* Add Holographic Displays as SoftDepend for AOneBlock (#1794)

* Custom date time format support for /<admin> info <player> (#1783)

Fixes #1720

* Parent/sub-flag support, split up and designate CONTAINER flag as parent flag (#1784)

* Split CONTAINER flag into multiple flags

CONTAINER split into
- CONTAINER (Chest/Minecart Chest)
- BARREL (Barrel)
- COMPOSTER (Composter)
- FLOWER_POT (Flower Pot)
- SHULKER_BOX (Shulker Box)
- TRAPPED_CHEST (Trapped Chest)

Fixes #1777

* Add subflag support

* Create container parent flag, chest subflag

* Remove extra string from when CHEST was CONTAINER

* Fix incorrect flag specified on fired event in IslandToggleClick

* Add missing world subflag event firing

* Remove extra import

* Add world setting flag for island visitors keep inventory (#1785)

* Implement 3 bar charts: addons, gamemodes, hooks (#1790)

BStats supports sending Bar chart data, however, it does not display it via their site directly.
It can be called manually, to view.

PieChart does not work very well for addons and hooks. BarChart however allows viewing each addon separately. 

This change allows sending data to the server about bar charts.

* Update action versions

* Declare distribution - adopt

* Cache Java Maven files differently.

* Try dependency for shade snapshot

* Add support for Minecraft 1.17.1

* Fix test by incrementing listener value check

There is a new listener now.

* Spigot 1.17.1

* Fix test for InventoryListener

* Re-order repos.

* Downgrading to 1.17 Spigot for now to enable building.

* Try pluginRespositories tag in POM to enable Github actions

* Version 1.17.2

* Add alternative Addon#getIslandManager method (#1797)

We have already done this to the main BentoBox class. But add-ons missed it, and it still has this weird structure: Addon#getIslands().getIslands().

This will just add the same method as it is already in BentoBox class.

* Fix bucket dupe (#1806)

Fix https://discord.com/channels/272499714048524288/310623455462686720/867790395442462760

* Removes unneeded exploit protection code for skulls (#1810)

This no longer seems to be required with 1.17.1

https://github.com/BentoBoxWorld/BSkyBlock/issues/430

* Quote filename of addon that cannot be loaded.

Provides a better understanding of which addon failed.

* Remove update when pasting chest.

* Version 1.17.3

* Java upgrade (#1814)

* Version 1.17.3

* Use Map.of and List.of instead of Immutable collections

* Replace explicit type argument.

* Replace lamba with method reference

* Replace condition with Objects.requireNonNullElseGet

* Use String.repeat

* Use new switch expressions

* Use instanceof patten variables which are more compact

* Fuse toUnmodifiableList into stream and return it.

* Remove unnecessary toString() calls.

* Remove unnecessary public

* Extracted common part from if

* Simplify conditional expressions

* Remove unused IOExceptions

* Cast to long

* Use Map.putAll

* Use primitives

* Clarify what is null or not

* Addedd @Serial annotation introduced with Java 14.

* Use Optional.isEmpty instead of !isPresent

* Use flatMap then ifPresent

* Just use Arrays.stream

* Swap map and filter for null with Objects::nonNull

* Use expression lambda

* Update JavaDoc version to 16

* Make spawn protection area square instead of circle.

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

* Improve ItemParser code. (#1821)

* Improve ItemParser code.

Add ability to parse text if Material is just a single string.
Add ability to parse player heads.

Add comments to the code.

* Fixes failing test.

* Added deprecation suppression.

* Added Pladdon to loadbefore.

* Prevent bucket duping when scooping obsidian Part 35

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

* Warns visitors that PVP is active if they teleport to an island

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

* Prevents repeated portaling when nether is disabled. (#1826)

* Prevents repeated portaling when nether is disabled.

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

* Fix test

* Hex pr 1820 (#1822)

* Fix @since for subflags. (#1831)

* Add Citizens to Softdepend list for NPC support (#1834)

* Fix color test.

* Set the default game mode when player makes island.

* Corrects JavaDocs link

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1838

* Update to 3.3.1-SNAPSHOT for shade plugin.

* Package info files for better JavaDocs (#1839)

* Added package info files for better JavaDocs

* Implement Flag icon changing via Locales file. (#1829)

This commit contains 2 changes:
- An option for Flag to use icon that is defined in locales after "icon" string.
- An option for ItemParser to parse icon or return given value, if parsing was not successful.

The flag option is not ideal, but it is simpler and easier to maintain then adding new config section where icons can be changed, as the locales file already contains a lot of info about each flag.

* Support glowing ink in blueprints (#1842)

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1837

* Panel template (#1841)

* Implement basic functionality to read data from template panels.

Create TemplateReader class that has static method which generates a PanelTemplateRecord. This record contains every necessary information from user created template file so everyone could use it to generate a functional panel.
These classes are just for reading templates and do not create actual panel.

* Add template clearing via bentobox reload command.

* Fix version command to show addon state.

* Fix German flag banner description.

Added more debug around error reporting.

* 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.

* Static code analysis (#1844)

* StringBuffer (Java 5) may be declared as StringBuilder

* Replace map with flatMap

* Use instanceof naming

* No need to specify paramter types.

* Remove verbose code

* Fix JavaDoc issues

* Make internal class a record.

* Remove unused import.

* Make internal class a record.

* Made internal class a record.

* Removed unused import

* Fix typos

* Fix typo in test.

* Prevent home teleport when already home teleporting

Home teleporting is async so it's possible to issue the command multiple
times. This puts a flag in so that if a playeer is mid-teleport, then
issuing the go command will just repeat the text that the player is
teleporting home.

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

* Extracted island info from the Island object.

This is in preparation to have a different info for players than admins.

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

* Slimmer trimmer island info for players.

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

* Fixes coop and trust invites when team invites are not allowed

If a member or sub-owner has coop or trust invite capability and not
team invite rank, and confirm invites is on, then the invites were not
working.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1452

* Remove invulnerable visitor protection if island is in PVP mode

We now have alerts if a player teleports to a PVP island.

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

* Fixes NPE in admin tp if nether or end worlds don't exist.

* Adds arrow sound when teleporting into a PVP island.

* Fix PVPListenerTest

Visitors are no longer invincible when on a PVP island.

* Fix test failure in InvincibleVisitorsListenerTest

* Minor JavaDoc correction.

* Go command was not working second time.

* Prevents console errors for missing icons in locale files.

* Fixes PlAddon disabling issue. (#1847)

There was a bug that did not unload PlAddon classes from JVM.
This change should fix it, as it will unload PlAddons via pluginLoader.

* Clear code - set worlds once on construction.

* Fixes a bug when Potion metadata was not applied (#1849)

There was missing potion meta data applying after creating an item. 
This affects both: Potions and Tipped arrows.

* Adds force-shown lines to the template. (#1850)

* Adds force-shown lines to the template.
Fixes a bug when template type was not selected correctly.
Changes "name" to "title" for border and background icons.

* Create TemplatedPanel and TemplatedPanelBuilder.

TemplatedPanel uses PanelTemplateRecord to create a functional panel.
Builder contains button builder callbacks that are used to create buttons with custom data.

* Use final vars for lambdas to avoid them changing async

The processes could run async, especially when chunk loading took a
while, so using fields that could change would result in blocks being
missed, especially in the nether or end. Switching to final vars avoids
this.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1840

* Remove travis.

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>
2021-09-10 18:39:16 -07:00
tastybento
b24c1fdc86 Use final vars for lambdas to avoid them changing async
The processes could run async, especially when chunk loading took a
while, so using fields that could change would result in blocks being
missed, especially in the nether or end. Switching to final vars avoids
this.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1840
2021-09-08 21:08:15 -07:00
tastybento
6bff4c8132 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-09-08 20:26:56 -07:00
BONNe
9da329356a
Adds force-shown lines to the template. (#1850)
* Adds force-shown lines to the template.
Fixes a bug when template type was not selected correctly.
Changes "name" to "title" for border and background icons.

* Create TemplatedPanel and TemplatedPanelBuilder.

TemplatedPanel uses PanelTemplateRecord to create a functional panel.
Builder contains button builder callbacks that are used to create buttons with custom data.
2021-09-08 19:58:26 -07:00
BONNe
6bf3264ab5
Fixes a bug when Potion metadata was not applied (#1849)
There was missing potion meta data applying after creating an item. 
This affects both: Potions and Tipped arrows.
2021-09-08 19:57:27 -07:00
tastybento
3650863fa1 Clear code - set worlds once on construction. 2021-09-08 19:50:23 -07:00
BONNe
23e3554c4d
Fixes PlAddon disabling issue. (#1847)
There was a bug that did not unload PlAddon classes from JVM.
This change should fix it, as it will unload PlAddons via pluginLoader.
2021-09-05 17:28:49 -07:00
tastybento
938940199d Prevents console errors for missing icons in locale files. 2021-09-04 17:21:45 -07:00
tastybento
184c86bafe Go command was not working second time. 2021-09-04 17:21:25 -07:00
tastybento
0844e97530 Minor JavaDoc correction. 2021-09-04 15:43:51 -07:00
tastybento
7d7882c309 Adds arrow sound when teleporting into a PVP island. 2021-09-04 14:46:41 -07:00
tastybento
74ded5a187 Fixes NPE in admin tp if nether or end worlds don't exist. 2021-09-04 14:46:26 -07:00
tastybento
7621677c93 Remove invulnerable visitor protection if island is in PVP mode
We now have alerts if a player teleports to a PVP island.

https://github.com/BentoBoxWorld/BentoBox/issues/668
2021-09-04 14:36:47 -07:00
tastybento
23522a297f Fixes coop and trust invites when team invites are not allowed
If a member or sub-owner has coop or trust invite capability and not
team invite rank, and confirm invites is on, then the invites were not
working.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1452
2021-09-04 13:47:44 -07:00
tastybento
0f7ca6ac60 Slimmer trimmer island info for players.
https://github.com/BentoBoxWorld/BentoBox/issues/1501
2021-09-04 10:02:37 -07:00
tastybento
547c266975 Extracted island info from the Island object.
This is in preparation to have a different info for players than admins.

https://github.com/BentoBoxWorld/BentoBox/issues/1501
2021-09-04 09:46:28 -07:00
tastybento
5bb12d53bd Prevent home teleport when already home teleporting
Home teleporting is async so it's possible to issue the command multiple
times. This puts a flag in so that if a playeer is mid-teleport, then
issuing the go command will just repeat the text that the player is
teleporting home.

https://github.com/BentoBoxWorld/BentoBox/issues/1637
2021-09-03 15:39:08 -07:00
tastybento
23857501f5
Static code analysis (#1844)
* StringBuffer (Java 5) may be declared as StringBuilder

* Replace map with flatMap

* Use instanceof naming

* No need to specify paramter types.

* Remove verbose code

* Fix JavaDoc issues

* Make internal class a record.

* Remove unused import.

* Make internal class a record.

* Made internal class a record.

* Removed unused import

* Fix typos

* Fix typo in test.
2021-08-29 18:17:38 -07: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
a9a7673ce8 Fix German flag banner description.
Added more debug around error reporting.
2021-08-29 15:04:20 -07:00
tastybento
44f06f2911 Fix version command to show addon state. 2021-08-29 14:56:54 -07:00
BONNe
2607256c06
Panel template (#1841)
* Implement basic functionality to read data from template panels.

Create TemplateReader class that has static method which generates a PanelTemplateRecord. This record contains every necessary information from user created template file so everyone could use it to generate a functional panel.
These classes are just for reading templates and do not create actual panel.

* Add template clearing via bentobox reload command.
2021-08-29 14:34:05 -07:00
tastybento
faf351fd59
Support glowing ink in blueprints (#1842)
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1837
2021-08-29 14:17:42 -07:00
BONNe
fa41abc062
Implement Flag icon changing via Locales file. (#1829)
This commit contains 2 changes:
- An option for Flag to use icon that is defined in locales after "icon" string.
- An option for ItemParser to parse icon or return given value, if parsing was not successful.

The flag option is not ideal, but it is simpler and easier to maintain then adding new config section where icons can be changed, as the locales file already contains a lot of info about each flag.
2021-08-29 13:30:45 -07:00
tastybento
0341515fc8
Package info files for better JavaDocs (#1839)
* Added package info files for better JavaDocs
2021-08-29 13:28:16 -07:00
tastybento
876ba91837 Set the default game mode when player makes island. 2021-08-23 19:40:46 -07:00
BONNe
c635647f85
Fix @since for subflags. (#1831) 2021-08-19 12:10:44 -07:00
tastybento
b906f5561a
Hex pr 1820 (#1822) 2021-08-19 12:09:23 -07:00
tastybento
e0d6e4df30
Merge branch 'master' into develop 2021-08-15 17:08:52 -07:00
tastybento
32638e7a87
Prevents repeated portaling when nether is disabled. (#1826)
* Prevents repeated portaling when nether is disabled.

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

* Fix test
2021-08-15 17:05:20 -07:00
tastybento
233c058bfe Warns visitors that PVP is active if they teleport to an island
https://github.com/BentoBoxWorld/BentoBox/issues/1780
2021-08-14 21:02:53 -07:00
tastybento
6b839d9c69 Prevent bucket duping when scooping obsidian Part 35
https://github.com/BentoBoxWorld/BentoBox/issues/1825
2021-08-14 16:23:13 -07:00
tastybento
cc974c795f Added deprecation suppression. 2021-08-08 18:41:43 -07:00
BONNe
56a1fdb55a
Improve ItemParser code. (#1821)
* Improve ItemParser code.

Add ability to parse text if Material is just a single string.
Add ability to parse player heads.

Add comments to the code.

* Fixes failing test.
2021-08-08 10:05:14 -07:00