Skip to content
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

Added NPC and Hologram API #45

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Added NPC and Hologram API #45

wants to merge 28 commits into from

Conversation

NonSwag
Copy link
Member

@NonSwag NonSwag commented Dec 7, 2024

NPC Services

  • Citizens
  • zNPC
  • ServerNPC
  • Fallback implementation

Hologram Services

  • CMI
  • GHolo
  • FutureHolograms
  • FancyHolograms
  • DecentHolograms
  • Fallback implementation

This commit deletes the Lombok compile-only and annotation processor dependencies from the build script.
Introduce a new Viewable interface to handle adding and removing players who can view objects in the game environment. This interface provides methods for managing viewers and tracking visibility to enhance control over object-player interactions.
Introduce interfaces for Hologram, HologramLine, and HologramController to manage and manipulate holograms. This includes methods for creating, managing, and retrieving hologram lines and instances, enhancing modularity and API structure.
Introduce interfaces Character, PlayerCharacter, and CharacterController to support NPC creation and management in the application. These interfaces provide methods for generating characters with various attributes and profiles. This change sets the foundation for extending NPC functionalities and integrating with the existing entity framework.
Introduce CharacterEvent as a base event class for character interactions and PlayerInteractCharacterEvent to handle player interaction with characters. The new classes include necessary methods and implement interfaces like Cancellable to manage event cancellations effectively.
The PlayerCharacter interface had redundant getProfile and setProfile methods that are already available in the Player interface. This change streamlines the interface by removing unnecessary methods, reducing potential confusion and maintenance effort.
@NonSwag NonSwag added the enhancement New feature or request label Dec 7, 2024
@NonSwag NonSwag self-assigned this Dec 7, 2024
This was linked to issues Dec 7, 2024
Reorder methods in the Viewable interface and add new visibility-related methods. Introduce methods to handle object visibility state and display range management such as isInvisible, setVisibleByDefault, and setDisplayRange. This enhances control over how viewership is managed for objects implementing this interface.
This commit introduces a new enum, LineType, to categorize different types of content that can be used in holograms, including BLOCK, ENTITY, ITEM, and TEXT. Each enum constant is associated with a specific class type, enabling clearer distinctions and enforcing type safety within the hologram API. This addition enhances the flexibility and robustness of the hologram service by allowing structured
Revamp the HologramLine interface to extend from the Viewable interface and use generics for content type flexibility. Added methods for handling new attributes like EntityId, UUID, and location specifics to improve entity management. Updated existing methods to support setting and retrieving diverse content types more efficiently.
Removed Entity inheritance and introduced teleport methods using CompletableFuture for async operations. Added methods to manage hologram lines and properties, including glowing state, location, and server context, to improve control and flexibility.
This update enhances the HologramController by introducing entity-specific lines, allowing more flexible hologram content. Generics are applied to the `HologramLine` to ensure type safety across different line types. The method signatures have been updated accordingly to maintain consistency and clarity.
Renamed teleport methods to teleportAsync to prevent conflicts with superclass implementations of CraftEntity. This change ensures compatibility and prevents method name clashes that could cause issues in extended implementations.
Introduce a new interface Persistable to manage persistence logic. This interface extends Keyed and includes methods to check persistence status, persist an object, and set persistence state. This addition facilitates consistent handling of persistence across implementations.
Enhance the Viewable interface by adding methods to retrieve location, server, and world information. This update also introduces methods to access precise coordinates and orientation details such as x, y, z, pitch, and yaw. These additions provide a more comprehensive framework for interacting with viewable entities in the service API.
Hologram and Character interfaces now extend the Persistable interface, enhancing the capability to persist their state.
Relocated location-related methods from Hologram and HologramLine classes to the Viewable interface to improve code organization and modularity. This change centralizes functionality in the Viewable interface, promoting reusability and cleaner class structures.
The methods isGlowing() and setGlowing(boolean glowing) have been deleted from the Hologram interface.
Introduced two new methods, removeLine by index and by object, to enhance the functionality of the Hologram interface. These additions provide greater flexibility for managing hologram lines by allowing removal based on either the index or the specific line object.
Remove the use of Optional in the createCharacter method, returning a Character directly. This change clarifies the API by ensuring a Character is always returned, allowing for more straightforward usage of this method.
This update includes DecentHolograms version 2.8.12 as a compile-only dependency in the build configuration. The change also registers DecentHolograms as a server dependency that loads before others but is not required. This integration supports enhanced hologram features in the plugin.
Simplified the `LineType` enum and restructured the `HologramController` to support named holograms and entity types. Introduced the `Positioned` interface, clarifying positioning logic by removing redundant methods in `Viewable` and `HologramLine`. Added methods for bulk line operations in `Hologram`, improving API usability.
Introduce DecentHologram and related classes to integrate with the `eu.decentsoftware.holograms` API. This addition includes comprehensive support for creating, managing, and manipulating hologram lines of various types such as text, block, entity, and item. The commit enhances the system's capability to handle complex hologram structures using the DecentHologramController.
Implemented the getName method in both HologramController interface and DecentHologramController class. This change is intended to return the name of the hologram implementation being used, providing more clarity and consistency across the codebase.
Introduce HologramController and integrate DecentHologramController for hologram services. Implement methods to load and hook hologram services with appropriate logging and service registration. This change enhances the plugin's functionality by supporting hologram features.
Introduced a new private method to load economy services, emphasizing it is for debugging and print purposes only. This change involves initializing the EconomyController in a similar fashion to other services, but with no operational effect beyond logging.
Streamlined the service provider logging logic to reduce complexity and improve readability. Added logging for economy and hologram providers, ensuring all relevant providers are checked and logged consistently. This change improves maintainability and helps quickly identify available or missing service providers.
This commit introduces the HologramArgumentType to manage hologram-related arguments within commands and updates the ServiceConvertCommand to handle hologram conversions. The HologramConverter class facilitates the conversion of holograms between different controllers by migrating properties such as viewers, display range, and visibility attributes.
Implement support for hologram services by adding relevant properties, commands, and methods. This update includes error messages for missing hologram services and extends the ServiceInfoCommand to handle hologram information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generalized Hologram API Generalized NPC API
1 participant