Skip to content

Commit 1fb828b

Browse files
authored
Merge pull request #9 from integr-dev/develop
Hotfixes
2 parents 8b5a92b + 300a346 commit 1fb828b

4 files changed

Lines changed: 26 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ object MyCommand : Command("mycommand", "My first command") {
299299

300300
// In your ManagedLifecycle's onLoad:
301301
override fun onLoad() {
302-
Backbone.Handlers.COMMAND.register(MyCommand)
302+
Backbone.Handler.COMMAND.register(MyCommand)
303303
}
304304

305305
// In your ManagedLifecycle's onUnload:
306306
override fun onUnload() {
307-
Backbone.Handlers.COMMAND.unregister(MyCommand)
307+
Backbone.Handler.COMMAND.unregister(MyCommand)
308308
}
309309
```
310310

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

396396
// In your ManagedLifecycle's onLoad:
397397
override fun onLoad() {
398-
Backbone.Handlers.ENTITY.register(GuardEntity)
398+
Backbone.Handler.ENTITY.register(GuardEntity)
399399
}
400400

401401
// You can then spawn the entity, for example, using a command

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "net.integr"
10-
version = "1.4.0"
10+
version = "1.5.0"
1111

1212
repositories {
1313
mavenCentral()

src/main/kotlin/net/integr/backbone/systems/entity/EntityHandler.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ object EntityHandler : Listener {
5555
entities[entity.id] = entity
5656
}
5757

58+
/**
59+
*
60+
* Unregisters a custom entity.
61+
*
62+
* @param entity The custom entity to register.
63+
* @since 1.5.0
64+
*/
65+
fun <T : Mob> unregister(entity: CustomEntity<T>) {
66+
entities.remove(entity.id)
67+
}
68+
69+
5870
/**
5971
* Spawns a custom entity by its ID at the given location in the specified world.
6072
*

src/main/kotlin/net/integr/backbone/systems/item/ItemHandler.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ object ItemHandler : Listener {
5454
items[item.id] = item
5555
}
5656

57+
/**
58+
* Unregisters a [CustomItem] from the system.
59+
*
60+
* @param item The [CustomItem] to register.
61+
* @since 1.0.0
62+
*/
63+
fun unregister(item: CustomItem) {
64+
items.remove(item.id)
65+
}
66+
5767
/**
5868
* Creates a new [ItemStack] for a registered custom item using its default state.
5969
*

0 commit comments

Comments
 (0)