Skip to content

Commit

Permalink
HOTFIX FOR NEWER DATA ATTRIBUTES
Browse files Browse the repository at this point in the history
  • Loading branch information
bibi-reden committed Aug 6, 2024
1 parent afd66d0 commit 6cc5df1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Changes 🌽
- Fixed out-of-bounds exception when registering a menu.
- Renamed `rootComponent` in `MenuComponent` -> `screenRoot` to refer to the actual screens root.
- If you plan on using this component, know that you can access the functions/members you need directly from the object itself.
- Uses the latest DataAttributes (beta.9) & OfflinePlayerCache.
- The namespace of DataAttributes got changed on this update, breaking the ability to use the mod with the latest one. This has been addressed now.
- This patches an issue when updating modifiers (for I forgot to update PlayerEX when changing namespaces.)
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ parchment_version=1.20.1:2023.09.03
quilt_mappings_version=23

# Mod Properties
mod_version=4.0.0+1.20.1-alpha.11
mod_version=4.0.0+1.20.1-alpha.12
maven_group=com.bibireden.playerex
archives_base_name=playerex-directors-cut

Expand All @@ -30,8 +30,8 @@ placeholder_api_version=2.1.1+1.20
ranged_weapon_api_version=1.1.2+1.20.1

# in-house
opc_version=2.0.0+1.20.1-beta.2-fabric
data_attributes_version=2.0.0-beta.8+1.20.1-fabric
opc_version=2.0.0+1.20.1-beta.4-fabric
data_attributes_version=2.0.0+1.20.1-beta.9-fabric

# owo
owo_version=0.11.2+1.20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class PlayerDataComponent(
private fun trySet(key: ResourceLocation, value: Double): Boolean {
val (instance, isPlayerEXModifierPresent) = this.getInstance(key) ?: return false
if (isPlayerEXModifierPresent) {
(instance as IEntityAttributeInstance).updateModifier(PlayerEXModifiers.UUID, value)
instance.`data_attributes$updateModifier`(PlayerEXModifiers.UUID, value)
}
else {
instance.addPermanentModifier(AttributeModifier(PlayerEXModifiers.UUID, "PlayerEX Attribute", value, AttributeModifier.Operation.ADDITION))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.bibireden.playerex.factory

import com.bibireden.opc.api.OfflinePlayerCacheAPI
import com.bibireden.opc.api.ext.getEntry
import com.bibireden.playerex.PlayerEX
import com.bibireden.playerex.api.PlayerEXCachedKeys
import com.bibireden.playerex.api.PlayerEXCachedKeys.Level
import com.bibireden.playerex.ext.level
import eu.pb4.placeholders.api.PlaceholderHandler
import eu.pb4.placeholders.api.PlaceholderResult
Expand All @@ -24,7 +26,7 @@ object PlaceholderFactory {
var i = 0

for (name: String in namesIn) {
cache.getEntry(PlayerEXCachedKeys.Level::class.java, name).ifPresent {
cache.getEntry<Level>(name).ifPresent {
names[i] = Pair(name, it.level)
i++
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"java": ">=17",
"fabric-api": "*",
"fabric-language-kotlin": ">=1.10.19+kotlin.1.9.23",
"data_attributes": ">=2.0.0-beta.7+1.20.1-fabric",
"data_attributes": ">=2.0.0+1.20.1-beta.9-fabric",
"ranged_weapon_api": ">=1.1.0+1.20.1"
},
"custom": {
Expand All @@ -60,7 +60,7 @@
"dependencies": [
"fabric-api@>=0.92.2+1.20.1(required){modrinth:P7dR8mSH}{curseforge:306612}#(ignore:github)",
"fabric-language-kotlin@>=1.9.5+kotlin.1.8.22(required){modrinth:Ha28R6CL}{curseforge:308769}#(ignore:github)",
"data-attributes-directors-cut@>=2.0.0-beta.7+1.20.1-fabric(required){modrinth:KCGxOJsE}{curseforge:955929}#(ignore:github)",
"data-attributes-directors-cut@>=2.0.0+1.20.1-beta.9-fabric(required){modrinth:KCGxOJsE}{curseforge:955929}#(ignore:github)",
"[email protected](required){modrinth:ccKDOlHs}{curseforge:532610}#(ignore:github)",
"ranged_weapon_api@>=1.1.0+1.20.1(required){modrinth:AqaIIO6D}{curseforge:962162}#(ignore:github)",
"[email protected](embedded){modrinth:K01OU20C}{curseforge:318449}#(ignore:github)",
Expand Down

0 comments on commit 6cc5df1

Please sign in to comment.