Skip to content
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

Open
wants to merge 10 commits into
base: 1.19.2
Choose a base branch
from

Conversation

Waterpicker
Copy link

No description provided.

@KnightMiner
Copy link
Member

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

@KnightMiner KnightMiner added Needs Update Issues or PR needs additional action to be taken by the reporter Technical Pull requests making changes to workspace or targeted versions 1.19 Issue affects 1.19 labels Jun 9, 2024
Copy link
Member

@KnightMiner KnightMiner left a 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.

@@ -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);
Copy link
Member

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.

@KnightMiner
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.19 Issue affects 1.19 Needs Update Issues or PR needs additional action to be taken by the reporter Technical Pull requests making changes to workspace or targeted versions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants