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

Adding a configuration variable for blacklisting hostile vehicles being protected as mounts #176

Merged
merged 2 commits into from
Jan 6, 2023

Conversation

ejdarrow
Copy link
Contributor

@ejdarrow ejdarrow commented Jan 2, 2023

Specifically with regard to #152 this attempts to solve the problem of hostile vehicle entities via blacklist.
Feel free to suggest changes. I attempted to mimic local design patterns but I can change anything you need here.

…ount protection, specifically for covering things like alexsmobs:crocodile and twilightforest:pinch_bettle.
@@ -52,4 +56,11 @@ public class ServerConfig implements ConfigData {
public float getUpswingMultiplier() {
return Math.max(0.2F, Math.min(1, upswing_multiplier));
}

public boolean isEntityHostileVehicle(String entityName){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the solution overall, but the name of this function gave me an idea.
What if hostile vehicles would be checked not against ID, but rather against instanceof HostileEntity.

What do you think? Would that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me in principle, but my concern there is that other modders may not implement things in a way that we can rely on.

I like the 'fallback compatibility' in this mod, so I wonder if this could follow a similar pattern and short circuit from instanceof HostileEntity and then check a blacklist?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit that short circuits from one to the other. We could potentially do things that way.

@ZsoltMolnarrr ZsoltMolnarrr merged commit d239d33 into ZsoltMolnarrr:1.19.3 Jan 6, 2023
@ZsoltMolnarrr
Copy link
Owner

Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants