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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@ object MyCommand : Command("mycommand", "My first command") {

// In your ManagedLifecycle's onLoad:
override fun onLoad() {
Backbone.Handlers.COMMAND.register(MyCommand)
Backbone.Handler.COMMAND.register(MyCommand)
}

// In your ManagedLifecycle's onUnload:
override fun onUnload() {
Backbone.Handlers.COMMAND.unregister(MyCommand)
Backbone.Handler.COMMAND.unregister(MyCommand)
}
```

Expand Down Expand Up @@ -395,7 +395,7 @@ object GuardEntity : CustomEntity<Zombie>("guard", EntityType.ZOMBIE) {

// In your ManagedLifecycle's onLoad:
override fun onLoad() {
Backbone.Handlers.ENTITY.register(GuardEntity)
Backbone.Handler.ENTITY.register(GuardEntity)
}

// You can then spawn the entity, for example, using a command
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "net.integr"
version = "1.4.0"
version = "1.5.0"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ object EntityHandler : Listener {
entities[entity.id] = entity
}

/**
*
* Unregisters a custom entity.
*
* @param entity The custom entity to register.
* @since 1.5.0
*/
fun <T : Mob> unregister(entity: CustomEntity<T>) {
entities.remove(entity.id)
}


/**
* Spawns a custom entity by its ID at the given location in the specified world.
*
Expand Down
10 changes: 10 additions & 0 deletions src/main/kotlin/net/integr/backbone/systems/item/ItemHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ object ItemHandler : Listener {
items[item.id] = item
}

/**
* Unregisters a [CustomItem] from the system.
*
* @param item The [CustomItem] to register.
* @since 1.0.0
*/
fun unregister(item: CustomItem) {
items.remove(item.id)
}

/**
* Creates a new [ItemStack] for a registered custom item using its default state.
*
Expand Down
Loading