Skip to content

Commit

Permalink
Update to 1.16-pre5
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jun 13, 2020
1 parent ee20811 commit b919d8f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@ public interface ChunkSyncedComponent<C extends Component> extends ChunkComponen

Chunk getChunk();

/**
* {@inheritDoc}
* @implNote The default implementation should generally be overridden.
* This implementation performs a linear-time lookup on the provider to find the component type
* this component is associated with.
* Implementing classes can nearly always provide a better implementation.
*/
@Override
default ComponentType<?> getComponentType() {
default ComponentType<? super C> getComponentType() {
return TypeAwareComponent.lookupComponentType(ComponentProvider.fromChunk(this.getChunk()), this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public interface EntitySyncedComponent extends BaseSyncedComponent {

Entity getEntity();

/**
* {@inheritDoc}
* @implNote The default implementation should generally be overridden.
* This implementation performs a linear-time lookup on the provider to find the component type
* this component is associated with.
* Implementing classes can nearly always provide a better implementation.
*/
@Override
default ComponentType<?> getComponentType() {
return TypeAwareComponent.lookupComponentType(ComponentProvider.fromEntity(this.getEntity()), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@
import nerdhub.cardinal.components.api.ComponentType;
import nerdhub.cardinal.components.api.component.Component;
import nerdhub.cardinal.components.api.component.extension.CopyableComponent;
import org.jetbrains.annotations.ApiStatus;

public interface ItemComponent<C extends Component> extends Component, CopyableComponent<C> {

@Override
boolean isComponentEqual(Component other);

/**
* @deprecated do not call or override this method, it will be removed eventually.
*/
@ApiStatus.ScheduledForRemoval
@Deprecated
@Override
default ComponentType<?> getComponentType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public interface WorldSyncedComponent extends BaseSyncedComponent {

World getWorld();

/**
* {@inheritDoc}
* @implNote The default implementation should generally be overridden.
* This implementation performs a linear-time lookup on the provider to find the component type
* this component is associated with.
* Implementing classes can nearly always provide a better implementation.
*/
@Override
default ComponentType<?> getComponentType() {
return TypeAwareComponent.lookupComponentType(ComponentProvider.fromWorld(this.getWorld()), this);
Expand Down
15 changes: 13 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
------------------------------------------------------
Version 2.4.0
------------------------------------------------------
### 2.4.0-nightly.1.16-pre4
- **Internals and experimental APIs have been relocated. This *will* break compatibility between modules of different versions.**
### 2.4.0-nightly.1.16-pre5
- `cardinal-components-item` no longer alters the layout of packets encoding ItemStacks
- Added a `PlayerComponent` interface that can replace `RespawnCopyStrategy`
- Removed some experimental not very useful methods in ComponentRegistry
Expand All @@ -13,6 +12,10 @@ some classes have been moved to a new module called `cardinal-components-util`.
If you are missing some types, or if you use the `cardinal-components-block` module,
you need to add a dependency on that module.**

**Compatibility between modules of different versions has been broken in 2.4.0-nightly.1.16-pre4.**
In case of crashes due to those incompatibilities, Modpack makers and players can add the latest version
of the full library to their mods folder to update every module at once.

- Updated entity, item, chunk, world, and level modules to MC 1.16

Additions
Expand All @@ -25,15 +28,23 @@ Additions
- Added `ItemComponentCallbackV2` and `ItemComponentFactoryV2` as alternatives respectively to `ItemComponentCallback` and `ItemComponentFactory`,
passing the stack's true item as context.
- Added `Dynamic` conversion methods to `NbtSerializable` (defaulted to delegate to nbt serialization)
- Added `PlayerComponent`, an experimental interface replacing `RespawnCopyStrategy`

Changes
- TypeAwareComponent now has a default implementation in most subinterfaces
- It is no longer possible for a `ComponentCallback` to override an existing component
- Networking errors should now be logged before they get swallowed by Netty
- `cardinal-component-item` should no longer prevent players from connecting to vanilla servers
- Internal classes and new interfaces are now in the `dev.onyxstudios.cca` package

Fixes
- Fixed `PlayerSyncCallback` not firing when a player is teleported to another dimensions through commands
- Fixed Cardinal-Components-Item preventing vanilla clients from connecting to modded servers and vice-versa

------------------------------------------------------
Version 2.3.7
------------------------------------------------------
- Fixed Cardinal-Components-Item crashing with Optifine (thanks to ZekerZhayard)

------------------------------------------------------
Version 2.3.6
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
org.gradle.jvmargs = -Xmx3G

#see https://modmuss50.me/fabric.html
minecraft_version=1.16-pre4
minecraft_version=1.16-pre5
yarn_mappings=1
loader_version=0.8.7+build.201

#Fabric api base
fabric_api_version=0.11.10+build.359-1.16
fabric_api_version=0.12.1+build.361-1.16

#Publishing
mod_version = 2.4.0-nightly.1.16-pre4
curseforge_id = 318449
curseforge_versions = 1.16-Snapshot
changelog_url = https://github.com/OnyxStudios/Cardinal-Components-API/changelog.md
changelog_url = https://github.com/OnyxStudios/Cardinal-Components-API/blob/master/changelog.md
release_type = beta
#api_package = nerdhub.cardinal.components.api

Expand Down

0 comments on commit b919d8f

Please sign in to comment.