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.
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.
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.
What would
Math.abs(rotation - 90) <= 45become 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.
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)