當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。