Class VillagerInventory
java.lang.Object
net.minestom.server.inventory.AbstractInventory
net.minestom.server.inventory.Inventory
net.minestom.server.inventory.type.VillagerInventory
- All Implemented Interfaces:
InventoryClickHandler
,Taggable
,TagReadable
,TagWritable
,Viewable
-
Field Summary
Fields inherited from class net.minestom.server.inventory.AbstractInventory
clickProcessor, inventoryConditions, itemStacks, unmodifiableViewers, viewers
-
Constructor Summary
ConstructorDescriptionVillagerInventory
(@NotNull String title) VillagerInventory
(@NotNull Component title) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTrade
(TradeListPacket.Trade trade) boolean
This will not open the inventory forplayer
, usePlayer.openInventory(Inventory)
.boolean
int
int
boolean
void
removeTrade
(int index) void
setCanRestock
(boolean canRestock) void
setExperience
(int experience) void
setRegularVillager
(boolean regularVillager) void
setVillagerLevel
(int level) void
update()
Refreshes the inventory for all viewers.Methods inherited from class net.minestom.server.inventory.Inventory
changeHeld, doubleClick, dragging, drop, getCursorItem, getInventoryType, getTitle, getWindowId, leftClick, middleClick, removeViewer, rightClick, sendProperty, setCursorItem, setTitle, shiftClick
Methods inherited from class net.minestom.server.inventory.AbstractInventory
addInventoryCondition, addItemStack, addItemStack, addItemStacks, clear, copyContents, getInnerSize, getInventoryConditions, getItemStack, getItemStacks, getSize, getViewers, processItemStack, processItemStacks, replaceItemStack, sendSlotRefresh, setItemStack, setItemStack, tagHandler, takeItemStack, takeItemStacks, UNSAFE_itemInsert, update
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.tag.Taggable
getAndSetTag, getAndUpdateTag, getTag, hasTag, removeTag, setTag, updateAndGetTag, updateTag
Methods inherited from interface net.minestom.server.Viewable
getViewersAsAudience, getViewersAsAudiences, isViewer, sendPacketsToViewers, sendPacketsToViewers, sendPacketToViewers, sendPacketToViewersAndSelf
-
Constructor Details
-
VillagerInventory
-
VillagerInventory
-
-
Method Details
-
getTrades
-
addTrade
-
removeTrade
public void removeTrade(int index) -
getVillagerLevel
public int getVillagerLevel() -
setVillagerLevel
public void setVillagerLevel(int level) -
getExperience
public int getExperience() -
setExperience
public void setExperience(int experience) -
isRegularVillager
public boolean isRegularVillager() -
setRegularVillager
public void setRegularVillager(boolean regularVillager) -
canRestock
public boolean canRestock() -
setCanRestock
public void setCanRestock(boolean canRestock) -
update
public void update()Description copied from class:AbstractInventory
Refreshes the inventory for all viewers.- Overrides:
update
in classAbstractInventory
-
addViewer
Description copied from class:Inventory
This will not open the inventory forplayer
, usePlayer.openInventory(Inventory)
.
-