本文整理了Java中org.bukkit.inventory.Inventory.getName()
方法的一些代码示例,展示了Inventory.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Inventory.getName()
方法的具体详情如下:
包路径:org.bukkit.inventory.Inventory
类名称:Inventory
方法名:getName
[英]Returns the name of the inventory
[中]返回资源清册的名称
代码示例来源:origin: bergerkiller/BKCommonLib
@Override
public String getName() {
return base.getName();
}
代码示例来源:origin: bergerkiller/BKCommonLib
@Override
public String getName() {
return base.getName();
}
代码示例来源:origin: NoCheatPlus/NoCheatPlus
private void addInventory(final Player player, final Inventory inventory, final String prefix,
final StringBuilder builder) {
builder.append(prefix);
if (inventory == null) {
builder.append("(none)");
}
else {
final String name = inventory.getName();
final String title = inventory.getTitle();
final boolean same = name == null && title == null || name != null && name.equals(title);
builder.append((same ? name : (name + "/" + title)));
builder.append("/");
builder.append(inventory.getClass().getName());
}
}
代码示例来源:origin: stackoverflow.com
public long insertInvDetails(Inventory invent) {
mDb = mDbHelper.getWritableDatabase();
ContentValues cv = new ContentValues();
cv.put(EMP_PHOTO, Utility.getBytes(invent.getBitmap()));
cv.put(EMP_NAME, invent.getName());
cv.put(EMP_PNAME, invent.getPersonName());
cv.put(EMP_Date, invent.getDate());
cv.put("IsDeleted", 0);
long count=mDb.insert(INVENTORY_TABLE, null, cv);
return count;
}
代码示例来源:origin: stackoverflow.com
for (Inventory e : productList)
{
if (counter == size)
break;
if ((e.getBarcode() - barcodes.get(counter) == 0) && counter <= size)
{
System.out.println (e.getRBarcode()+ "\t" + e.getName() + "\t"+ e.getPrice());
}
else
{
counter++;
}
}
代码示例来源:origin: eccentricdevotion/TARDIS
Inventory inv = event.getInventory();
InventoryHolder holder = inv.getHolder();
if (holder instanceof Player && inv.getName().equals(ChatColor.DARK_RED + "Destination Terminal")) {
UUID uuid = ((Player) holder).getUniqueId();
HashMap<String, Object> where = new HashMap<>();
代码示例来源:origin: bitquest/bitquest
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event)
throws ParseException, org.json.simple.parser.ParseException, IOException {
Block b = event.getClickedBlock();
Player p = event.getPlayer();
if (b != null && PROTECTED_BLOCKS.contains(b.getType())) {
// If block's inventory has "public" in it, allow the player to interact with it.
if (b.getState() instanceof InventoryHolder) {
Inventory blockInventory = ((InventoryHolder) b.getState()).getInventory();
if (blockInventory.getName().toLowerCase().contains("public")) {
return;
}
}
// If player doesn't have permission, disallow the player to interact with it.
if (!bitQuest.canBuild(b.getLocation(), event.getPlayer())) {
event.setCancelled(true);
p.sendMessage(ChatColor.DARK_RED + "You don't have permission to do that!");
}
}
}
代码示例来源:origin: BentoBoxWorld/BentoBox
if (inventory.getName().equals(openPanels.get(user.getUniqueId()).getInventory().getName())) {
代码示例来源:origin: io.github.bedwarsrel/BedwarsRel-Common
@SuppressWarnings({"rawtypes", "unchecked"})
private void onIngameInventoryClick(InventoryClickEvent ice, Player player, Game game) {
if (!ice.getInventory().getName().equals(BedwarsRel._l(player, "ingame.shop.name"))) {
if (game.isSpectator(player)
|| (game.getCycle() instanceof BungeeGameCycle && game.getCycle().isEndGameRunning()
if (ice.getInventory().getName().equals(BedwarsRel._l(player, "ingame.spectator"))) {
ice.setCancelled(true);
if (!clickedStack.getType().equals(Material.SKULL_ITEM)) {
代码示例来源:origin: eccentricdevotion/TARDIS
Inventory inv = event.getInventory();
InventoryHolder holder = inv.getHolder();
String title = inv.getName();
if (holder instanceof Chest) {
if (title.equals(ChatColor.DARK_RED + "Artron Condenser") || title.equals(ChatColor.DARK_RED + "Server Condenser")) {
代码示例来源:origin: BedwarsRel/BedwarsRel
@SuppressWarnings({"rawtypes", "unchecked"})
private void onIngameInventoryClick(InventoryClickEvent ice, Player player, Game game) {
if (!ice.getInventory().getName().equals(BedwarsRel._l(player, "ingame.shop.name"))) {
if (game.isSpectator(player)
|| (game.getCycle() instanceof BungeeGameCycle && game.getCycle().isEndGameRunning()
if (ice.getInventory().getName().equals(BedwarsRel._l(player, "ingame.spectator"))) {
ice.setCancelled(true);
if (!clickedStack.getType().equals(Material.SKULL_ITEM)) {
代码示例来源:origin: bitquest/bitquest
if (inventory.getName().equalsIgnoreCase("Market")) {
if (event.getRawSlot() < event.getView().getTopInventory().getSize()) {
final User user;
代码示例来源:origin: dzikoysk/WildSkript
String name = inventory.getName();
代码示例来源:origin: io.github.bedwarsrel/BedwarsRel-Common
if (ioe.getInventory().getName().equals(BedwarsRel._l(player, "ingame.spectator"))) {
return;
代码示例来源:origin: BedwarsRel/BedwarsRel
if (ioe.getInventory().getName().equals(BedwarsRel._l(player, "ingame.spectator"))) {
return;
内容来源于网络,如有侵权,请联系作者删除!