-
Notifications
You must be signed in to change notification settings - Fork 776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port protection modifiers to json. #5236
base: 1.19.2
Are you sure you want to change the base?
Conversation
None of your modifier JSON include the secondary effects of the modifiers you ported to JSON. As I said on discord, those secondary effects need to be ported to new modules. The code you wrote will also fail on world load. The dynamic modifier filter will never match, as the JSON modifier will always be composable. Just filter to modifier |
src/generated/resources/data/tconstruct/tinkering/modifiers/melee_protection.json
Outdated
Show resolved
Hide resolved
src/main/java/slimeknights/tconstruct/library/data/tinkering/AbstractModifierProvider.java
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
src/main/java/slimeknights/tconstruct/library/tools/capability/TinkerDataKeys.java
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
src/generated/resources/data/tconstruct/tinkering/modifiers/melee_protection.json
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Show resolved
Hide resolved
src/main/java/slimeknights/tconstruct/library/recipe/worktable/ModifierSetWorktableRecipe.java
Outdated
Show resolved
Hide resolved
...java/slimeknights/tconstruct/library/recipe/worktable/ModifierSetWorktableRecipeBuilder.java
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking a lot better. I see one notable bug upon inspection, the rest is mostly stylistic stuff.
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...in/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorLevelModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
...java/slimeknights/tconstruct/library/recipe/worktable/ModifierSetWorktableRecipeBuilder.java
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Outdated
Show resolved
Hide resolved
src/main/java/slimeknights/tconstruct/library/json/LevelingValue.java
Outdated
Show resolved
Hide resolved
...ain/java/slimeknights/tconstruct/library/modifiers/modules/technical/MaxArmorStatModule.java
Show resolved
Hide resolved
@@ -40,4 +42,8 @@ public void set(EquipmentSlot slot, float level) { | |||
} | |||
} | |||
} | |||
|
|||
public static float getStat(LivingEntity living, TinkerDataCapability.ComputableDataKey<ModifierMaxLevel> key) { | |||
return living.getCapability(TinkerDataCapability.CAPABILITY).resolve().map(data -> data.get(key)).map(ModifierMaxLevel::getMax).orElse(0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget the function docs here. Does not need to be long, just briefly explain when this is useful.
Up to you whether you want to include param in the doc string.
Code is looking good to me other than the 1 missing function doc. Are you planning to do projectile protection in this PR as well? Or just melee protection? Now that you have an idea of how melee works you should be in a pretty good state to do a general attribute version like projectile protection, ping me on discord and I can give you an outline for the parameters to that module I'd expect. |
No description provided.