diff --git a/CHANGELOG.md b/CHANGELOG.md index c9811b7c..43088382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ ## Changes 🌽 -- Added "Item Breaking" mechanic -- Added config option for Item Breaking \ No newline at end of file +- Patched to work with Data Attributes `2.X.X+1.20.1`. Update to that for this to work. +- Integrate back all of the attributes and their proper diminishing factor according to **BalanceEX** and some suggestions. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 0f94da8c..8fcacd28 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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-beta.5 +mod_version=4.0.0+1.20.1-beta.7 maven_group=com.bibireden.playerex archives_base_name=playerex-directors-cut @@ -31,7 +31,7 @@ ranged_weapon_api_version=1.1.2+1.20.1 # in-house opc_version=2.0.0+1.20.1-beta.4-fabric -data_attributes_version=2.0.0+1.20.1-beta.13-fabric +data_attributes_version=2.0.1+1.20.1-fabric # owo owo_version=0.11.2+1.20 diff --git a/src/client/kotlin/com/bibireden/playerex/ui/components/AttributeComponent.kt b/src/client/kotlin/com/bibireden/playerex/ui/components/AttributeComponent.kt index afbffaf5..24a85ae2 100644 --- a/src/client/kotlin/com/bibireden/playerex/ui/components/AttributeComponent.kt +++ b/src/client/kotlin/com/bibireden/playerex/ui/components/AttributeComponent.kt @@ -35,8 +35,8 @@ class AttributeComponent(private val attribute: Attribute, private val player: P text.append("\n") text.append(Component.literal(attribute.id.toString()).withStyle(ChatFormatting.DARK_GRAY)) text.append("\n\n") - entries.forEach { function -> - val childAttribute = EntityAttributeSupplier(function.id).get().getOrNull() ?: return@forEach + entries.forEach { (id, function) -> + val childAttribute = EntityAttributeSupplier(id).get().getOrNull() ?: return@forEach val formula = (childAttribute as IEntityAttribute).`data_attributes$formula`() text.apply { diff --git a/src/main/resources/data/playerex/data_attributes/entity_types/stock.json b/src/main/resources/data/playerex/data_attributes/entity_types/stock.json index 11701155..7693cf9c 100644 --- a/src/main/resources/data/playerex/data_attributes/entity_types/stock.json +++ b/src/main/resources/data/playerex/data_attributes/entity_types/stock.json @@ -1,34 +1,90 @@ { "entries": { "minecraft:player": { - "playerex:level": 0.0, - "playerex:constitution": 0.0, - "playerex:strength": 0.0, - "playerex:dexterity": 0.0, - "playerex:intelligence": 0.0, - "playerex:luckiness": 0.0, - "playerex:evasion": 0.0, - "playerex:lifesteal": 0.0, - "playerex:focus": 0.0, - "playerex:health_regeneration": 0.0, - "playerex:heal_amplification": 0.0, - "playerex:melee_crit_damage": 0.0, - "playerex:melee_crit_chance": 0.0, - "playerex:ranged_crit_damage": 0.0, - "playerex:ranged_crit_chance": 0.0, - "playerex:fire_resistance": 0.0, - "playerex:freeze_resistance": 0.0, - "playerex:lightning_resistance": 0.0, - "playerex:poison_resistance": 0.0, - "playerex:wither_resistance": 0.0, - "playerex:breaking_speed": 1.0, - "playerex:enchanting": 0.0, - "playerex:logging": 0.0, - "playerex:alchemy": 0.0, - "playerex:fishing": 0.0, - "playerex:mining": 0.0, - "playerex:smithing": 0.0, - "playerex:farming": 0.0 + "playerex:level": { + "value": 0.0 + }, + "playerex:constitution": { + "value": 0.0 + }, + "playerex:strength": { + "value": 0.0 + }, + "playerex:dexterity": { + "value": 0.0 + }, + "playerex:intelligence": { + "value": 0.0 + }, + "playerex:luckiness": { + "value": 0.0 + }, + "playerex:evasion": { + "value": 0.0 + }, + "playerex:lifesteal": { + "value": 0.0 + }, + "playerex:focus": { + "value": 0.0 + }, + "playerex:health_regeneration": { + "value": 0.0 + }, + "playerex:heal_amplification": { + "value": 0.0 + }, + "playerex:melee_crit_damage": { + "value": 0.0 + }, + "playerex:melee_crit_chance": { + "value": 0.0 + }, + "playerex:ranged_crit_damage": { + "value": 0.0 + }, + "playerex:ranged_crit_chance": { + "value": 0.0 + }, + "playerex:fire_resistance": { + "value": 0.0 + }, + "playerex:freeze_resistance": { + "value": 0.0 + }, + "playerex:lightning_resistance": { + "value": 0.0 + }, + "playerex:poison_resistance": { + "value": 0.0 + }, + "playerex:wither_resistance": { + "value": 0.0 + }, + "playerex:breaking_speed": { + "value": 1.0 + }, + "playerex:enchanting": { + "value": 0.0 + }, + "playerex:logging": { + "value": 0.0 + }, + "playerex:alchemy": { + "value": 0.0 + }, + "playerex:fishing": { + "value": 0.0 + }, + "playerex:mining": { + "value": 0.0 + }, + "playerex:smithing": { + "value": 0.0 + }, + "playerex:farming": { + "value": 0.0 + } } } } \ No newline at end of file diff --git a/src/main/resources/data/playerex/data_attributes/functions/stock.json b/src/main/resources/data/playerex/data_attributes/functions/stock.json index b401cd70..89340234 100644 --- a/src/main/resources/data/playerex/data_attributes/functions/stock.json +++ b/src/main/resources/data/playerex/data_attributes/functions/stock.json @@ -1,146 +1,146 @@ { "entries": { - "playerex:luckiness": [ - { - "id": "playerex:melee_crit_chance", + "playerex:luckiness": { + "playerex:melee_crit_chance": { + "enabled": true, "behavior": "Add", "value": 0.02 }, - { - "id": "playerex:ranged_crit_chance", + "playerex:ranged_crit_chance": { + "enabled": true, "behavior": "Add", "value": 0.02 }, - { - "id": "minecraft:generic.luck", + "minecraft:generic.luck": { + "enabled": true, "behavior": "Add", "value": 0.05 }, - { - "id": "playerex:evasion", + "playerex:evasion": { + "enabled": true, "behavior": "Add", "value": 0.01 }, - { - "id": "spell_power:critical_chance", + "spell_power:critical_chance": { + "enabled": true, "behavior": "Add", "value": 0.02 } - ], - "playerex:dexterity": [ - { - "id": "minecraft:generic.attack_speed", + }, + "playerex:dexterity": { + "minecraft:generic.attack_speed": { + "enabled": true, "behavior": "Multiply", "value": 0.01 }, - { - "id": "playerex:ranged_crit_damage", + "playerex:ranged_crit_damage": { + "enabled": true, "behavior": "Add", "value": 0.005 }, - { - "id": "ranged_weapon:haste", + "ranged_weapon:haste": { + "enabled": true, "behavior": "Multiply", "value": 0.02 }, - { - "id": "ranged_weapon:damage", + "ranged_weapon:damage": { + "enabled": true, "behavior": "Multiply", "value": 0.02 } - ], - "playerex:constitution": [ - { - "id": "minecraft:generic.max_health", + }, + "playerex:constitution": { + "minecraft:generic.max_health": { + "enabled": true, "behavior": "Add", "value": 0.5 }, - { - "id": "minecraft:generic.armor", + "minecraft:generic.armor": { + "enabled": true, "behavior": "Add", "value": 0.25 }, - { - "id": "additionalentityattributes:generic.magic_protection", + "additionalentityattributes:generic.magic_protection": { + "enabled": true, "behavior": "Add", "value": 0.25 }, - { - "id": "additionalentityattributes:generic.lung_capacity", + "additionalentityattributes:generic.lung_capacity": { + "enabled": true, "behavior": "Add", "value": 0.01 }, - { - "id": "playerex:poison_resistance", + "playerex:poison_resistance": { + "enabled": true, "behavior": "Add", "value": 0.01 } - ], - "playerex:intelligence": [ - { - "id": "additionalentityattributes:player.dropped_experience", + }, + "playerex:intelligence": { + "additionalentityattributes:player.dropped_experience": { + "enabled": true, "behavior": "Multiply", "value": 0.01 }, - { - "id": "playerex:wither_resistance", + "playerex:wither_resistance": { + "enabled": true, "behavior": "Add", "value": 0.01 }, - { - "id": "spell_power:haste", + "spell_power:haste": { + "enabled": true, "behavior": "Add", "value": 2 } - ], - "playerex:focus": [ - { - "id": "playerex:health_regeneration", + }, + "playerex:focus": { + "playerex:health_regeneration": { + "enabled": true, "behavior": "Add", - "value": 0.0015 + "value": 0.015 }, - { - "id": "playerex:heal_amplification", + "playerex:heal_amplification": { + "enabled": true, "behavior": "Add", - "value": 0.0020 + "value": 0.002 }, - { - "id": "playerex:freeze_resistance", + "playerex:freeze_resistance": { + "enabled": true, "behavior": "Add", "value": 0.01 }, - { - "id": "playerex:lightning_resistance", + "playerex:lightning_resistance": { + "enabled": true, "behavior": "Add", "value": 0.01 }, - { - "id": "playerex:fire_resistance", + "playerex:fire_resistance": { + "enabled": true, "behavior": "Add", "value": 0.01 } - ], - "playerex:strength": [ - { - "id": "minecraft:generic.attack_damage", + }, + "playerex:strength": { + "minecraft:generic.attack_damage": { + "enabled": true, "behavior": "Multiply", "value": 0.02 }, - { - "id": "minecraft:generic.knockback_resistance", + "minecraft:generic.knockback_resistance": { + "enabled": true, "behavior": "Add", "value": 0.01 }, - { - "id": "playerex:melee_crit_damage", + "playerex:melee_crit_damage": { + "enabled": true, "behavior": "Add", "value": 0.005 }, - { - "id": "playerex:breaking_speed", + "playerex:breaking_speed": { + "enabled": true, "behavior": "Add", "value": 1.0 } - ] + } } } \ No newline at end of file diff --git a/src/main/resources/data/playerex/data_attributes/overrides/minecraft.json b/src/main/resources/data/playerex/data_attributes/overrides/minecraft.json index 5bd68de9..cc24c151 100644 --- a/src/main/resources/data/playerex/data_attributes/overrides/minecraft.json +++ b/src/main/resources/data/playerex/data_attributes/overrides/minecraft.json @@ -4,14 +4,13 @@ "enabled": true, "min": 0.0, "max": 1.0, - "smoothness": 1.0, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }, "minecraft:generic.luck": { "enabled": true, - "smoothness": 1.0, - "formula": "Diminished" + "smoothness": 1.0 }, "minecraft:generic.max_health": { "enabled": true, diff --git a/src/main/resources/data/playerex/data_attributes/overrides/stock.json b/src/main/resources/data/playerex/data_attributes/overrides/stock.json index 54eb44cc..5d477707 100644 --- a/src/main/resources/data/playerex/data_attributes/overrides/stock.json +++ b/src/main/resources/data/playerex/data_attributes/overrides/stock.json @@ -8,69 +8,94 @@ }, "playerex:ranged_crit_damage": { "enabled": true, - "smoothness": 1.0, - "formula": "Diminished" - }, - "playerex:poison_resistance": { - "enabled": true, - "smoothness": 1.0, + "min": 0.0, + "max": 1.0, + "smoothness": 0.001, "formula": "Diminished", "format": "Percentage" }, - "playerex:melee_crit_damage": { + "playerex:heal_amplification": { "enabled": true, - "smoothness": 1, - "formula": "Diminished" + "min": 0.0, + "max": 1.0, + "smoothness": 0.001, + "formula": "Diminished", + "format": "Percentage" }, - "playerex:wither_resistance": { + "playerex:ranged_crit_chance": { "enabled": true, - "smoothness": 1.0, + "min": 0.0, + "max": 1.0, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }, - "playerex:freeze_resistance": { + "playerex:evasion": { "enabled": true, - "smoothness": 1.0, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }, - "playerex:health_regeneration": { + "playerex:melee_crit_chance": { "enabled": true, - "smoothness": 1.0, + "min": 0.0, + "max": 1.0, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }, - "playerex:heal_amplification": { + "playerex:melee_crit_damage": { "enabled": true, - "smoothness": 1.0, + "min": 0.0, + "max": 1.0, + "smoothness": 0.001, + "formula": "Diminished" + }, + "playerex:lifesteal": { + "enabled": true, + "min": 0.0, + "max": 1.0, + "smoothness": 0.001, "formula": "Diminished", "format": "Percentage" }, - "playerex:ranged_crit_chance": { + "playerex:wither_resistance": { "enabled": true, - "smoothness": 1.0, + "min": -1.0, + "max": 1.0, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }, - "playerex:evasion": { + "playerex:poison_resistance": { "enabled": true, - "smoothness": 1.0, + "min": -1.0, + "max": 1.0, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }, - "playerex:lifesteal": { + "playerex:lightning_resistance": { "enabled": true, + "min": -1.0, + "max": 1.0, + "smoothness": 0.01, + "formula": "Diminished", "format": "Percentage" }, - "playerex:melee_crit_chance": { + "playerex:fire_resistance": { "enabled": true, - "smoothness": 1.0, + "min": -1, + "max": 1, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }, - "playerex:fire_resistance": { + "playerex:freeze_resistance": { "enabled": true, - "smoothness": 1.0, + "min": -1, + "max": 1, + "smoothness": 0.01, "formula": "Diminished", "format": "Percentage" }