-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Configurable Per-World Void Damage Height Offset & Amount #11436
Configurable Per-World Void Damage Height Offset & Amount #11436
Conversation
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.
Welcome to paper 🎉
Thank you for your first PR.
Left a couple of comments that need addressing before something like this can be merged.
patches/api/0490-voidDamageThreshold-Height-at-which-entiies-take-voi.patch
Outdated
Show resolved
Hide resolved
patches/server/1059-Implement-configurable-per-world-void-damage-thresho.patch
Outdated
Show resolved
Hide resolved
patches/server/1059-Implement-configurable-per-world-void-damage-thresho.patch
Outdated
Show resolved
Hide resolved
patches/server/1059-Implement-configurable-per-world-void-damage-thresho.patch
Outdated
Show resolved
Hide resolved
patches/server/1059-Implement-configurable-per-world-void-damage-thresho.patch
Outdated
Show resolved
Hide resolved
dc5875b
to
6e85ecf
Compare
I've fixed all the issues you've shown me and changed the PR to be an offset from minBuildHeight() as you said you wanted. |
Do you have a specific use-case for adding API getters/setters? The API should already be able to deal void damage via the damage cause API if needed and these methods add to the general clutter that is the World interface already. |
Beyond that, we can combine enabled and damage into a FloatOr.Disabled (needs to be created) |
Yes, dynamically loading/building worlds with WorldCreator from region files on disk, mainly for minigames. Currently you can generate a custom world at runtime with a custom generator, biomeProvider, etc... but obviously void kill height can not be set when creating the world, much less when the world is loaded. An alternative may be to modify WorldCreator.java to support passing in a custom world.yaml config settings (and potentially reloading those settings at runtime in World.java), but this is obviously much simpler and I would very much enjoy not having to take on such a task.
Yes but as far as I'm aware there is no way to change the actual damage delt by being in the void for an entity vs a plugin applying damage and setting the DamageCause as Void, for example by some RPG plugins. You would have to check if damage cause is void, check if the player's y level is below the y-level of whatever the void damage height is, and if the damage was within a certain epsilon of 4.0F and then change the amount of damage applied to the player, to achieve the same result reliably. |
Eh sounds fair, I guess. You can deal void damage perfectly fine via https://jd.papermc.io/paper/1.21.1/org/bukkit/entity/Damageable.html#damage(double,org.bukkit.damage.DamageSource) and https://jd.papermc.io/paper/1.21.1/org/bukkit/damage/DamageType.html#OUT_OF_WORLD respectively tho. Maybe it is worth consolidating the void damage configuration into a single interface type, e.g. World#getVoidDamageConfiguration() interface WorldVoidDamageConfiguration { boolean isVoidDamageEnabled(); static WorldVoidDamageConfiguration vanilla() { } but I'll get back to concrete next steps once we have more team input on this. |
cb2dd00
to
38d328c
Compare
I've made it an offset from the build height as requested, defaulting to -64 blocks from the minBuildHeight. |
38d328c
to
dfed6f8
Compare
43d872c
to
4644865
Compare
No description provided.