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

Input API #7190

Open
wants to merge 16 commits into
base: dev/feature
Choose a base branch
from
Open

Input API #7190

wants to merge 16 commits into from

Conversation

UnderscoreTud
Copy link
Member

Description

This PR covers all the features of the new Input API.

  • An expression to get what the player is currently pressing.
  • A condition to check if a player is pressing input keys.
  • An event called when a player sends an input update to the server.

Target Minecraft Versions: 1.21.3
Requirements: none
Related Issues: none

@UnderscoreTud UnderscoreTud added the feature Pull request adding a new feature. label Nov 3, 2024
Copy link
Member

@Efnilite Efnilite left a comment

Choose a reason for hiding this comment

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

lgtm, tests failing though :)

src/main/java/ch/njol/skript/events/EvtPlayerInput.java Outdated Show resolved Hide resolved
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

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

looks very nice overall

src/main/java/ch/njol/skript/events/EvtPlayerInput.java Outdated Show resolved Hide resolved
@Pikachu920
Copy link
Member

i shed a tear when i saw the tests 🥹

@UnderscoreTud
Copy link
Member Author

i shed a tear when i saw the tests 🥹

i shed tears when i wrote the tests. for different reasons

Copy link
Member

@APickledWalrus APickledWalrus left a comment

Choose a reason for hiding this comment

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

very cool

static {
if (Skript.classExists("org.bukkit.Input")) {
Skript.registerEvent("Player Input", EvtPlayerInput.class, PlayerInputEvent.class,
"[player] (toggle|toggling|1:press[ing]|2:releas(e|ing)) [of] (%-inputkeys%|[a|any] key)",
Copy link
Member

Choose a reason for hiding this comment

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

i don't like on toggle key as a syntax. also, any reason for separating toggle and toggling? i think it's clearer, but it's not consistent with the other two options (e.g. why not have release and releasing)

Copy link
Member Author

Choose a reason for hiding this comment

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

i don't like on toggle key as a syntax.

on toggle key specifically or all its variations as well?

also, any reason for separating toggle and toggling? i think it's clearer, but it's not consistent with the other two options (e.g. why not have release and releasing)

I probably just missed by accident

src/main/java/ch/njol/skript/events/EvtPlayerInput.java Outdated Show resolved Hide resolved
src/main/java/ch/njol/skript/events/EvtPlayerInput.java Outdated Show resolved Hide resolved
src/main/java/org/skriptlang/skript/bukkit/InputKey.java Outdated Show resolved Hide resolved
src/main/java/org/skriptlang/skript/bukkit/InputKey.java Outdated Show resolved Hide resolved
src/main/java/org/skriptlang/skript/bukkit/InputKey.java Outdated Show resolved Hide resolved
@UnderscoreTud UnderscoreTud added the 2.10 Targeting a 2.10.X version release label Nov 9, 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 Nov 9, 2024
Copy link

@TheAbsolutionism TheAbsolutionism left a comment

Choose a reason for hiding this comment

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

I could be wrong on these, not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Targeting a 2.10.X version release feature Pull request adding a new feature. 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.

7 participants