本文整理汇总了Java中org.bukkit.entity.HumanEntity.closeInventory方法的典型用法代码示例。如果您正苦于以下问题:Java HumanEntity.closeInventory方法的具体用法?Java HumanEntity.closeInventory怎么用?Java HumanEntity.closeInventory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.HumanEntity
的用法示例。
在下文中一共展示了HumanEntity.closeInventory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearInventory
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void clearInventory(Location l) {
BlockMenu menu = getInventory(l);
for(HumanEntity human: new ArrayList<>(menu.toInventory().getViewers())) {
human.closeInventory();
}
inventories.get(l).delete(l);
inventories.remove(l);
}
示例2: withTitle
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
/**
* Change the title of the inventory and <i>optionally</i> update it to all viewers
*
* @param title new title of the inventory
* @param refresh if <code>true</code>, the inventory will be re-opened to all viewers
* @return the InventoryMenuBuilder
*/
public InventoryMenuBuilder withTitle(String title, boolean refresh) {
validateInit();
InventoryHelper.changeTitle(this.inventory, title);
if (refresh) {
for (HumanEntity viewer : this.inventory.getViewers()) {
viewer.closeInventory();
viewer.openInventory(this.inventory);
}
}
return this;
}
示例3: close
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void close() {
for(HumanEntity human: new ArrayList<>(toInventory().getViewers())) {
human.closeInventory();
}
}
示例4: refreshInventory
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
/**
* Simply an alias that executes {@link HumanEntity#closeInventory()} and then
* {@link HumanEntity#openInventory(Inventory)}.
*
* @param holder The HumanEntity that you wish to refresh the inventory for.
*/
public void refreshInventory(HumanEntity holder){
holder.closeInventory();
holder.openInventory(getInventory());
}