本文整理匯總了Java中org.spongepowered.api.entity.living.player.Player.openInventory方法的典型用法代碼示例。如果您正苦於以下問題:Java Player.openInventory方法的具體用法?Java Player.openInventory怎麽用?Java Player.openInventory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.spongepowered.api.entity.living.player.Player
的用法示例。
在下文中一共展示了Player.openInventory方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: launchCrateForPlayer
import org.spongepowered.api.entity.living.player.Player; //導入方法依賴的package包/類
public void launchCrateForPlayer(String crateType, Player target,HuskyCrates plugin){
if(!crateTypes.containsKey(crateType)) {
target.openInventory(new NullCrateView(plugin,target,null).getInventory());
}else{
if(crateTypes.get(crateType).isGUI) {
target.openInventory(crateTypes.get(crateType).generateViewForCrate(plugin, target).getInventory());
}else{
crateTypes.get(crateType).generateViewForCrate(plugin, target);
}
}
}
示例2: Open
import org.spongepowered.api.entity.living.player.Player; //導入方法依賴的package包/類
public CommandResult Open(CommandSource src, CommandContext args, org.spongepowered.api.item.inventory.Inventory i) {
final Player player = Tools.getPlayer(src, vt);
if (src.getCommandSource().isPresent() && src.getCommandSource().get() instanceof Player) {
player.openInventory(i, Cause.of(NamedCause.of("plugin", vt), NamedCause.source(player)));
return CommandResult.success();
}
return CommandResult.empty();
}
示例3: open
import org.spongepowered.api.entity.living.player.Player; //導入方法依賴的package包/類
public static void open(Player player, Inventory inventory) {
player.openInventory(inventory);
}