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

ExprYawPitch: support for entities, better description #5298

Merged
merged 14 commits into from
Jul 1, 2024

Conversation

Mwexim
Copy link
Contributor

@Mwexim Mwexim commented Dec 30, 2022

Description

  • Added support for entities, more specifically to change the yaw/pitch of an entity.
  • Made the description better and more clear. Skript actually alters yaw and pitch behavior and this was not obvious to the user.
  • Made the code consistent. Sometimes it would use the Bukkit system, and sometimes the Skript system. Now it only uses Skript's system.

A quick overview of the differences between Skript's yaw and pitch system:

  • A yaw of 0 represents the positive x direction. Rotating by a positive number will rotate the yaw counter-clockwise.
  • A pitch of 90 represents the positive y direction. Adding a positive number to the pitch will rotate upwards.

Edit (@sovdeeth): I've reverted the yaw/pitch changes to ensure that the yaw/pitch will be the same before and after this PR. This means yaw is the same as Minecraft's, but always positive ( [0, 360) instead of [-180, 180) ) and that pitch is exactly the same as Minecraft.


Target Minecraft Versions: any
Requirements: N/A
Related Issues: N/A

@AyhamAl-Ali AyhamAl-Ali added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Dec 30, 2022
Copy link
Member

@AyhamAl-Ali AyhamAl-Ali left a comment

Choose a reason for hiding this comment

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

Nice PR ⚡ Thanks for it

Mwexim and others added 4 commits December 31, 2022 12:42
Co-authored-by: Ayham Al Ali <alali_ayham@yahoo.com>
Co-authored-by: Ayham Al Ali <alali_ayham@yahoo.com>
Co-authored-by: Ayham Al Ali <alali_ayham@yahoo.com>
src/main/java/ch/njol/skript/expressions/ExprYawPitch.java Outdated Show resolved Hide resolved
"set pitch of player to 90 # Makes the player look upwards, Paper 1.19+ only",
"add 180 to yaw of target of player # Makes the target look behind him"
})
@Since("2.0, 2.2-dev28 (vector yaw/pitch), INSERT VERSION (changers)")
public class ExprYawPitch extends SimplePropertyExpression<Object, Number> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should return Float rather than Number.

@Moderocky Moderocky force-pushed the master branch 2 times, most recently from bd134d0 to 3f08853 Compare September 16, 2023 16:59
@Moderocky Moderocky changed the base branch from master to dev/feature September 18, 2023 09:59
@sovdeeth sovdeeth added the 2.9 Targeting a 2.9.X version release label Mar 19, 2024
@sovdeeth sovdeeth added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label May 31, 2024
@sovdeeth sovdeeth dismissed stale reviews from AyhamAl-Ali and TheLimeGlass July 1, 2024 18:51

old

@sovdeeth sovdeeth merged commit 27094a6 into SkriptLang:dev/feature Jul 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants