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

fix self. #19

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package net.infumia.frame.element;

import java.time.Duration;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import net.infumia.frame.context.element.ContextElementClick;
import net.infumia.frame.context.element.ContextElementItemClick;
import net.infumia.frame.context.element.ContextElementItemRender;
import net.infumia.frame.context.element.ContextElementItemUpdate;
import net.infumia.frame.context.element.ContextElementRender;
import net.infumia.frame.state.State;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface ElementItemBuilder extends ElementBuilder {
@NotNull
Expand Down Expand Up @@ -48,6 +51,14 @@ ElementItemBuilder renderWith(
@Override
ElementItemBuilder updateOnClick();

@NotNull
ElementItemBuilder interactionDelay(@Nullable Duration interactionDelay);

@NotNull
ElementItemBuilder onInteractionDelay(
@NotNull Consumer<ContextElementClick> onInteractionDelay
);

@NotNull
@Override
ElementItemBuilder updateOnStateChange(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package net.infumia.frame.element;

import java.time.Duration;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import net.infumia.frame.context.ContextBase;
import net.infumia.frame.context.element.ContextElementClick;
import net.infumia.frame.context.element.ContextElementItemClick;
import net.infumia.frame.context.element.ContextElementItemRender;
import net.infumia.frame.context.element.ContextElementItemUpdate;
Expand Down Expand Up @@ -127,6 +129,22 @@ public ElementItemBuilder updateOnClick() {
return this;
}

@NotNull
@Override
public ElementItemBuilder onInteractionDelay(
final @NotNull Consumer<ContextElementClick> onInteractionDelay
) {
super.onInteractionDelay(onInteractionDelay);
return this;
}

@NotNull
@Override
public ElementItemBuilder interactionDelay(final @Nullable Duration interactionDelay) {
super.interactionDelay(interactionDelay);
return this;
}

@NotNull
@Override
public ElementItemBuilder cancelOnClick(final boolean cancelOnClick) {
Expand Down