Skip to content

Commit

Permalink
Promote a few methods in ComponentKey to stable API
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Nov 23, 2020
1 parent fbe3c61 commit af1128d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public final Class<C> getComponentClass() {
*/
// overridden by generated types
@Contract(pure = true)
@ApiStatus.Experimental
public abstract <V> @Nullable C getNullable(V provider);

/**
Expand All @@ -98,7 +97,6 @@ public final Class<C> getComponentClass() {
public abstract <V> Optional<C> maybeGet(@Nullable V provider);

@Contract(pure = true)
@ApiStatus.Experimental
public <V> boolean isProvidedBy(V provider) {
return this.getNullable(provider) != null;
}
Expand Down Expand Up @@ -164,7 +162,6 @@ public <V> void sync(V provider, int syncOp) {
* @throws NoSuchElementException if the provider does not provide this type of component
* @throws ClassCastException if <code>provider</code> does not implement {@link ComponentProvider}
*/
@ApiStatus.Experimental
public <V> void sync(V provider, ComponentPacketWriter packetWriter) {
C c = this.get(provider);
if (c instanceof AutoSyncedComponent) {
Expand All @@ -185,7 +182,6 @@ public <V> void sync(V provider, ComponentPacketWriter packetWriter) {
* @throws NoSuchElementException if the provider does not provide this type of component
* @throws ClassCastException if <code>provider</code> does not implement {@link ComponentProvider}
*/
@ApiStatus.Experimental
public <V> void sync(V provider, ComponentPacketWriter packetWriter, PlayerSyncPredicate predicate) {
ComponentProvider prov = (ComponentProvider) provider;
if (!prov.supportsCustomComponentPacketWriters()) {
Expand Down
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
------------------------------------------------------
Version 2.7.8
------------------------------------------------------
Changes
- Promoted `ComponentKey#sync(provider, writer)`, `ComponentKey#sync(provider, writer, predicate)`,
`ComponentKey#isProvidedBy`, and `ComponentKey#getNullable` to stable API

Fixes
- Fixed backward compatibility with SyncedComponent

------------------------------------------------------
Version 2.7.7
------------------------------------------------------
Expand Down

0 comments on commit af1128d

Please sign in to comment.