Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AnvilGUI.Builder |
item(org.bukkit.inventory.ItemStack item)
Deprecated.
As of version 1.4.0, use
itemLeft |
AnvilGUI.Builder |
itemLeft(org.bukkit.inventory.ItemStack item)
Sets the
ItemStack to be put in the first slot |
AnvilGUI.Builder |
itemRight(org.bukkit.inventory.ItemStack item)
Sets the
ItemStack to be put in the second slot |
AnvilGUI.Builder |
onClose(java.util.function.Consumer<org.bukkit.entity.Player> closeListener)
Listens for when the inventory is closed
|
AnvilGUI.Builder |
onComplete(java.util.function.BiFunction<org.bukkit.entity.Player,String,AnvilGUI.Response> completeFunction)
Handles the inventory output slot when it is clicked
|
AnvilGUI.Builder |
onLeftInputClick(java.util.function.Consumer<org.bukkit.entity.Player> inputLeftClickListener)
Listens for when the first input slot is clicked
|
AnvilGUI.Builder |
onRightInputClick(java.util.function.Consumer<org.bukkit.entity.Player> inputRightClickListener)
Listens for when the second input slot is clicked
|
AnvilGUI |
open(org.bukkit.entity.Player player)
Creates the anvil GUI and opens it for the player
|
AnvilGUI.Builder |
plugin(org.bukkit.plugin.Plugin plugin)
Sets the plugin for the
AnvilGUI |
AnvilGUI.Builder |
preventClose()
Prevents the closing of the anvil GUI by the user
|
AnvilGUI.Builder |
text(String text)
Sets the inital item-text that is displayed to the user
|
AnvilGUI.Builder |
title(String title)
Sets the AnvilGUI title that is to be displayed to the user
|
public AnvilGUI.Builder preventClose()
AnvilGUI.Builder
instancepublic AnvilGUI.Builder onClose(java.util.function.Consumer<org.bukkit.entity.Player> closeListener)
closeListener
- An Consumer
that is called when the anvil GUI is closedAnvilGUI.Builder
instanceIllegalArgumentException
- when the closeListener is nullpublic AnvilGUI.Builder onLeftInputClick(java.util.function.Consumer<org.bukkit.entity.Player> inputLeftClickListener)
inputLeftClickListener
- An Consumer
that is called when the first input slot is clickedAnvilGUI.Builder
instancepublic AnvilGUI.Builder onRightInputClick(java.util.function.Consumer<org.bukkit.entity.Player> inputRightClickListener)
inputRightClickListener
- An Consumer
that is called when the second input slot is clickedAnvilGUI.Builder
instancepublic AnvilGUI.Builder onComplete(java.util.function.BiFunction<org.bukkit.entity.Player,String,AnvilGUI.Response> completeFunction)
completeFunction
- An BiFunction
that is called when the user clicks the output slotAnvilGUI.Builder
instanceIllegalArgumentException
- when the completeFunction is nullpublic AnvilGUI.Builder plugin(org.bukkit.plugin.Plugin plugin)
AnvilGUI
plugin
- The Plugin
this anvil GUI is associated withAnvilGUI.Builder
instanceIllegalArgumentException
- if the plugin is nullpublic AnvilGUI.Builder text(String text)
text
- The initial name of the item in the anvilAnvilGUI.Builder
instanceIllegalArgumentException
- if the text is nullpublic AnvilGUI.Builder title(String title)
title
- The title that is to be displayed to the userAnvilGUI.Builder
instanceIllegalArgumentException
- if the title is null@Deprecated public AnvilGUI.Builder item(org.bukkit.inventory.ItemStack item)
itemLeft
ItemStack
to be put in the first slotitem
- The ItemStack
to be put in the first slotAnvilGUI.Builder
instanceIllegalArgumentException
- if the ItemStack
is nullpublic AnvilGUI.Builder itemLeft(org.bukkit.inventory.ItemStack item)
ItemStack
to be put in the first slotitem
- The ItemStack
to be put in the first slotAnvilGUI.Builder
instanceIllegalArgumentException
- if the ItemStack
is nullpublic AnvilGUI.Builder itemRight(org.bukkit.inventory.ItemStack item)
ItemStack
to be put in the second slotitem
- The ItemStack
to be put in the second slotAnvilGUI.Builder
instancepublic AnvilGUI open(org.bukkit.entity.Player player)
player
- The Player
the anvil GUI should open forAnvilGUI
instance from this builderIllegalArgumentException
- when the onComplete function, plugin, or player is nullCopyright © 2020. All Rights Reserved.