Skip to content

Commit

Permalink
alpha.9
Browse files Browse the repository at this point in the history
  • Loading branch information
bibi-reden committed Jul 20, 2024
1 parent 2dcc1d2 commit 9e74356
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 2 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
## Additions 💫
- Added the `DefaultAttributeFactory`, which can be used in mods to add extra defaults to the config.
- Currently, it is limited to hard-code,
- Added `EntityAttributeSupplier` to the mod again.
- Its purpose is just to be a wrapper on lazily evaluated `EntityAttribute` values.
## Changes ⚙️
- Applied small fix to `DefaultAttributeFactory`.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ loom_version=1.7-SNAPSHOT
minecraft_version=1.20.1
fabric_kotlin_version=1.11.0+kotlin.2.0.0
fabric_api_version=0.92.2+1.20.1
mod_version=2.0.0-alpha.8+1.20.1
mod_version=2.0.0-alpha.9+1.20.1
loader=fabric

yarn_mappings=1.20.1+build.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ object DefaultAttributeFactory {
/** Registers default [EntityTypeData]'s to the config if they are not present currently within the config. */
fun registerEntityTypes(entityTypes: Map<Identifier, EntityTypeData>) {
val current = DataAttributes.ENTITY_TYPES_CONFIG.entity_types.toMutableMap()
entityTypes.forEach { (id, types) -> current.computeIfAbsent(id) { types } }
entityTypes.forEach { (id, types) ->
current.computeIfAbsent(id) { types }
current[id]!!.data.toMutableMap().putAll(types.data)
}
DataAttributes.ENTITY_TYPES_CONFIG.entity_types = current
DataAttributes.ENTITY_TYPES_CONFIG.save()
}
Expand Down

0 comments on commit 9e74356

Please sign in to comment.