Improve the error checking mechanism for the `ChestShopSign` metadata handling by introducing a validation layer. This layer will delay the metadata saving task, allowing the system to verify its correctness before execution, hence improving data integrity. The async task is scheduled with a one tick delay to ensure a smoother operation even under potential exceptions. (commit: 2d073f7) (details)
The string to shorten is now taken literal. Before it was compiled as a regex. We don't need that Complexity in that component. (commit: b92548e) (details)
The displayed itemname in the item info is now the long version of what should be written on the sign. (commit: f8f87f0) (details)
Commit
2185457af593dbf6281fea23e692baf681ebbe78
by maik
Update Maven repository URL to HTTPS
The Maven repository URL for sk89q has been updated from HTTP to HTTPS, to ensure that all artifacts are securely downloaded. This change improves security measures while downloading dependencies. (commit: 2185457)
Commit
82d8fcdf9229b65f3c7f9520248e5a5ce788c44e
by maik
Add ownership and access management to ChestShopSign
This update introduces new methods to the ChestShopSign class in the ChestShop plugin for handling ownership and access. The isOwner and isAccessor methods leverage persistent data containers and Bukkit's NamespacedKey to identify if a player is the owner or has access to a shop, respectively. It also provides functionality for adding and removing accessors persistently. (commit: 82d8fcd)
Commit
39989efd926397c9a8d64d6a37486ba37ec4bfd3
by maik
Add admin shop detection to ChestShopSign
This update modifies the ChestShopSign class to improve admin shop detection. By incorporating a new NamespacedKey, ADMINSHOP_NAMESPACED_KEY, and associating it with the sign's persistent data container, the updated code increases the efficiency and reliability of determining if a shop is an admin shop. (commit: 39989ef)
Commit
0be745e954cfe2b5a690d0baaf96ac96ae0bfaea
by maik
Optimize admin shop detection with NamespacedKey
Revised the ChestShopSign class to enhance the process of identifying an admin shop. This involved the new creation and utilization of the NamespacedKey, ADMINSHOP_NAMESPACED_KEY, linked with the sign's persistent data container. The modification improves the performance and accuracy of the admin shop detection. (commit: 0be745e)
Commit
ce4387e8d19e6a56b5b426a9af860c528ea9cfdb
by maik
Introduce NamespacedKey for admin shop detection
The code has been updated to improve the admin shop detection process using a NamespacedKey. This change involves initializing this new NamespacedKey in the ChestShopSign class and using it with the sign's persistent data container. This enhancement will offer an optimized performance and accuracy in identifying admin shops. (commit: ce4387e)
Commit
ad1fae991cebdef363881d00893a9f9917de85bb
by maik
Update Maven repository URL to HTTPS
The Maven repository URL for sk89q has been updated from HTTP to HTTPS, to ensure that all artifacts are securely downloaded. This change improves security measures while downloading dependencies.
(cherry picked from commit 2185457af593dbf6281fea23e692baf681ebbe78) (commit: ad1fae9)
Commit
0e84ac4e5089af70d0491814c3a3e519c90e2adf
by maik
Remove unused UUID retrievals methods in NameManager
The methods getUUIDFor and getUUIDForFullName were removed from the NameManager class. These methods were found to be unnecessary or unused. The ChestShopSign class had also been modified to include handling of admin shop sign UUIDs directly, paving the way for more efficient and streamlined admin shop management. (commit: 0e84ac4)
Commit
7bea5815453888d7d756c9589cbff321bb2f55d5
by maik
Add method for UUID retrieval and improve sign management
Introduced a function in the NameManager class to fetch UUIDs using short names. In the ChestShopSign class, enhanced the management of admin shop signs by refining checks for the same and optimizing the way in which owner data is stored. This will facilitate easier updating of existing signs, improved admin shops' management, and the efficiency of all operations related to the owner. (commit: 7bea581)
Commit
ce71e714702b3feddee7522222cdacf263848fc6
by maik
Update 'isShopMember' function in ChestShop class
Updated 'isShopMember' function in the ChestShop.java class to check if a player is not only an accessor but also an owner. This modification optimizes and improves sign management; making it more convenient to update existing signs and manage admin shops. (commit: ce71e71)
Commit
cb363ec7024e64d9f8b3d8c3ba79c6b1f303f724
by maik
Add 'setAdminshop' and 'setOwner' functions in ChestShopSign class
Added 'setAdminshop' and 'setOwner' functions in ChestShopSign.java to handle shop ownership and status updates. These new utilities make it easier to manage shop signs by differentiating between admin and player-owned shops and by permitting the direct assignment of owners. (commit: cb363ec)
Commit
9eacee45e7fa5a154b6e9b1c0ceac20853ae0647
by maik
Update sign immediately in 'setAdminshop', 'setOwner' and 'saveAccessors'
Refactor code in ChestShopSign.java to immediately update sign after changes in functions: 'setAdminshop', 'setOwner', and 'saveAccessors'. This helps to ensure that all the changes are immediately reflected on the respective shop signs. (commit: 9eacee4)
Commit
b40420ddaab392c38fd5357bf2af943515cad072
by maik
Add accessor addition and removal commands
This update includes the implementation of `AddAccessor` and `RemoveAccessor` commands, allowing users to add or remove an accessor from a shop. Additionally, new user messages that tie into these commands have been defined in `Configuration/Messages.java`. Changes have been reflected in plugin.yml file and invoked in the main ChestShop class. (commit: b40420d)
Commit
d9b70bdabaf8a844865992d57abf265ce02c99b9
by maik
Change data structure in 'saveAccessors' to HashSet
Replaced Arrays.asList with a new HashSet in the 'saveAccessors' function of ChestShopSign.java. This change improves data uniqueness and prevents possible duplications of entries. (commit: d9b70bd)
Commit
203fef8d9aaa552fdef57ae025ed7e3461f6dfa8
by maik
Updated accessor methods to use UUIDs
Updated the ChestShopSign's accessor methods in RemoveAccessor.java and AddAccessor.java to use UUIDs instead of player names for better tracking and handling of user identities. The changes include the addition of UUID import, new error messages in Configuration/Messages.java, and modification in getAccessors method in ChestShopSign.java. (commit: 203fef8)
Commit
b4b55b7513136684729ca002ddeef16eda959b12
by maik
Added owner access restriction for shop
Integrated a check in the AddAccessor.java file to prevent the owner of a shop from being added as an accessor, returning an error message defined in the Messages.java file in such instances. This ensures the owner's privileges are not unintentionally downgraded or altered. (commit: b4b55b7)
Commit
255ddc3963f3e3cabc84f92f2b4f05b9a187866b
by maik
Add show owner information feature
This update introduces a new feature that displays additional information about the shop owner when they interact with their shop. Included in this update is also the display of a list of accessors to aid user interaction. To support this new feature, relevant messages have been added to the Messages.java file. (commit: 255ddc3)
Commit
2e84c34ad569fa8bb95a0423723ffbd4b2cc9d68
by maik
Refactor variables and handle empty accessor data
The variable name in the loop has been changed from 'string' to 'accessorUUID' in PlayerInteract.java for better clarity. Alongside this renaming, the code in ChestShopSign.java has been updated to return an empty HashSet when no accessor data exists to avoid any potential errors or misinterpretations. (commit: 2e84c34)
Commit
2a0dbea2a96bddb7dd42a46e8201f928ade63ce5
by maik
Add getUUIDForFullName method in NameManager
The getUUIDForFullName method was added in the NameManager class to retrieve the UUID for the given full name. The function retrieves the corresponding UUID from the fullNamesToUUID map after converting the provided name to lowercase. (commit: 2a0dbea)
Commit
65cb03947849ad7d8477898a53d58e16dee2822f
by maik
Update ChestShopSign validation method
The validation method "isValid" in the ChestShopSign class has been replaced with "isLegacyValid". Changes were made across multiple files where this method is used. Additionally, import sections were tidied in several classes, grouping related imports together. (commit: 65cb039)
Commit
21c6774eb36a6ca146e62fd74d747ae1e90dac59
by maik
Update ChestShopSign validation check
The validation check "isLegacyValid" in the ChestShopSign class has been replaced with "isChestShop". Changes were done in the ChestShop, RestrictedSign, and ChestShopSign classes where this method was called. A new validation function "isChestShop" was also added to check if a block is a ChestShop sign. (commit: 21c6774)
Commit
0dc6dc8f3f8a10163158fe0c49e3c0e872866b7f
by maik
Refactor ItemChecker and PlayerInteract classes
Removed ItemChecker class and restructured PlayerInteract class to utilize ChestShopMetaData for improved efficiency and simplicity in code management. The approach minimizes direct sign line manipulation in favor of pre-computed metadata, thereby reducing error possibilities and improving code legibility. (commit: 0dc6dc8)
Commit
6979486bb0a7602c46b90fa64043bba8748b86d0
by maik
Refactor ItemChecker and PlayerInteract classes
The ItemChecker class has been removed and the PlayerInteract class has been reframed to use ChestShopMetaData. This enhances code efficiency and simplicity. Direct sign line manipulation has been minimized in favor of using pre-calculated metadata, thus reducing potential errors and improving code readability. (commit: 6979486)
Commit
350a3be0eb915ef02f2ad254ea584ee02ef1508b
by maik
Enhance sign manipulation by using ChestShopMetaData
The PlayerInteract class has been updated to use ChestShopMetaData instead of direct sign line manipulation. This has not only improved code efficiency and readability, but also reduced the possibility of errors. Besides, accessors management has been added in Sign class to better manage access control. (commit: 350a3be)
Commit
fe6e05ef34e1d4b79d77523104b12bc8f8ee2c66
by maik
Remove commands SetAmount, SetItem, SetPrice, and refactor isChestShop method
Removed SetAmount, SetItem and SetPrice commands for ChestShop giant cleanup. Also replaced ChestShopSign.isLegacyValid method with isChestShop for more precise sign checking in the uBlock, RemoveAccessor, and AddAccessor classes. These improvements aim to streamline the codebase and minimize future debugging efforts. (commit: fe6e05e)
Commit
a2c24b69ff2bf449175e6f535e73346b557fc2ab
by maik
Refactor sign checking method in ChestShop plugin
Replaced the isLegacyValid method with isChestShop in various classes for more accurate sign validation in the ChestShop plugin. This enhances the clarity of the code, allowing for easier understanding and debugging in the future. (commit: a2c24b6)
Commit
f99ceb3c880bb7e2e73445423827251ab864adf4
by maik
Update sign creation and check logic
Refactored the sign creation process and added logic in ChestShop listener to handle autofill items. Extracted methods to check sign validity into ChestShopSign class for better encapsulation. Also, moved the price parsing logic to use methods from ChestShopSign. This change improves code readability and the robustness of the sign creation process. (commit: f99ceb3)
Commit
ec4563b53858d239884084165d4bb08454169d2e
by maik
Refactor sign creation process and add autofill items logic
Updated the sign creation process in ChestShop listener to include validation of autofill items via a new getItemStack method. Also, refactored the ChestShopSign class to handle the encapsulation of sign validity checks, improving code readability and robustness. (commit: ec4563b)
Commit
c4fb1c2b63739390861054a424b7ea049f279d4f
by maik
Refactor sign validation and creation in ChestShop
Updated the sign creation process to handle item autofill validation directly. Included changes to the ChestShopSign class to centralize sign validity checks, therefore enhancing code readability and consistency. Various adjustments throughout the codebase were made to support these changes. (commit: c4fb1c2)
Commit
a241a18518a73049f91d5ad520c1737185286fe6
by maik
Update itemStack to read from correct event line in SignCreate
This update fixes a bug where the itemStack was incorrectly read from event.getLine(4) instead of event.getLine(3) in the SignCreate class. This change ensures the correct line from the event is read, avoiding potential errors in the sign creation process. The PriceCheckerTest has also been removed reflecting the current state of the codebase. (commit: a241a18)
Commit
a7944fd74f7e8c7cf46052032d84ce5d6e05a352
by maik
Refactor check method for admin shop in PreShopCreation events
The commit replaces `isAdminShop(event.getSign())` with `isAdminshopLine(event.getOwnerName())` in PreShopCreation events across TerrainChecker, ChestChecker, and MoneyChecker files. This change enhances the checking mechanism for admin shops, thus improving the shop creation process. (commit: a7944fd)
Commit
99d832ca5804586f2d78c462a640068bb73fc05d
by maik
Make ItemStack final in PreShopCreationEvent class
The change includes making `itemStack` final in the `PreShopCreationEvent` class. It ensures that the item details remain constant and secure during the process of shop creation. This improves data integrity and allows consistent information to be shared with the player during sign creation. (commit: 99d832c)
Commit
ebb478dbb2fcb2be936803dec9b5329d12da7541
by maik
Remove invalid price error message in pre-shop creation
This commit removes the error message indicating an invalid price from the pre-shop creation process. This isn't needed anymore, as price validation has now been handled elsewhere, reducing redundancy of error messages. (commit: ebb478d)
Commit
a897576f06b7d14ba6504dddbe362e627d859aae
by maik
Change quantity line index in pre-shop creation event
This commit changes the signLines index from 2 to 1 in the getQuantityLine method within the PreShopCreationEvent file. This modification is required to ensure the appropriate line is referenced, ensuring correct behavior of pre-shop creation events. (commit: a897576)
Commit
6bb5ca878184e795a429fd33ff0aebb95f0d4ba7
by maik
Update method to retrieve player display name
The getNameFor method in NameManager.java file has been updated to return the player's display name instead of their UUID. Additionally, MaterialUtil library has been imported in PreShopCreationEvent class to fetch the name of the item type for the given ItemStack, which is then set as the third line of signLines. (commit: 6bb5ca8)
Commit
5e125ed1c6b6226a56186911a404f8ba3afc4824
by maik
Add ItemChecker in pre-shop creation process
ItemChecker class has been added for the pre-shop creation process. It validates the ItemStack, and sets the name of the item type as the third line of signLines in PreShopCreationEvent. Unused import in PreShopCreationEvent has been removed. (commit: 5e125ed)
Commit
c0d7234f72122db652b93d5277a770e8d64146ed
by maik
Update ChestShopSign to persist sign data
The ChestShopSign class has been updated to correctly persist sign data. An update method call has been added after setting persistent data, to ensure changes are saved and persisted within the server. (commit: c0d7234)
Commit
734109809b3405a593cee6049a04b3886951c41c
by maik
Refactor serialization in ChestShopMetaData class
The serialization and deserialization methods in the ChestShopMetaData class have been modified. UUID fields are now saved and reloaded as strings rather than as UUID objects to ensure correct data persistence. Alongside, necessary changes were addressed during the transformation to and from a string to UUID. (commit: 7341098)
Commit
a439c2d0804c8b60b95aaaf1b26c0ddd4813db1b
by maik
Add null validation for getItemStack in PreShopCreationEvent
Inserted a null validation for the getItemStack method in PreShopCreationEvent.java. This modification ensures that the getItemStack method returns null when the itemStack object is null, avoiding attempts to clone a nonexistent object which can lead to null pointer exceptions. (commit: a439c2d)
Commit
76053f4c34bc085a36ac3bb5acbdd1d41ef687d2
by maik
Remove unused import and simplify conditional in NameChecker
Removed extra import 'Permission' and simplified a conditional statement in the NameChecker class. This refactoring streamlines the logic for setting the name during PreShopCreationEvent, making the code more straightforward without changing functionality. (commit: 76053f4)
Commit
d048c8a80fd9eacab4b8f00fbdc318c5955f5f32
by maik
Fix interaction handling and price-line index for ChestShop
The conditions for ChestShop interactions have been altered to handle non-ChestShop signs properly. In addition, the index used to reference the price-line for sign creation in the ChestShop was corrected, to ensure that the correct price is fetched and applied. (commit: d048c8a)
Commit
05c2450c7a6c3792f16428ec6f057e5a7b4bd7a6
by maik
Refactor ChestShop MetaData creation methods
The 'createShopMetaData', 'createChestShop', and 'createAdminChestShop' methods in 'SignCreate' class have been refactored. The unnecessary 'sign' parameter has been removed from these methods, streamlining the code and fixing potential issues with incorrect sign references. (commit: 05c2450)
Commit
41e733af187f2293443053671c942ac6b133d80c
by maik
Implement item metadata check in PreShopCreation
The ItemChecker class now includes functionality to handle item metadata during PreShopCreation. It adds a check for itemStack's metadata, strips any color from displayName if it exists or adds italics to itemName if the metadata is unique. This ensures correct preprocessing of items with metadata. (commit: 41e733a)
Commit
df8ae51eabd8fadfe75d8f9de1d1457eee20c6d7
by maik
Remove unused code in ItemInfo command class
The changes in the codebase remove unused imports and commenting out unused code in ItemInfo command class. This process helps in maintaining the code clean and easy to read, improving the maintainability of the code. (commit: df8ae51)
Commit
e6c9d624e9630d496511f48fe2723385dfc662f4
by maik
Add chat functionality to ItemInfo command class
The code changes include additions which allow the ItemInfo command class to send chat messages to the sender. It generates a text component and attaches it to the sender using spigot's sendMessage method, enhancing user interaction. (commit: e6c9d62)
Commit
157b53a2401e76552ae6a2e4fbb244c21073916f
by maik
Add chat functionality to ItemInfo command class
The code changes include additions which allow the ItemInfo command class to send chat messages to the sender. It generates a text component and attaches it to the sender using spigot's sendMessage method, enhancing user interaction. (commit: 157b53a)
Commit
29d49b9416263a29a3509becd80f5821e28a1b22
by maik
Refactor PlayerInteract class and optimize sign check
This commit optimizes the sign checking in the PlayerInteract class. Instead of multiple checks using different methods, the logic has been centralized to one conditional statement. This helps in reducing redundancies and ensuring code efficiency. (commit: 29d49b9)
Commit
4638cc860b821399ebd468a7d6b8660f077545fd
by maik
Refactor ItemChecker class and simplify sign item check
This commit simplifies the item checking process in the the PreShopCreation event in ItemChecker class. It extracts the item checking logic into a separate method and uses the result for setting the item outcome, making the code more readable and maintainable. (commit: 4638cc8)
Commit
a76a0addb5f0c6513aa7365fa5b194d3953e4e25
by maik
Refactor and simplify item checking in PreShopCreation event
In this commit, the item checking process inside the PreShopCreation event was refactored and simplified for better readability and maintainability. The item checking logic was extracted into separate methods, making the code more streamlined and easier to understand. (commit: a76a0ad)
Commit
4ee899ee026810f12098cf16ab207c91ecbfe2ef
by maik
Refactor UUID handling in shop creation process
This commit contains improvements to the way the ChestShop plugin handles User ID (UUID) during the shop creation process. The getUUIDFor function was tweaked for admin shop identification. A security check was also added to prevent users from creating a shop on behalf of other users unless they have admin permission. The input processing in PreShopCreation event has also been refined. (commit: 4ee899e)
Commit
fd2455795dbd8f6abcca2cd6d7d53d6656e8e8e9
by maik
Refactor sign handling in ChestShopSign class
This commit refactors how sign-related data is handled in the ChestShopSign class. It removes the use of PersistentDataContainer and YamlConfiguration for managing sign-related data, instead directly updating the sign's data in methods. It also introduces usage of ItemChecker to get item names on the sign. (commit: fd24557)
Commit
5aecc9ed588444725760c57c8053f4d0af4dee12
by maik
Enhance ChestShopSign logging and refactor some code
This commit improves the logging in the ChestShopSign's conversion method for better traceability. It now logs information including owner UUID, their full name, and sign coordinates. The way sign-related data is managed has been refactored for a cleaner, more readable code. The PersistentDataContainer check condition has also been corrected. (commit: 5aecc9e)
Commit
8857089ac8823ec56dc5dc5fd44330b96aaf1bd8
by maik
Update NameChecker to handle blank owner names
This commit updates the NameChecker in the ChestShopListener, ensuring that when a blank owner name is provided, it defaults to the player's unique ID. This change facilitates smoother store creation for players and improves data consistency. (commit: 8857089)
Commit
3d7c8c6c494c6304b0d14c588fbf7d847a33565b
by maik
Fix accessor addition logic in ChestShop
This commit refactors the addAccessor command logic in the ChestShop application. It now compares the newAccessor to the actual owner of the chest shop instead of the player's ID. This change ensures more accurate assignment of access permissions. (commit: 3d7c8c6)
Commit
1ecf383745f06d9d7178184a01587546ffe79d6d
by maik
Refactor message when player not found in ChestShop
This commit changes the error message output when the player is not found in the RemoveAccessor and AddAccessor commands in the ChestShop application. Instead of "UNKNOWN_PLAYER", the error message now correctly displays as "PLAYER_NOT_FOUND", providing clearer indication of the issue to the user. (commit: 1ecf383)
Commit
bb9221a33e09f39f4e3749a35c0854082641e3f6
by maik
Add getItemStack method to ChestShopSign
This commit introduces a new getItemStack method in ChestShopSign.java. This method retrieves the ItemStack of the given Sign. If the Sign does not represent a ChestShop, it returns null. This is useful for checking the item details stored in a ChestShop. (commit: bb9221a)
Commit
88b4015a0af7c86f34e27bbd67e88a2699be09fc
by maik
Limit shop owner name and item name length
The code modifications limit the length of the shop owner's name and the item name by using a substring operation in NameChecker.java and ItemChecker.java. The aim is to enhance compatibility and prevent potential display or processing issues due to excessively long names. (commit: 88b4015)
Commit
512ac36b730283617b2120cf7109b08bb1575eae
by maik
Add PreShopCreationItemDisplayNameEvent class
This commit introduces a new class, PreShopCreationItemDisplayNameEvent, which will handle the display name of the items during shop creation. Accompanying changes have also been made to the ItemChecker class to utilize this new event and ensure proper handling of item display names, improving the functionality of the shop creation process. (commit: 512ac36)
Commit
cffeb9dda3169bb1aba2a8bbab533aed2ea3954e
by maik
Refactor item name retrieval in shop creation
Updated MaterialUtil and ItemChecker classes for improved item name retrieval. Removed unused "getName" method in MaterialUtil and replaced item name retrieval in ItemChecker with the new "getSignMaterialName" method. This optimizes item name fetching during shop creation. (commit: cffeb9d)
Commit
5fbe2f0e5fbed3fb513345b7cabdc28819a07255
by maik
Add documentation for PreShopCreationItemDisplayNameEvent
Added Javadoc comments for the PreShopCreationItemDisplayNameEvent class. This class represents an event that is fired before the display name of an item in a shop is created. The final value of displayName will be displayed on the sign of the newly created shop. (commit: 5fbe2f0)
Commit
97a71bc920643c009fb014582485cd3b03b89dc9
by maik
Implement item display name shortener functionality
Introduce the ability to shorten item display names in the ChestShop plugin. New classes and methods provide this functionality, especially when the display name is too long for certain containers. Detailed priority mappings are added for multiple common strings along with relevant tests. Furthermore, additional utility methods have been added for string manipulation and whitespace handling. (commit: 97a71bc)
Commit
4073ecf39f73a7f29a31d0a651c98ba74aba6d16
by maik
Refactor sign display and logger update in ChestShop
Reorganized the flow of data in ChestShopSign class by separating sign display update and logging process. The method `updateSignDisplay` has been introduced to handle sign data updates, improving the modularity of the code and increasing readability. The logger now only logs when necessary, reducing the frequency of logger calls. (commit: 4073ecf)
Commit
2a893d6ad2f6278093d39e26e5c67baaf6255913
by maik
Modify item name shortening to be case-insensitive
This update modifies the item name shortening feature in ChestShop by switching the keyed names to lowercase first, ensuring case-insensitive comparison. Test cases for the new functionality were also added. Furthermore, a safety measure was implemented where `substring` will not exceed `cutdown.length`, preventing unforeseen StringIndexOutOfBoundsException. (commit: 2a893d6)
Commit
c028bec03ceb2ae90bd04f992022ca5ab6150f8b
by maik
Refine item name shortening and related test cases
This commit improves the item name shortening operation to be case-insensitive by converting keyed names to lowercase first. It also introduces new test cases to verify the updated functionality. Additionally, it implements a safeguard to ensure the 'substring' function does not exceed the 'cutdown.length', thereby avoiding potential StringIndexOutOfBoundsException issues. (commit: c028bec)
Commit
032ce1c701e4b53f4b03e676404262c7ffaf2e31
by maik
Update test strings in ItemCheckerTest class
The commit modifies test strings in different methods of the ItemCheckerTest class. The new test strings seem to emphasize the concept of tests, aimed to ensure that the shortenDisplayName method works as expected for different input cases. (commit: 032ce1c)
Commit
0942068d55ac292d7470434284776ee22e7efc5d
by maik
Refactor item name shortening and sign update process
This commit refines the item name shortening process in 'ChestShopItemDisplayNameShortener' by removing unnecessary mappings and adjusting others. It also optimizes the ChestShopSign update process by avoiding unnecessary sign display updates and checking once if the object is a ChestShop sign. (commit: 0942068)
Commit
73a19a9d93c378b1fca61253f8822eaae41f7a5b
by maik
Adjust accessor related messages to non-final
This commit changes the accessor related messages in the Messages.java file from final to non-final. By doing this, the system becomes flexible to change these messages at runtime if needed for localization or other purposes. (commit: 73a19a9)
Commit
690ff33650eebf9418a773e6262453790dc6ee13
by maik
Remove unnecessary import and refactor item name handling
This change removes the unused import, MaterialUtil, from ItemChecker.java, and refactors how item names are determined. Instead of using MaterialUtil.getSignMaterialName, we now employ StringUtil.capitalizeFirstLetter to get the item name, which simplifies the code and reduces dependencies. (commit: 690ff33)
Commit
2461e51914e5e0a2ac7041fd177cea06c0fca590
by maik
Reorganize import statements for clarity
Cleaned up and streamlined the arrangement of import declarations in several Java classes. This adjustment improves the readability of code and adheres to good software design principles by grouping together related classes and removing unnecessary blank lines. (commit: 2461e51)
Commit
296e741901c99bf7e0b4ec8987cd140659f3e902
by maik
Updated to provide better organization of import statements
Reorganized and consolidated import declarations in multiple Java files for improved code clarity and readability. This update adheres to software design best practices by grouping related classes closer together, enhancing comprehensibility of the code structure. (commit: 296e741)
Commit
238f8b5c24dcf4e2edd73a25cffb8522ca498144
by maik
Refactor import statements across multiple classes
A sweeping change has been made to the import statements of many classes, hereby enhancing readability and understandability in the codebase. This involves reorganizing and consolidating the import statements so as to group similar function classes together, providing for an efficient understanding of code dependencies. (commit: 238f8b5)
Commit
6e2e0f01f10dcb7e4ad06eff307353e1e5a80342
by maik
Implement new chest shop management commands
Three new command classes (SetAmount, SetPrice, SetItem) have been added to the ChestShop java module. These commands allow players to modify key parameters (i.e., the amount, price, and item of a chest shop) directly, improving ongoing shop management capabilities. These changes have also been integrated into the ChestShop.java Executor configuration. (commit: 6e2e0f0)
Commit
00bdbb01f0767fe053a9424554c86db171721c09
by maik
Refine pattern matching and add logging in ChestShop app
The regular expression pattern used for matching shop sign text in the ChestShopSign.java file has been updated to allow new characters. In addition, a new logging entry has been added, outputting warning messages whenever a set of lines does not match the expected sign pattern. This will help in debugging and identifying any potential issues with the sign creation process. (commit: 00bdbb0)
Commit
d9c4cc4eeb0c33585c60edbae55555e062d4e82a
by maik
Refactor sign creation and remove redundant code
Moved the instantiation of the Sign object to an earlier point in SignCreate.java, ensuring it is only created once. Furthermore, redundant code that manually updated sign lines in SetAmount.java, SetPrice.java, and SetItem.java was removed, to simplify and clean the overall codebase. (commit: d9c4cc4)
Commit
e6fdfa372184e44fba0081237ca646887c321788
by maik
Refactor PlayerInteract for better ChestShop usage
This commit includes changes to the 'PlayerInteract.java' code to streamline its functioning with 'ChestShop'. The revisions largely revolve around replacing ChestShopSign methods with equivalent methods in ChestShopMetadata, in order to provide a neater and more direct access to the shop's information. This revamped approach results in more concise, readable code and directly enhances the performance by reducing unnecessary method calls. (commit: e6fdfa3)
Commit
9642e38d9adc11e8c68b0fc01e5cdc1a9d0edc98
by maik
Update code to use ChestShopMetaData for shop information management
In this commit, methods from the ChestShopSign class were replaced with equivalent methods in the new ChestShopMetaData class across multiple files. This centralized approach allows for a more efficient and direct access to the shop's data, enhancing code readability, and reducing redundant method calls for improved performance. (commit: 9642e38)
Commit
5f851a3beb3a37a56faa67f8d909dedc12892eb0
by maik
Remove author tags in RemoveAccessor and AddAccessor classes
In this commit, the author tags in both the RemoveAccessor and AddAccessor classes are being removed. These comments did not directly contribute to the functionality of the code, and thus were deemed unnecessary and removed for clarity. (commit: 5f851a3)
Commit
4ce286666c72e5c1115e1d940f1fd8d65f847f81
by maik
Refactor null check for itemStack in PreShopCreationEvent class
The conditional statement to check if itemStack is null in the PreShopCreationEvent class has been refactored. The outcome update statement is now enclosed within a block, improving the readability and clarity of the if-statement in the code. (commit: 4ce2866)
Commit
a9e736f5fb630c05a660ef222835662330350535
by maik
Update ChestShopSign for better metadata handling
ChestShopSign metadata handling has been improved by encapsulating the sign update within the validity check. The method for updating the sign display has also been restructured to firstly fetch the relevant ChestShopMetaData before proceeding, providing a more efficient processing order. (commit: a9e736f)
Commit
2d073f79ddf2c688515f6ec9626bf294f09f7783
by maik
Improve the error checking mechanism for the `ChestShopSign` metadata handling by introducing a validation layer. This layer will delay the metadata saving task, allowing the system to verify its correctness before execution, hence improving data integrity. The async task is scheduled with a one tick delay to ensure a smoother operation even under potential exceptions. (commit: 2d073f7)
Commit
9fd2c5bb2e871cb355080034e0ae4c38888d3d79
by maik
Update comparison logic in ItemNaming class
Revised the conditional comparison logic in the `PriorityItemDisplayNameShortener` class from equality check to containment check. This change enhances flexibility in checking and handling item names, allowing names in the 'from' section to match more widely with those in the 'to' section, reducing the chance of mismatch errors. (commit: 9fd2c5b)
Commit
2dcccc09fe09a86387d1548bf4e00f4ca61726b4
by maik
Revised item info display and added new methods
Modified the ItemInfo class to enhance the way items names are displayed, including full name and sign item name. Added a 'getDisplayName' method in the ItemChecker class to increase versatility and support further code development. (commit: 2dcccc0)