Class EnchantmentTableInventory
java.lang.Object
net.minestom.server.inventory.AbstractInventory
net.minestom.server.inventory.Inventory
net.minestom.server.inventory.type.EnchantmentTableInventory
- All Implemented Interfaces:
InventoryClickHandler
,Taggable
,TagReadable
,TagWritable
,Viewable
-
Nested Class Summary
-
Field Summary
Fields inherited from class net.minestom.server.inventory.AbstractInventory
clickProcessor, inventoryConditions, itemStacks
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionshort
getEnchantmentLevel
(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot) Gets the enchantment level shown on mouse hover.getEnchantmentShown
(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot) Gets the enchantment shown in a slot.short
getLevelRequirement
(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot) Gets the level requirement in a slot.short
getSeed()
Gets the enchantment seed.void
setEnchantmentLevel
(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot, short level) Sets the enchantment level shown on mouse hover.void
setEnchantmentShown
(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot, Enchantment enchantment) Sets the enchantment shown in a slot.void
setLevelRequirement
(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot, short level) Sets the level requirement of a slot.void
setSeed
(short seed) Sets the enchantment seed.Methods inherited from class net.minestom.server.inventory.Inventory
addViewer, changeHeld, clear, doubleClick, dragging, drop, getCursorItem, getInventoryType, getTitle, getViewers, getWindowId, leftClick, middleClick, removeViewer, rightClick, sendProperty, setCursorItem, setTitle, shiftClick, UNSAFE_itemInsert, update, update
Methods inherited from class net.minestom.server.inventory.AbstractInventory
addInventoryCondition, addItemStack, addItemStack, addItemStacks, copyContents, getInnerSize, getInventoryConditions, getItemStack, getItemStacks, getSize, processItemStack, processItemStacks, replaceItemStack, safeItemInsert, safeItemInsert, setItemStack, tagHandler, takeItemStack, takeItemStacks
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.inventory.InventoryClickHandler
callClickEvent
Methods inherited from interface net.minestom.server.Viewable
getViewersAsAudience, getViewersAsAudiences, isViewer, sendPacketsToViewers, sendPacketsToViewers, sendPacketToViewers, sendPacketToViewersAndSelf
-
Constructor Details
-
EnchantmentTableInventory
-
-
Method Details
-
getLevelRequirement
Gets the level requirement in a slot.- Parameters:
enchantmentSlot
- the slot to check the level requirement- Returns:
- the level requirement of the slot
-
setLevelRequirement
public void setLevelRequirement(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot, short level) Sets the level requirement of a slot.- Parameters:
enchantmentSlot
- the slotlevel
- the level
-
getSeed
public short getSeed()Gets the enchantment seed.- Returns:
- the enchantment seed
-
setSeed
public void setSeed(short seed) Sets the enchantment seed.- Parameters:
seed
- the enchantment seed
-
getEnchantmentShown
Gets the enchantment shown in a slot.- Parameters:
enchantmentSlot
- the enchantment slot- Returns:
- the enchantment shown in the slot, null if it is hidden
-
setEnchantmentShown
public void setEnchantmentShown(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot, Enchantment enchantment) Sets the enchantment shown in a slot.Can be set to null to hide it.
- Parameters:
enchantmentSlot
- the enchantment slotenchantment
- the enchantment
-
getEnchantmentLevel
Gets the enchantment level shown on mouse hover.- Parameters:
enchantmentSlot
- the enchantment slot- Returns:
- the level shown, -1 if no enchant
-
setEnchantmentLevel
public void setEnchantmentLevel(EnchantmentTableInventory.EnchantmentSlot enchantmentSlot, short level) Sets the enchantment level shown on mouse hover.Can be set to -1 if no enchant.
- Parameters:
enchantmentSlot
- the enchantment slotlevel
- the level shown
-