net.minestom.server.event.book.EditBookEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.event.book;
import net.minestom.server.entity.Player;
import net.minestom.server.event.trait.ItemEvent;
import net.minestom.server.event.trait.PlayerInstanceEvent;
import net.minestom.server.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
public class EditBookEvent implements PlayerInstanceEvent, ItemEvent {
private final Player player;
private final ItemStack itemStack;
private final List pages;
private final String title;
public EditBookEvent(
@NotNull Player player,
@NotNull ItemStack itemStack,
@NotNull List pages,
@Nullable String title
) {
this.player = player;
this.itemStack = itemStack;
this.pages = pages;
this.title = title;
}
@Override
public @NotNull Player getPlayer() {
return player;
}
@Override
public @NotNull ItemStack getItemStack() {
return itemStack;
}
public @NotNull List getPages() {
return pages;
}
public @Nullable String getTitle() {
return title;
}
public boolean isSigned() {
return title != null;
}
}