Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* * *

## [0.17.0]
## [0.18.0]

### Added

- **`IPartyProvider` default methods: `getOwner`, `getAllParties`, `countClaims`**
- `getOwner(UUID)` — returns the owner UUID of the player's party via `getEffectiveParty(uuid).getOwner()`. Automatically works for both `DefaultPartyProvider` and `BQuPartyProvider`.
- `getAllParties()` — returns all known `Party` objects. `DefaultPartyProvider` overrides to return self-managed parties; `BQuPartyProvider` delegates to fallback.
- `countClaims(UUID)` — returns chunk claims for party members. Both providers override to delegate to `ChunkManagerData.countClaimsForParty(partyId)`.
- **Moderators screen now excludes the Party Owner**
- The Moderators tab no longer shows the owner in the member list, making it easier to promote new moderators without accidentally selecting the current owner.
- Addon developers can now build searchable member panels in a single call with `PartyWidgets.buildMemberPanel()`.

- **`PartyQueryUtil.getOwner(UUID)`** — static convenience method for addon authors to query party owner UUIDs.
### Changed

- **`PartyManagerData.addMember()`, `removeMember()`, `setRole()`** — wrapper methods that maintain the O(1) reverse index on mutation.
- **Significantly improved performance when joining/leaving parties and looking up members**
- Looking up which party you belong to is now much faster, especially in worlds with many parties.
- Joining a party via invite and the server-party auto-join feature are more reliable and maintain consistent member data.

- **`BLPCCommandHelper.resolveParty(EntityPlayerMP)`** — command-layer helper to resolve a player's party, reducing `PartyManagerData.getInstance().getPartyByPlayer()` direct calls in commands.
[0.18.0]: https://github.com/gtexpert/BetterLinkPartyClaim/releases/tag/0.18.0

- **`PartyWidgets.collectSortedMembers(party, exclude, roleFilter)`** — `ModeratorsPanel` uses `roleFilter` to exclude `PartyRole.OWNER` from the list.
* * *

### Changed
## [0.17.0]

### Fixed

- **`PartyManagerData.getPartyByPlayer()` is now O(1)** — replaced O(n) stream scan with a `playerToPartyId` reverse index maintained on every mutation.
- **All `DefaultPartyProvider` mutation methods** now use `PartyManagerData.addMember()`/`removeMember()`/`setRole()` instead of direct `Party.addMember()`/`Party.removeMember()`.
- **All `DefaultPartyProvider` query methods** use `getEffectiveParty()` as the shared source of truth.
- **`PartyAction.Handler`** — `createParty`, `invitePlayer`, `kickOrLeave`, `acceptInvite` post-event party lookups now use `c.selfProvider.getEffectiveParty()` instead of `PartyManagerData.getInstance().getPartyByPlayer()`.
- **`PlayerLoginHandler`** — offline UUID merge and server party auto-join use `PartyManagerData.addMember()`/`removeMember()` to maintain the reverse index.
- **`CoreModule`** — server party creation uses `PartyManagerData.addMember()`.
- **`ListCommand`** — uses `PartyQueryUtil.provider().getAllParties()` instead of `PartyManagerData.getInstance().getAllParties()`.
- **`CoreEventHandler`** — `onWorldSave` uses `PartyProviderRegistry.get().getAllParties()` instead of `PartyManagerData.getInstance().getAllParties()`.
- **Commands** — `MeCommand`, `LeaveCommand`, `AcceptCommand`, `ClaimsCommand`, `KickCommand`, `MoveOwnerCommand` use `BLPCCommandHelper.resolveParty()` or `PartyManagerData` wrapper methods.
- **`ModeratorsPanel`** — uses `PartyWidgets.collectSortedMembers(party, null, r -> r != PartyRole.OWNER)` to filter out OWNER roles.
- **Moderators screen now shows the full member list correctly**
- The Moderators tab no longer accidentally included the party owner when promoting members.
- The list is now properly filtered to show only members who can be promoted (everyone except the owner).

[0.17.0]: https://github.com/gtexpert/BetterLinkPartyClaim/releases/tag/0.17.0

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 10 additions & 21 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ pluginManagement {
}

plugins {
id 'com.diffplug.blowdryerSetup' version '1.7.1'
id 'com.diffplug.blowdryerSetup' version '1.8.0'
// Automatic toolchain provisioning
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
id 'com.gradle.develocity' version '3.19'
id 'com.gradle.develocity' version '4.5.1'
}

develocity {
Expand All @@ -35,7 +35,7 @@ develocity {

blowdryerSetup {
repoSubfolder 'spotless'
github 'GTModpackTeam/Buildscripts', 'tag', 'v1.0.7'
github 'GTModpackTeam/Buildscripts', 'tag', 'v1.0.8'
}

rootProject.name = rootProject.projectDir.getName()
83 changes: 5 additions & 78 deletions src/main/java/com/github/gtexpert/blpc/api/BLPCAPI.java
Original file line number Diff line number Diff line change
@@ -1,90 +1,17 @@
package com.github.gtexpert.blpc.api;

import com.github.gtexpert.blpc.Tags;
import com.github.gtexpert.blpc.api.integration.IntegrationPanelRegistry;
import com.github.gtexpert.blpc.api.modules.IModuleManager;
import com.github.gtexpert.blpc.api.party.IPartyProvider;
import com.github.gtexpert.blpc.api.party.PartyProviderRegistry;
import com.github.gtexpert.blpc.modules.ModuleManager;

/**
* Central access point and discoverability index for BLPC — the first class a new
* contributor or addon author should read.
* A single façade that points at every public subsystem and extension point so nothing has
* to be hunted for.
*
* <h2>Where things live</h2>
* <table>
* <caption>Package map</caption>
* <tr>
* <th>Package</th>
* <th>Contents</th>
* </tr>
* <tr>
* <td>{@code api.modules}</td>
* <td>Module framework SPI ({@code IModule}, {@code @TModule}, containers).</td>
* </tr>
* <tr>
* <td>{@code api.party}</td>
* <td>Party backend SPI ({@link IPartyProvider}, {@link PartyProviderRegistry}).</td>
* </tr>
* <tr>
* <td>{@code api.event}</td>
* <td>Public Forge events addons can subscribe to ({@code ChunkModifiedEvent},
* {@code PartyEvent} — Pre/Post hierarchy for party lifecycle mutations).</td>
* </tr>
* <tr>
* <td>{@code api.util}</td>
* <td>Shared helpers ({@code Mods}, {@code ModUtility}, {@code PartyQueryUtil} — query
* party data without depending on internal packages).</td>
* </tr>
* <tr>
* <td>{@code api.integration}</td>
* <td>{@link IntegrationPanelRegistry} — registry for per-mod settings panels surfaced in the
* party menu's Addons hub.</td>
* </tr>
* <tr>
* <td>{@code common.party} / {@code common.chunk}</td>
* <td>Party &amp; claim data models and persistence.</td>
* </tr>
* <tr>
* <td>{@code common.network}</td>
* <td>Wire messages (multiplexed {@code PartyAction} / {@code ClientNotify}).</td>
* </tr>
* <tr>
* <td>{@code client.gui}</td>
* <td>ModularUI screens. {@code Screens} = catalog of all GUIs, {@code BLPCGuiTextures} = shared drawables,
* {@code GuiColors} = palette.</td>
* </tr>
* <tr>
* <td>{@code integration.*}</td>
* <td>Soft-dependency integrations (BQu, JourneyMap), each behind its own module.</td>
* </tr>
* </table>
*
* <h2>Extension points for addons</h2>
* <ul>
* <li><b>Custom party backend</b> — implement {@link IPartyProvider} and call
* {@link PartyProviderRegistry#register(IPartyProvider, int)} with a priority
* ({@link PartyProviderRegistry#PRIORITY_HIGH} to override BQu,
* {@link PartyProviderRegistry#PRIORITY_LOW} for fallback-only).
* {@code DefaultPartyProvider} is registered at {@link PartyProviderRegistry#PRIORITY_DEFAULT};
* {@code BQuPartyProvider} at {@link PartyProviderRegistry#PRIORITY_HIGH}.</li>
* <li><b>Query party data</b> — use {@code api.util.PartyQueryUtil} ({@code findByName},
* {@code allPartyNames}, {@code pendingInvitesFor}, {@code resolveName}) instead of depending
* on internal packages. Delegates to the active {@link IPartyProvider}.</li>
* <li><b>React to party lifecycle</b> — subscribe to {@code api.event.PartyEvent} on
* {@code MinecraftForge.EVENT_BUS}. {@code Pre} variants (e.g. {@code Pre.Disbanded}) are
* {@code @Cancelable}; {@code Post} variants fire after successful mutations.</li>
* <li><b>React to claims</b> — subscribe to {@code api.event.ChunkModifiedEvent} on the Forge event bus.</li>
* <li><b>Conditional content</b> — annotate a class with {@code @TModule} and declare
* {@code modDependencies}; it is discovered automatically (no manual registration).</li>
* <li><b>Settings panel in the Addons hub</b> — build a ModularUI panel and call
* {@link IntegrationPanelRegistry#register(String, String, java.util.function.BooleanSupplier,
* java.util.function.Function)} from a client-guarded {@code init} (lazy method reference,
* so the panel class is never loaded on a dedicated server). It appears automatically under
* the party menu's Addons entry once the {@code available} predicate returns {@code true}.</li>
* </ul>
* Central entry point for BLPC — {@link #partyProvider()} and {@link #moduleManager()}.
* <p>
* Addon authors should use {@code api.util.PartyQueryUtil} for queries,
* {@code @TModule} for conditional loading, and {@code IntegrationPanelRegistry} for Addons hub panels.
* Full API reference is in {@code DEVELOPER.md}.
*/
public final class BLPCAPI {

Expand Down
Loading
Loading