本文整理汇总了Java中org.bukkit.entity.HumanEntity.openInventory方法的典型用法代码示例。如果您正苦于以下问题:Java HumanEntity.openInventory方法的具体用法?Java HumanEntity.openInventory怎么用?Java HumanEntity.openInventory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.HumanEntity
的用法示例。
在下文中一共展示了HumanEntity.openInventory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity human) {
Inventory topInv = human.getOpenInventory().getTopInventory();
Inventory newInv = createInventory();
if (topInv != null && topInv.getTitle().equals(data.title())
&& topInv.getSize() == data.size()) {
topInv.setContents(newInv.getContents());
if (human instanceof Player) {
((Player) human).updateInventory();
}
} else {
human.openInventory(newInv);
}
GUI_MAP.put(human.getName(), this);
}
示例2: open
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity human) {
if (init) {
factory.initialize(this);
init = false;
}
Inventory topInv = human.getOpenInventory().getTopInventory();
Inventory newInv = factory.create(this, human);
if (signature.isSimilar(topInv)) {
topInv.setContents(newInv.getContents());
} else {
human.openInventory(newInv);
}
guiMap.put(human, this);
}
示例3: 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;
}
示例4: show
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
/**
* Shows the inventory to the viewers
*
* @param viewers Array of {@link HumanEntity}
* @return the InventoryMenuBuilder
*/
public InventoryMenuBuilder show(HumanEntity... viewers) {
refreshContent();
for (HumanEntity viewer : viewers) {
viewer.openInventory(this.build());
}
return this;
}
示例5: open
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player, Resource resource) {
update(resource);
player.openInventory(gui);
}
示例6: openMain
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openMain(HumanEntity player) {
player.openInventory(main);
}
示例7: openDemands
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openDemands(HumanEntity player) {
update();
player.openInventory(demands);
}
示例8: open
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player, ResourceSubcategory category) {
update(category);
player.openInventory(gui);
}
示例9: open
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player) {
update();
player.openInventory(gui);
}
示例10: open
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player) {
player.openInventory(gui);
}
示例11: openResourceMenu
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openResourceMenu(HumanEntity player, Resource resource) {
player.openInventory(resourceMenus.get(resource).getGUI());
}
示例12: open
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player) {
player.openInventory(pages.get(0));
}
示例13: openGroups
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openGroups(HumanEntity player) {
updateGroups();
player.openInventory(groups);
}
示例14: openIdeas
import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openIdeas(HumanEntity player, IdeaGroup group) {
updateIdeas(group);
player.openInventory(ideas.get(group));
}
示例15: 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());
}