bentobox/src/main/java/world/bentobox/bentobox/api/panels/reader/TemplateReader.java

374 lines
13 KiB
Java
Raw Normal View History

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-11 03:39:16 +02:00
//
// Created by BONNe
// Copyright - 2021
//
package world.bentobox.bentobox.api.panels.reader;
2022-01-22 22:14:57 +01:00
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
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-11 03:39:16 +02:00
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.event.inventory.ClickType;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
2022-01-22 22:14:57 +01:00
import com.google.common.base.Enums;
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-11 03:39:16 +02:00
import world.bentobox.bentobox.api.panels.Panel;
import world.bentobox.bentobox.util.ItemParser;
/**
* This class manages Template file reading, creating PanelTemplateRecord object and storing it internally.
* This class just reads and returns given panel template. It does not create a functional panel.
*
* @since 1.17.3
*/
public class TemplateReader
{
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-09 06:28:12 +01:00
private static final String TITLE = "title";
private static final String ICON = "icon";
private static final String DESCRIPTION = "description";
private static final String BACKGROUND = "background";
private static final String BORDER = "border";
private static final String FORCE_SHOWN = "force-shown";
private static final String FALLBACK = "fallback";
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-11 03:39:16 +02:00
/**
* Read template panel panel template record.
*
* @param panelName the panel name
* @param panelLocation the panel location directory
* @return the panel template record
*/
public static PanelTemplateRecord readTemplatePanel(@NonNull String panelName, @NonNull File panelLocation)
{
if (!panelLocation.exists())
{
// Return null because folder does not exist.
return null;
}
File file = new File(panelLocation, panelName.endsWith(".yml") ? panelName : panelName + ".yml");
if (!file.exists())
{
// Return as file does not exist.
return null;
}
// Check if panel is already crafted.
if (TemplateReader.loadedPanels.containsKey(file.getAbsolutePath()))
{
return TemplateReader.loadedPanels.get(file.getAbsolutePath());
}
PanelTemplateRecord record;
try
{
// Load config
YamlConfiguration config = new YamlConfiguration();
config.load(file);
// Read panel
record = readPanelTemplate(config.getConfigurationSection(panelName));
// Put panel into memory
TemplateReader.loadedPanels.put(file.getAbsolutePath(), record);
}
catch (IOException | InvalidConfigurationException e)
{
record = null;
}
return record;
}
/**
* This method reads panel template from given configuration section.
* @param configurationSection Section that contains panel template data.
* @return Panel Template.
*/
private static PanelTemplateRecord readPanelTemplate(@Nullable ConfigurationSection configurationSection)
{
if (configurationSection == null)
{
// No data to return.
return null;
}
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-09 06:28:12 +01:00
String title = configurationSection.getString(TITLE);
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-11 03:39:16 +02:00
Panel.Type type =
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-09 06:28:12 +01:00
Enums.getIfPresent(Panel.Type.class, configurationSection.getString("type", "INVENTORY")).
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-11 03:39:16 +02:00
or(Panel.Type.INVENTORY);
PanelTemplateRecord.TemplateItem borderItem = null;
// Read Border Icon.
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-09 06:28:12 +01:00
if (configurationSection.isConfigurationSection(BORDER))
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-11 03:39:16 +02:00
{
// Process border icon if it contains more options.
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-09 06:28:12 +01:00
ConfigurationSection borderSection = configurationSection.getConfigurationSection(BORDER);
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-11 03:39:16 +02:00
if (borderSection != null)
{
borderItem = new PanelTemplateRecord.TemplateItem(
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-09 06:28:12 +01:00
ItemParser.parse((borderSection.getString(ICON, Material.AIR.name()))),
borderSection.getString(TITLE, null),
borderSection.getString(DESCRIPTION, null));
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-11 03:39:16 +02:00
}
}
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-09 06:28:12 +01:00
else if (configurationSection.isString(BORDER))
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-11 03:39:16 +02:00
{
// Process border icon if it contains only icon.
borderItem = new PanelTemplateRecord.TemplateItem(
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-09 06:28:12 +01:00
ItemParser.parse((configurationSection.getString(BORDER, Material.AIR.name()))));
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-11 03:39:16 +02:00
}
PanelTemplateRecord.TemplateItem backgroundItem = null;
// Read Background block
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-09 06:28:12 +01:00
if (configurationSection.isConfigurationSection(BACKGROUND))
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-11 03:39:16 +02:00
{
// Process border icon if it contains more options.
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-09 06:28:12 +01:00
ConfigurationSection backgroundSection = configurationSection.getConfigurationSection(BACKGROUND);
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-11 03:39:16 +02:00
if (backgroundSection != null)
{
backgroundItem = new PanelTemplateRecord.TemplateItem(
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-09 06:28:12 +01:00
ItemParser.parse((backgroundSection.getString(ICON, Material.AIR.name()))),
backgroundSection.getString(TITLE, null),
backgroundSection.getString(DESCRIPTION, null));
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-11 03:39:16 +02:00
}
}
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-09 06:28:12 +01:00
else if (configurationSection.isString(BACKGROUND))
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-11 03:39:16 +02:00
{
// Process background icon if it contains only icon.
backgroundItem = new PanelTemplateRecord.TemplateItem(
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-09 06:28:12 +01:00
ItemParser.parse((configurationSection.getString(BACKGROUND, Material.AIR.name()))));
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-11 03:39:16 +02:00
}
// Read reusable
Map<String, ItemTemplateRecord> panelItemDataMap = new HashMap<>();
ConfigurationSection reusable = configurationSection.getConfigurationSection("reusable");
if (reusable != null)
{
// Add all reusables to the local storage.
reusable.getKeys(false).forEach(key ->
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-09 06:28:12 +01:00
readPanelItemTemplate(reusable.getConfigurationSection(key), key, panelItemDataMap));
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-11 03:39:16 +02:00
}
// Read content
boolean[] forcedRows = readForcedRows(configurationSection);
// Create template record.
PanelTemplateRecord template = new PanelTemplateRecord(type, title, borderItem, backgroundItem, forcedRows);
// Read content
ConfigurationSection content = configurationSection.getConfigurationSection("content");
if (content == null)
{
// Return empty template.
return template;
}
for (int rowIndex = 0; rowIndex < 6; rowIndex++)
{
// Read each line.
if (content.isConfigurationSection(String.valueOf(rowIndex + 1)))
{
ConfigurationSection line = content.getConfigurationSection(String.valueOf(rowIndex + 1));
if (line != null)
{
// Populate existing lines with items.
for (int columnIndex = 0; columnIndex < 9; columnIndex++)
{
if (line.isConfigurationSection(String.valueOf(columnIndex + 1)))
{
// If it contains a section, then build a new button template from it.
template.addButtonTemplate(rowIndex,
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-09 06:28:12 +01:00
columnIndex,
readPanelItemTemplate(line.getConfigurationSection(String.valueOf(columnIndex + 1))));
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-11 03:39:16 +02:00
}
else if (line.isString(String.valueOf(columnIndex + 1)))
{
// If it contains just a single word, assume it is a reusable.
template.addButtonTemplate(rowIndex,
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-09 06:28:12 +01:00
columnIndex,
panelItemDataMap.get(line.getString(String.valueOf(columnIndex + 1))));
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-11 03:39:16 +02:00
}
}
}
}
}
// Garbage collector.
panelItemDataMap.clear();
return template;
}
/**
* This method reads force shown rows that must be always displayed.
* @param section Configuration section that contains force-shown path.
* @return boolean array that contains which lines are force loaded.
*/
private static boolean[] readForcedRows(@Nullable ConfigurationSection section)
{
boolean[] forceShow = new boolean[6];
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-09 06:28:12 +01:00
if (section != null && section.contains(FORCE_SHOWN))
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-11 03:39:16 +02:00
{
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-09 06:28:12 +01:00
if (section.isInt(FORCE_SHOWN))
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-11 03:39:16 +02:00
{
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-09 06:28:12 +01:00
int value = section.getInt(FORCE_SHOWN);
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-11 03:39:16 +02:00
if (value > 0 && value < 7)
{
forceShow[value-1] = true;
}
}
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-09 06:28:12 +01:00
else if (section.isList(FORCE_SHOWN))
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-11 03:39:16 +02:00
{
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-09 06:28:12 +01:00
section.getIntegerList(FORCE_SHOWN).forEach(number -> {
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-11 03:39:16 +02:00
if (number > 0 && number < 7)
{
forceShow[number-1] = true;
}
});
}
}
return forceShow;
}
/**
* This method creates PanelItemTemplate from a given configuration section.
* @param section Section that should contain all information about the panel item template.
* @return PanelItemTemplate that should represent button from a section.
*/
@Nullable
private static ItemTemplateRecord readPanelItemTemplate(@Nullable ConfigurationSection section)
{
return readPanelItemTemplate(section, null, null);
}
/**
* This method creates PanelItemTemplate from a given configuration section.
* @param section Section that should contain all information about the panel item template.
* @return PanelItemTemplate that should represent button from a section.
*/
@Nullable
private static ItemTemplateRecord readPanelItemTemplate(@Nullable ConfigurationSection section,
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-09 06:28:12 +01:00
String itemKey,
Map<String, ItemTemplateRecord> reusableItemMap)
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-11 03:39:16 +02:00
{
if (section == null)
{
// No section, no item.
return null;
}
ItemTemplateRecord fallback;
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-09 06:28:12 +01:00
if (section.isConfigurationSection(FALLBACK))
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-11 03:39:16 +02:00
{
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-09 06:28:12 +01:00
fallback = readPanelItemTemplate(section.getConfigurationSection(FALLBACK));
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-11 03:39:16 +02:00
}
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-09 06:28:12 +01:00
else if (section.isString(FALLBACK) && reusableItemMap != null)
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-11 03:39:16 +02:00
{
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-09 06:28:12 +01:00
fallback = reusableItemMap.get(section.getString(FALLBACK));
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-11 03:39:16 +02:00
}
else
{
fallback = null;
}
// Create Item Record
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-09 06:28:12 +01:00
ItemTemplateRecord itemRecord = new ItemTemplateRecord(ItemParser.parse(section.getString(ICON)),
section.getString(TITLE, null),
section.getString(DESCRIPTION, null),
fallback);
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-11 03:39:16 +02:00
// Read data
if (section.isConfigurationSection("data"))
{
ConfigurationSection dataSection = section.getConfigurationSection("data");
if (dataSection != null)
{
dataSection.getKeys(false).forEach(key -> itemRecord.addData(key, dataSection.get(key)));
}
}
// Read Click data
if (section.isConfigurationSection("actions"))
{
ConfigurationSection actionSection = section.getConfigurationSection("actions");
if (actionSection != null)
{
actionSection.getKeys(false).forEach(actionKey -> {
ClickType clickType = Enums.getIfPresent(ClickType.class, actionKey.toUpperCase()).orNull();
if (clickType != null)
{
ConfigurationSection actionDataSection = actionSection.getConfigurationSection(actionKey);
if (actionDataSection != null)
{
ItemTemplateRecord.ActionRecords actionData =
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-09 06:28:12 +01:00
new ItemTemplateRecord.ActionRecords(clickType,
actionDataSection.getString("type"),
actionDataSection.getString("content"),
actionDataSection.getString("tooltip"));
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-11 03:39:16 +02:00
itemRecord.addAction(actionData);
}
}
});
}
}
// Add item to the map
if (reusableItemMap != null && itemKey != null)
{
reusableItemMap.put(itemKey, itemRecord);
}
return itemRecord;
}
/**
* This method clears loaded panels from the cache.
*/
public static void clearPanels()
{
loadedPanels.clear();
}
/**
* This map contains already read panels and their location.
* This improves performance for GUI opening, with a some memory usage.
*/
private static final Map<String, PanelTemplateRecord> loadedPanels = new HashMap<>();
}