本文整理汇总了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);
}