-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update/4.1 #109
Open
cooffeeRequired
wants to merge
28
commits into
main
Choose a base branch
from
update/4.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update/4.1 #109
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ynamically enable or disable different sub addons of SkJson as like cache, json itself, http handling or either nbt, also new Registering API allows handle the registration handle by global knowns patterns as LIKE SOLID, KISS, DRY, YAGNI, GRASP
- Přidána podpora pro registraci více modulů pomocí @ExternalAPI anotace v třídě Register.java. - Přidáno několik tříd a metod pro integraci se Skript pluginem, včetně skriptovaných efektů, výrazů, událostí a funkcí. - Implementována metoda printAllRegistered pro výpis všech registrovaných elementů. - Přidán nový SkriptRegister pro zjednodušení registrace Skript elementů. - Přidáno zvýraznění v konzolových zprávách pomocí metody coloredElement. - V CustomLogger.java přidány getter metody pro konstanty a zlepšeno logování chyb a informací. - Rozšířena třída SkJson o novou instanci Configuration a přidání plánované aktualizace konfigurace při načítání pluginu.
- Přidána podpora pro registraci více modulů pomocí @ExternalAPI anotace v třídě Register.java. - Přidáno několik tříd a metod pro integraci se Skript pluginem, včetně skriptovaných efektů, výrazů, událostí a funkcí. - Implementována metoda printAllRegistered pro výpis všech registrovaných elementů. - Přidán nový SkriptRegister pro zjednodušení registrace Skript elementů. - Přidáno zvýraznění v konzolových zprávách pomocí metody coloredElement. - V CustomLogger.java přidány getter metody pro konstanty a zlepšeno logování chyb a informací. - Rozšířena třída SkJson o novou instanci Configuration a přidání plánované aktualizace konfigurace při načítání pluginu. - Added support for registering multiple modules using the @ExternalAPI annotation in the Register.java class. - Added several classes and methods for integration with the Skript plugin, including scripted effects, expressions, events, and functions. - Implemented the printAllRegistered method to list all registered elements. - Added a new SkriptRegister for simplifying the registration of Skript elements. - Added highlighting in console messages using the coloredElement method. - Added getter methods for constants in CustomLogger.java and improved error and information logging. - Extended the SkJson class with a new Configuration instance and added scheduled configuration update during plugin loading.
- Added support for registering multiple modules using the @ExternalAPI annotation in the Register.java class. - Added several classes and methods for integration with the Skript plugin, including scripted effects, expressions, events, and functions. - Implemented the printAllRegistered method to list all registered elements. - Added a new SkriptRegister for simplifying the registration of Skript elements. - Added highlighting in console messages using the coloredElement method. - Added getter methods for constants in CustomLogger.java and improved error and information logging. - Extended the SkJson class with a new Configuration instance and added scheduled configuration update during plugin loading.
…ions - Added BukkitSerializableAdapter class, which implements JsonSerializer and JsonDeserializer for objects implementing the ConfigurationSerializable interface. - Modified the Register class: - Added the egisterModules method to allow registering new modules annotated with Module. - Reorganized some methods for better readability and code structure. - Updated the CustomLogger class: - Added the colorize method for formatting text with colors. - Filtered unnecessary logs for better console clarity. - Added the GsonParser class to facilitate working with objects to be serialized into JSON format using Gson. This change improves interoperability with Bukkit configurations and optimizes logging for more efficient debugging.
## Enhancements 1. **New Class Added**: JsonCache.java - A generic caching class for asynchronous handling of JSON elements. - Uses ConcurrentHashMap and CompletableFuture for efficient operations. 2. **New Class Added**: JsonFileWatcher.java - Monitors directories for JSON file changes. - Utilizes WatchService for detecting file modifications. - Schedules tasks with ScheduledExecutorService. 3. **Modified Class**: SkJson.java - Integrated JsonFileWatcher for logging watcher status. - Cleaned up by removing unnecessary JSON serialization/deserialization code. - Removed unused imports and test cases. ## Code Cleanup - Deprecated JSON parsing experiments and legacy test cases have been removed. - Unused imports and random game world object test cases were eliminated for better clarity and maintainability.
## 1. Modifications in CustomLogger - Changed the method colorize from static to instance. `java public Component colorize(String text) { return converter.deserialize(text); } ` ## 2. Updates in SkJson Class - Imported new classes for commands, item management, and JSON parsing. - Added a new command about to display plugin information.
## 1. Modifications in `CustomLogger` - Changed the method `colorize` from static to instance. ```java public Component colorize(String text) { return converter.deserialize(text); } ``` ## 2. Updates in `SkJson` Class - Imported new classes for commands, item management, and JSON parsing. - Added a new command `"about"` to display plugin information. - Created enchanted items (sword, golden apple, enchanted book) with custom metadata and NBT data. - Serialized the created items to JSON and logged them. - Deserialized the JSON back to item objects and logged them. ## 3. Added `GenericFlatObjectAdapter` Class - Implemented a custom JSON serializer and deserializer for handling generic flat objects. ## 4. Updates in `GsonParser` - Registered the new `GenericFlatObjectAdapter` in the `Gson` instance. ```java @Getter final static Gson gson = new GsonBuilder() .serializeNulls() .enableComplexMapKeySerialization() .registerTypeAdapter(ItemStack.class, new NBTFallBackItemStackAdapter()) .registerTypeHierarchyAdapter(ConfigurationSerializable.class, new BukkitSerializableAdapter()) .registerTypeHierarchyAdapter(Object.class, new GenericFlatObjectAdapter<>()) .setPrettyPrinting() .create(); ``` ## 5. Changes in `dependencies.gradle` - Added a new dependency for `snakeyaml`. ```groovy implementation group: 'org.yaml', name: 'snakeyaml', version: '2.3' ```
…le an async operations, also add FileHandler, what contains functions for handle all IO operations for json and yaml files
>[!NOTE] >This commit includes the following changes: ## Added - New class `cz.coffeerequired.api.http.RequestResponse$1` - Added for managing HTTP response specifics in the API. - New class `cz.coffeerequired.api.http.RequestClient` - Introduced for handling HTTP client requests within the API. - New class `cz.coffeerequired.support.Support` - Created to provide additional support utilities for the project. - New class `cz.coffeerequired.SkJson` - The main class for the SkJson plugin, integrating new features and configurations. - New class `cz.coffeerequired.skript.json.ExprNewJson` - Implemented to handle new JSON expressions in Skript. - New class `cz.coffeerequired.api.Commands` - Added for managing plugin commands more effectively. - New class `cz.coffeerequired.api.annotators.ExternalAPI` - Included to handle annotations for external APIs. - New class `cz.coffeerequired.api.http.RequestHeaders` - Added for managing HTTP request headers. - New class `cz.coffeerequired.api.json.bukkit.EventFileWatcher` - Introduced to watch and handle event files for Bukkit. - New class `cz.coffeerequired.api.json.BukkitSerializableAdapter` - Added for serializing and deserializing JSON objects in Bukkit. - New class `cz.coffeerequired.skript.json.EffMapJson` - Implemented to process JSON mappings in Skript.
- remover, changer, setter, getter, counter
…er, counter (#111) **SerializedJson** - searcher - - searcher.get() ✅ [Objects] - counter - - counter.keys() ✅ [Objects] - - counter.values() ✅ [Arrays,Objects] - changer - - changer.key() ✅ [Objects] - - changer.values() ✅ [Arrays,Objects] - remover - - remover.byValue() ✅ [Arrays,Objects] - - remover.byIndex()✅[Arrays] - - remover.byKey() ✅[Objects]
This was
linked to
issues
Nov 26, 2024
- remover, changer, setter, getter, counter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request: Major Update to
skJson
ProjectImportant
Breaking Changes
This update includes breaking changes that may impact existing implementations. Please review the changes carefully to adapt your code accordingly.
Summary of Changes
Added Files
ConfigurationSupport.java: Introduced new support functionality for managing configuration files effectively.
HttpModule.java: Added a new module to handle HTTP-related operations, providing extended capabilities for network communication.
GsonParser.java: Implemented a new parser using GSON for better JSON serialization and deserialization.
PluginConfig.java: Added a new utility class for managing plugin configurations.
Register.java: Introduced a new API to streamline the registration process for various components.
Removed Files
ConfigurationSupport.java
.HttpModule.java
.Modified Files
Main.java:
HttpModule
andGsonParser
for improved efficiency.Utils.java:
Breaking Changes
ConfigurationSupport
andHttpModule
. These changes are not backward compatible, and any code that depended on the deprecated classes must be updated.Why These Changes?
Please ensure that your current projects are updated to be compatible with these changes. The changes were made with a focus on improving performance, modularity, and maintainability of the
skJson
project.If you have any questions or run into issues while updating, please let us know!