-
Notifications
You must be signed in to change notification settings - Fork 30
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
Rewrite #92
base: master
Are you sure you want to change the base?
Rewrite #92
Conversation
from javadoc: Checks to see if an entity is gliding, such as using an Elytra. https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/LivingEntity.html#isGliding()
double rotation = player.getLocation().getYaw(); | ||
|
||
if (rotation < 0.0D) { | ||
rotation += 360.0D; |
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.
I am unsure what values the getYaw method can return but considering that it can be lower than 0, I'd suggest we normalize the data here:
- get absolute value
- divide by 360 and get the remainder
This also prevents the multiple Math.abs calls below.
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.
What would Math.abs(rotation - 90) <= 45
become then?
A yaw of 0 or 360 represents the positive z direction.
A yaw of 180 represents the negative z direction.
A yaw of 90 represents the negative x direction.
A yaw of 270 represents the positive x direction.
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.
What would
Math.abs(rotation - 90) <= 45
become then?
I am a bit confused why we actually need to do that? Can't we do the Absolute, % 360, and then check the ranges and convert them too cardinal directions?
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.
Idk that's inherited code
src/main/java/at/helpch/placeholderapi/expansion/player/util/ItemUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/at/helpch/placeholderapi/expansion/player/util/ItemUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/at/helpch/placeholderapi/expansion/player/PlayerExpansion.java
Outdated
Show resolved
Hide resolved
src/main/java/at/helpch/placeholderapi/expansion/player/PlayerExpansion.java
Outdated
Show resolved
Hide resolved
By reading the version from MANIFEST we will have to update it in a single place, build.gradle |
Changed
Added placeholders
has_unlocked_recipe_<recipe key>
(close add/recipes placeholders #37)potion_effect_level_<effect>
(close SUGGESTION - 2 new placeholders #66)is_gliding
(close [suggestion] %player_is_elytra_flying% #87)bed_is_set
- whether the player has a bed set (the expansion already has placeholders for bed coords)