Skip to content

v1.8.0

Choose a tag to compare

@theEvilReaper theEvilReaper released this 12 Aug 19:50
e4a2cf2

1.8.0 - Changelog

📚 Documentation

The project documentation is now available via the sources jar, making it easier to access API documentation directly from your IDE.

🎯 Component System

This release introduces a flexible component system that reduces inheritance overhead and provides better extensibility for Kits and Teams. The system is built around the ObjectComponent interface.

Creating Custom Components

Components can be implemented as records or regular classes depending on your needs:

import net.theevilreaper.xerus.api.component.ObjectComponent;
import org.jetbrains.annotations.NotNull;

public record MyComponent(...) implements ObjectComponent {
    // Your component implementation
}

⚠️ Breaking Changes

New Componentable Interface

Both Teams and Kits now inherit from the Componentable interface, providing these methods for component management:

<T extends ObjectComponent> void add(@NotNull Class<T> componentClass, @NotNull T component);
<T extends ObjectComponent> boolean has(@NotNull Class<T> componentClass);
<T extends ObjectComponent> @Nullable T get(@NotNull Class<T> componentClass);
<T extends ObjectComponent> @Nullable T remove(@NotNull Class<T> componentClass);

Team Changes

  • Removed: TranslatedTeams implementation - create a custom component for translation functionality
  • Removed: ColorData from teams - use the ColorComponent class instead
  • Changed: Team identifiers now use Adventure's Key instead of strings

Kit Changes

  • Removed: TranslatedKit integration - implement your own translation component
  • Changed: Name identifiers replaced with Adventure's Key
  • Restructured: Kits are now more focused data classes with player application capabilities

Example Kit Implementation

public class TestKit extends BaseKit {
    
    public TestKit() {
        super(Key.key("xerus", "test_kit"));
    }
    
    public TestKit(@NotNull Key key) {
        super(key);
    }
    
    @Override
    public void apply(@NotNull Player player) {
        // Implement your kit application logic here
        throw new UnsupportedOperationException("Not yet implemented");
    }
}

🔧 Technical Notes

The component system allows for better separation of concerns and makes the library more modular. Each component can handle specific functionality without cluttering the main class interfaces.