Repository navigation
v1.12.0
1.12.0 - Changelog
π Performance & Concurrency
This release brings significant internal improvements to both the Team and Kit subsystems. Core data structures have been migrated from ArrayList/HashMap to ConcurrentHashMap-based collections, improving thread safety and lookup performance across the board.
Team System
StandardTeamServicenow uses aConcurrentHashMap<Key, Team>instead ofArrayList<Team>, providing O(1) lookups by key instead of linear scansDefaultTeamusesConcurrentHashMap.newKeySet()for the player set andConcurrentHashMapfor components, making team operations thread-safegetSmallestTeam()now usesStream.min()instead of a manual index-based loopgetTeams()returnsList.copyOf(...)instead ofCollections.unmodifiableList(...)
Kit System
DefaultKitServicenow uses aConcurrentHashMap<Key, Kit>for storage, enabling O(1) kit lookups by keyBaseKitcomponents are now stored in aConcurrentHashMapfor thread-safe accessgetKits()returnsList.copyOf(...)instead ofCollections.unmodifiableList(...)
π Bug Fixes
Team Event Handling
Team join/leave operations now correctly fire events before mutating state. The EventDispatcher.callCancellable(...) callback handles the actual add/remove, ensuring that cancelled events do not alter team membership.
Before (broken):
if (getPlayers().add(player)) {
EventDispatcher.callCancellable(teamEvent, consumer != null ? () -> consumer.accept(player) : EMPTY);
}After (fixed):
if (!canJoin()) return;
PlayerTeamEvent teamEvent = new PlayerTeamEvent(player, this, TeamAction.ADD);
EventDispatcher.callCancellable(teamEvent, () -> {
if (getPlayers().add(player) && consumer != null) {
consumer.accept(player);
}
});Team Distribution Bounds
- Fixed
DefaultTeamDistributor: the unwrap loop now usescontinueinstead ofreturnwhen a team isnull, preventing premature termination of the distribution process
Team Capacity Reset
setCapacity()now allows resetting to the default capacity (-1) without throwing anIllegalArgumentException
Multi-Player Operations
addPlayers()andremovePlayers()now create defensive copies of the input collection before filtering, preventingConcurrentModificationExceptionand unintended mutation of the caller's collectionclearPlayers()now correctly wrapsgetPlayers()in a newHashSet<>before delegating toremovePlayers(...)to avoid modifying the set during iteration
β»οΈ Refactoring
Player Collection API Broadened
The Joinable interface now accepts Collection<Player> instead of Set<Player> for all bulk operations. This is a source-compatible change, existing code using Set<Player> will continue to work without modification.
Changed methods in Joinable:
// Before
void addPlayers(@NotNull Set<Player> players, @Nullable Consumer<Player> consumer);
void removePlayers(@NotNull Set<Player> players, @Nullable Consumer<Player> consumer);
// After
void addPlayers(Collection<Player> players, @Nullable Consumer<Player> consumer);
void removePlayers(Collection<Player> players, @Nullable Consumer<Player> consumer);Annotation Cleanup
Redundant @NotNull annotations have been removed from parameters and return types across the entire API surface. The project now relies on package-level @NonnullByDefault annotations (package-info.java files) instead of annotating every individual parameter.
Affected classes include:
Team,DefaultTeam,TeamService,StandardTeamServiceKit,BaseKit,KitService,DefaultKitServiceJoinable,ItemShiftOption,ColorDataComponentable,ColorComponentGameFinishEvent,PlayerTeamEvent,MultiPlayerTeamEvent,PlayerKitChangeEventTeamDistributor,DefaultTeamDistributor,Splitter,DistributionPlayer,DistributionTeam
β οΈ Breaking Changes
ColorData.DARK_GREY β ColorData.DARK_GRAY
The enum constant has been renamed to follow American English spelling (consistent with Minestom's NamedTextColor.DARK_GRAY).
-ColorData.DARK_GREY
+ColorData.DARK_GRAYTeam.EMPTY Runnable Removed
The static EMPTY runnable field has been removed from the Team interface. Event callbacks now use inline lambdas with null-checks instead.
Joinable Parameter Type Change
Bulk player methods (addPlayers, removePlayers) now accept Collection<Player> instead of Set<Player>. While source-compatible, this may require updates if you used @Override with the old Set<Player> signature.
Full Changelog: 1.11.1...1.12.0