-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de38a16
commit 8ff53fb
Showing
3 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
src/main/kotlin/com/edelweiss/playerex/PlayerEXDCEntityComponents.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
package com.edelweiss.playerex | ||
|
||
import com.edelweiss.playerex.api.PlayerEXDCApi | ||
import com.edelweiss.playerex.components.PlayerEntityComponent | ||
import com.edelweiss.playerex.components.LivingEntityComponent | ||
import dev.onyxstudios.cca.api.v3.component.ComponentKey | ||
import dev.onyxstudios.cca.api.v3.component.ComponentRegistry | ||
import dev.onyxstudios.cca.api.v3.entity.EntityComponentFactoryRegistry | ||
import dev.onyxstudios.cca.api.v3.entity.EntityComponentInitializer | ||
import net.minecraft.entity.LivingEntity | ||
|
||
class PlayerEXDCEntityComponents : EntityComponentInitializer { | ||
val playerEntities: ComponentKey<PlayerEntityComponent> = ComponentRegistry.getOrCreate(PlayerEXDCApi.createID("player_entities"), PlayerEntityComponent::class.java) | ||
val livingEntities: ComponentKey<LivingEntityComponent> = ComponentRegistry.getOrCreate(PlayerEXDCApi.createID("living_entities"), LivingEntityComponent::class.java) | ||
override fun registerEntityComponentFactories(registry: EntityComponentFactoryRegistry) { | ||
registry.registerForPlayers(playerEntities) { PlayerEntityComponent() } | ||
registry.registerFor(LivingEntity::class.java, livingEntities) { LivingEntityComponent() } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters