当前位置: 首页>>代码示例>>Java>>正文


Java HumanEntity.openInventory方法代码示例

本文整理汇总了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);
}
 
开发者ID:EntryPointKR,项目名称:MCLibrary,代码行数:15,代码来源:GUI.java

示例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);
}
 
开发者ID:EntryPointKR,项目名称:MCLibrary,代码行数:16,代码来源:GUI.java

示例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;
}
 
开发者ID:InventivetalentDev,项目名称:MenuBuilder,代码行数:20,代码来源:InventoryMenuBuilder.java

示例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;
}
 
开发者ID:InventivetalentDev,项目名称:MenuBuilder,代码行数:14,代码来源:InventoryMenuBuilder.java

示例5: open

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player, Resource resource) {
    update(resource);
    player.openInventory(gui);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:5,代码来源:SaturationMenu.java

示例6: openMain

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openMain(HumanEntity player) {
    player.openInventory(main);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:4,代码来源:PopulationMenu.java

示例7: openDemands

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openDemands(HumanEntity player) {
    update();
    player.openInventory(demands);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:5,代码来源:PopulationMenu.java

示例8: open

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player, ResourceSubcategory category) {
    update(category);
    player.openInventory(gui);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:5,代码来源:DemandMenu.java

示例9: open

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player) {
    update();
    player.openInventory(gui);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:5,代码来源:MilitaryMenu.java

示例10: open

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player) {
    player.openInventory(gui);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:4,代码来源:EconomyMenu.java

示例11: openResourceMenu

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openResourceMenu(HumanEntity player, Resource resource) {
    player.openInventory(resourceMenus.get(resource).getGUI());
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:4,代码来源:TradeMenu.java

示例12: open

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void open(HumanEntity player) {
    player.openInventory(pages.get(0));
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:4,代码来源:PageGUI.java

示例13: openGroups

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openGroups(HumanEntity player) {
    updateGroups();
    player.openInventory(groups);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:5,代码来源:IdeaMenu.java

示例14: openIdeas

import org.bukkit.entity.HumanEntity; //导入方法依赖的package包/类
public void openIdeas(HumanEntity player, IdeaGroup group) {
    updateIdeas(group);
    player.openInventory(ideas.get(group));
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:5,代码来源:IdeaMenu.java

示例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());
}
 
开发者ID:masterdoctor,项目名称:SpigotPaginatedGUI,代码行数:11,代码来源:PaginatedGUI.java


注:本文中的org.bukkit.entity.HumanEntity.openInventory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。