• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InventoryTransactionResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult的典型用法代码示例。如果您正苦于以下问题:Java InventoryTransactionResult类的具体用法?Java InventoryTransactionResult怎么用?Java InventoryTransactionResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InventoryTransactionResult类属于org.spongepowered.api.item.inventory.transaction包,在下文中一共展示了InventoryTransactionResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: give

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
public void give(Player player) {
	this.checkCache();
	for (ItemStackSnapshot iss : itemStacksCache) {
		InventoryTransactionResult result = player.getInventory().offer(iss.createStack());
		for (ItemStackSnapshot is : result.getRejectedItems()) {
			Item item = (Item) player.getLocation().getExtent().createEntity(EntityTypes.ITEM, player.getLocation().getPosition());
			item.offer(Keys.REPRESENTED_ITEM, is.copy());
			player.getWorld().spawnEntity(item, Cause.of(NamedCause.source(player), NamedCause.owner("BetterKits")));
		}
	}

	for (String command : this.getCommands()) {
		try {
			Sponge.getCommandManager().process(Sponge.getServer().getConsole(), command.replace("%name", player.getName()).replace("%uuid", player.getUniqueId().toString()));
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:KaiKikuchi,项目名称:BetterKits,代码行数:20,代码来源:Kit.java


示例2: peekOffer

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
private PeekedOfferTransactionResult peekOffer(ItemStack stack, Set<Inventory> processed, boolean add) {
    PeekedOfferTransactionResult peekResult = null;
    final List<SlotTransaction> transactions = new ArrayList<>();
    // Loop through the slots
    for (AbstractInventory inventory : getChildren()) {
        if (!add && processed.contains(inventory)) {
            continue;
        }
        peekResult = inventory.peekOffer(stack);
        if (peekResult.isSuccess()) {
            final Optional<ItemStack> rejectedItem = peekResult.getRejectedItem();
            transactions.addAll(peekResult.getTransactions());
            if (!rejectedItem.isPresent()) {
                return new PeekedOfferTransactionResult(InventoryTransactionResult.Type.SUCCESS, transactions, null);
            }
            stack = rejectedItem.get();
        }
        if (add) {
            processed.add(inventory);
        }
    }
    if (peekResult == null) {
        return new PeekedOfferTransactionResult(InventoryTransactionResult.Type.FAILURE, ImmutableList.of(), stack);
    }
    return new PeekedOfferTransactionResult(InventoryTransactionResult.Type.SUCCESS, transactions, peekResult.getRejectedItem().orElse(null));
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:27,代码来源:AbstractChildrenInventory.java


示例3: findLogTool

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void findLogTool(Player player, LookupData logType)
{
    ItemStack itemStack = Sponge.getGame().getRegistry().createBuilder(ItemStack.Builder.class).itemType(ItemTypes.BOOK).quantity(1).build();
    itemStack.offer(Keys.DISPLAY_NAME, toolName);
    itemStack.offer(Keys.ITEM_LORE, asList(i18n.translate(player, NONE, "created by {name}", player.getName())));
    itemStack.offer(Keys.ITEM_ENCHANTMENTS, Collections.emptyList());
    itemStack.offer(logType);
    java.util.Optional<ItemStack> inHand = player.getItemInHand(HandTypes.MAIN_HAND);
    player.setItemInHand(HandTypes.MAIN_HAND, itemStack);
    if (inHand.isPresent())
    {
        if (player.getInventory().offer(inHand.get()).getType() != InventoryTransactionResult.Type.SUCCESS)
        {
            SpawnUtil.spawnItem(inHand.get(), player.getLocation());
        }
    }
    i18n.send(player, POSITIVE, "Received a new Log-Tool!");
}
 
开发者ID:CubeEngine,项目名称:modules-extra,代码行数:20,代码来源:VigilCommands.java


示例4: execute

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override public CommandResult execute(CommandSource commandSource, CommandContext commandContext) throws CommandException {
    if(commandContext.getOne("type").isPresent() && commandSource instanceof Player) {
        String type = commandContext.<String>getOne("type").get();
        Player player = (Player) commandSource;
        VirtualCrate virtualCrate = HuskyCrates.instance.getCrateUtilities().getVirtualCrate(type);
        if (virtualCrate == null) {
            commandSource.sendMessage(Text.of("Invalid crate id: " + type + ". Please check your config."));
            return CommandResult.empty();
        }



        ItemStack keyItemStack = virtualCrate.getCrateWand();
        InventoryTransactionResult.Type mainInventory = player.getInventory().offer(keyItemStack.copy()).getType();
        if (!mainInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
            InventoryTransactionResult.Type enderInventory = player.getEnderChestInventory().offer(keyItemStack.copy()).getType();
            if(!enderInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
                commandSource.sendMessage(Text.of("Couldn't give wand to " + player.getName() + " because of a full inventory and enderchest"));
                HuskyCrates.instance.logger.info("Couldn't give wand to " + player.getName() + " because of a full inventory and enderchest");
            }else{
                player.sendMessage(Text.of("You have been given a ", TextSerializers.FORMATTING_CODE.deserialize(virtualCrate.displayName) ," wand, but it has been placed in your Ender Chest."));
            }
        }
    }else{
        commandSource.sendMessage(Text.of("Usage: /crate wand <id>"));
    }
    return CommandResult.success();
}
 
开发者ID:codeHusky,项目名称:HuskyCrates-Sponge,代码行数:29,代码来源:Wand.java


示例5: execute

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override public CommandResult execute(CommandSource commandSource, CommandContext commandContext) throws CommandException {
    if(commandContext.getOne("type").isPresent()) {
        String type = commandContext.<String>getOne("type").get();
        Optional<Player> player = commandContext.getOne("player");
        VirtualCrate virtualCrate = HuskyCrates.instance.getCrateUtilities().getVirtualCrate(type);
        int quantity = commandContext.getOne("quantity").isPresent() ? commandContext.<Integer>getOne("quantity").get() : 1;
        if (virtualCrate == null) {
            commandSource.sendMessage(Text.of("Invalid crate id: " + type + ". Please check your config."));
            return CommandResult.empty();
        }

        if (!player.isPresent()) {
            commandSource.sendMessage(Text.of("You need to be in game or specify a player for this command to work."));
            return CommandResult.empty();
        }
        ItemStack keyItemStack = virtualCrate.getCrateKey(quantity);
        InventoryTransactionResult.Type mainInventory = player.get().getInventory().offer(keyItemStack.copy()).getType();
        if (!mainInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
            InventoryTransactionResult.Type enderInventory = player.get().getEnderChestInventory().offer(keyItemStack.copy()).getType();
            if (!enderInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
                commandSource.sendMessage(Text.of("Couldn't give key to " + player.get().getName() + " because of a full inventory and enderchest"));
                HuskyCrates.instance.logger.info("Couldn't give key to " + player.get().getName() + " because of a full inventory and enderchest");
            } else {
                if (player.isPresent()) {
                    player.get().sendMessage(Text.of("You have been given 1 or more ", TextSerializers.FORMATTING_CODE.deserialize(virtualCrate.displayName), " key(s), but some have been placed in your Ender Chest."));
                } else {
                    commandSource.sendMessage(Text.of("You have been given 1 or more ", TextSerializers.FORMATTING_CODE.deserialize(virtualCrate.displayName), " key(s), but some have been placed in your Ender Chest."));
                }
            }
        }
    }else{
        commandSource.sendMessage(Text.of("Usage: /crate key <id> [player] [count]"));
    }
    return CommandResult.success();
}
 
开发者ID:codeHusky,项目名称:HuskyCrates-Sponge,代码行数:36,代码来源:Key.java


示例6: execute

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override public CommandResult execute(CommandSource commandSource, CommandContext commandContext) throws CommandException {
    if(commandContext.getOne("type").isPresent()) {
        String type = commandContext.<String>getOne("type").get();
        Optional<Player> player = commandContext.getOne("player");
        VirtualCrate virtualCrate = HuskyCrates.instance.getCrateUtilities().getVirtualCrate(type);
        int quantity = commandContext.getOne("quantity").isPresent() ? commandContext.<Integer>getOne("quantity").get() : 1;
        if (virtualCrate == null) {
            commandSource.sendMessage(Text.of("Invalid crate id: " + type + ". Please check your config."));
            return CommandResult.empty();
        }


        if (!player.isPresent()) {
            commandSource.sendMessage(Text.of("You need to either specify a player or be in game"));
            return CommandResult.empty();
        }

        ItemStack chestItemStack = virtualCrate.getCrateItem(quantity);
        InventoryTransactionResult.Type mainInventory = player.get().getInventory().offer(chestItemStack.copy()).getType();
        if (!mainInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
            InventoryTransactionResult.Type enderInventory = player.get().getEnderChestInventory().offer(chestItemStack.copy()).getType();
            if(!enderInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
                commandSource.sendMessage(Text.of("Couldn't give chest to " + player.get().getName() + " because of a full inventory and enderchest"));
                HuskyCrates.instance.logger.info("Couldn't give chest to " + player.get().getName() + " because of a full inventory and enderchest");
            }else{
                if(player.isPresent()) {
                    player.get().sendMessage(Text.of("You have been given 1 or more ", TextSerializers.FORMATTING_CODE.deserialize(virtualCrate.displayName) ," crate(s), but some have been placed in your Ender Chest."));
                }else{
                    commandSource.sendMessage(Text.of("You have been given 1 or more ", TextSerializers.FORMATTING_CODE.deserialize(virtualCrate.displayName) ," crate(s), but some have been placed in your Ender Chest."));
                }
            }
        }
    }else{
        commandSource.sendMessage(Text.of("Usage: /crate chest <id> [player]"));
    }

    return CommandResult.success();

}
 
开发者ID:codeHusky,项目名称:HuskyCrates-Sponge,代码行数:40,代码来源:Chest.java


示例7: execute

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override public CommandResult execute(CommandSource commandSource, CommandContext commandContext) throws CommandException {
    if(commandContext.getOne("type").isPresent()) {
        String type = commandContext.<String>getOne("type").get();
        VirtualCrate virtualCrate = HuskyCrates.instance.getCrateUtilities().getVirtualCrate(type);
        int quantity = commandContext.getOne("quantity").isPresent() ? commandContext.<Integer>getOne("quantity").get() : 1;
        if (virtualCrate == null) {
            commandSource.sendMessage(Text.of("Invalid crate id: " + type + ". Please check your config."));
            return CommandResult.empty();
        }


        for(Player player : Sponge.getServer().getOnlinePlayers()) {
            ItemStack keyItemStack = virtualCrate.getCrateKey(quantity);
            InventoryTransactionResult.Type mainInventory = player.getInventory().offer(keyItemStack.copy()).getType();
            if (!mainInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
                InventoryTransactionResult.Type enderInventory = player.getEnderChestInventory().offer(keyItemStack.copy()).getType();
                if (!enderInventory.equals(InventoryTransactionResult.Type.SUCCESS)) {
                    commandSource.sendMessage(Text.of("Couldn't give key to " + player.getName() + " because of a full inventory and enderchest"));
                    HuskyCrates.instance.logger.info("Couldn't give key to " + player.getName() + " because of a full inventory and enderchest");
                } else {
                    player.sendMessage(Text.of("You have been given 1 or more ", TextSerializers.FORMATTING_CODE.deserialize(virtualCrate.displayName), " key(s), but some have been placed in your Ender Chest."));
                }
            }
        }
    }else{
        commandSource.sendMessage(Text.of("Usage: /crate keyall <id> [count]"));
    }
    return CommandResult.success();
}
 
开发者ID:codeHusky,项目名称:HuskyCrates-Sponge,代码行数:30,代码来源:KeyAll.java


示例8: giveItem

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
/**
 * Ajouter un item dans l'inventaire du joueur
 * @param itemstack L'itemstack
 */
public Optional<ItemStack> giveItem(final ItemStack itemstack) {
	InventoryTransactionResult transaction = this.getInventory().query(Hotbar.class).offer(itemstack);
	if (!transaction.getRejectedItems().isEmpty()) {
		transaction = this.getInventory().query(GridInventory.class).offer(transaction.getRejectedItems().iterator().next().createStack());
		if (!transaction.getRejectedItems().isEmpty()) {
			return Optional.of(transaction.getRejectedItems().iterator().next().createStack());
		}
	}
	return Optional.empty();
}
 
开发者ID:EverCraft,项目名称:EverAPI,代码行数:15,代码来源:EPlayer.java


示例9: equip

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override
default boolean equip(EquipmentType type, @Nullable ItemStack equipment) {
    checkNotNull(type, "type");
    final Inventory inventory = getInventory().query(Holder.EQUIPMENT_INVENTORY_OPERATION);
    if (inventory instanceof EmptyInventory) {
        return false;
    }
    final AbstractSlot slot = (AbstractSlot) inventory.<IEquipmentInventory>first().getSlot(type).orElse(null);
    if (slot == null) {
        return false;
    }
    final InventoryTransactionResult result = slot.set(equipment);
    return result.getType().equals(InventoryTransactionResult.Type.SUCCESS);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:15,代码来源:AbstractEquipable.java


示例10: insertRecord

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override
public void insertRecord(ItemStack record) {
    checkNotNull(record, "record");
    ejectRecord();
    checkState(this.inventory.set(record).getType() == InventoryTransactionResult.Type.SUCCESS,
            "Invalid record item stack: " + record);
    updateBlockState();
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:LanternJukebox.java


示例11: peekSet

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override
public PeekedSetTransactionResult peekSet(@Nullable ItemStack stack) {
    if (!LanternItemStack.isEmpty(stack) && !isValidItem(stack)) {
        return new PeekedSetTransactionResult(InventoryTransactionResult.Type.FAILURE, ImmutableList.of(), stack, null);
    }
    stack = LanternItemStack.toNullable(stack);
    final List<SlotTransaction> transactions = new ArrayList<>();
    final ItemStackSnapshot oldItem = LanternItemStack.toSnapshot(this.itemStack);
    ItemStack rejectedItem = null;
    ItemStack replacedItem = oldItem.isEmpty() ? null : this.itemStack.copy();
    ItemStackSnapshot newItem = ItemStackSnapshot.NONE;
    if (stack != null) {
        final int maxStackSize = Math.min(stack.getMaxStackQuantity(), this.maxStackSize);
        final int quantity = stack.getQuantity();
        if (quantity > maxStackSize) {
            stack = stack.copy();
            stack.setQuantity(maxStackSize);
            newItem = LanternItemStack.toSnapshot(stack);
            // Create the rest stack that was rejected,
            // because the inventory doesn't allow so many items
            rejectedItem = stack.copy();
            rejectedItem.setQuantity(quantity - maxStackSize);
        } else {
            newItem = LanternItemStack.toSnapshot(stack);
        }
    }
    transactions.add(new SlotTransaction(this, oldItem, newItem));
    return new PeekedSetTransactionResult(InventoryTransactionResult.Type.SUCCESS, transactions, rejectedItem, replacedItem);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:30,代码来源:AbstractInventorySlot.java


示例12: set

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
private InventoryTransactionResult set(@Nullable ItemStack stack, boolean forced) {
    stack = LanternItemStack.toNullable(stack);
    boolean fail = false;
    if (stack != null) {
        if (stack.getQuantity() <= 0) {
            stack = null;
        } else if (!forced) {
            fail = !isValidItem(stack);
        }
    }
    if (fail) {
        return InventoryTransactionResult.builder()
                .type(InventoryTransactionResult.Type.FAILURE)
                .reject(stack)
                .build();
    }
    InventoryTransactionResult.Builder resultBuilder = InventoryTransactionResult.builder()
            .type(InventoryTransactionResult.Type.SUCCESS);
    if (this.itemStack != null) {
        resultBuilder.replace(this.itemStack);
    }
    if (stack != null) {
        stack = stack.copy();
        final int maxStackSize = Math.min(stack.getMaxStackQuantity(), this.maxStackSize);
        final int quantity = stack.getQuantity();
        if (quantity > maxStackSize) {
            stack.setQuantity(maxStackSize);
            // Create the rest stack that was rejected,
            // because the inventory doesn't allow so many items
            stack = stack.copy();
            stack.setQuantity(quantity - maxStackSize);
            resultBuilder.reject(stack);
        }
    }
    this.itemStack = (LanternItemStack) stack;
    queueUpdate();
    return resultBuilder.build();
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:39,代码来源:AbstractInventorySlot.java


示例13: asInventoryTransactionBuilder

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override
protected InventoryTransactionResult.Builder asInventoryTransactionBuilder() {
    final InventoryTransactionResult.Builder builder = super.asInventoryTransactionBuilder();
    if (this.replacedItem != null) {
        builder.replace(this.replacedItem);
    }
    return builder;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:PeekedSetTransactionResult.java


示例14: PeekedOfferTransactionResult

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
/**
 * Constructs a new {@link PeekedOfferTransactionResult}.
 *
 * @param type The type of the transaction result
 * @param transactions The slot transactions that will occur
 * @param rejectedItem The rejected item stack, this can occur if the stack doesn't fit the inventory
 */
public PeekedOfferTransactionResult(InventoryTransactionResult.Type type, List<SlotTransaction> transactions,
        @Nullable ItemStack rejectedItem) {
    super(transactions);
    checkNotNull(type, "type");
    this.type = type;
    this.rejectedItem = rejectedItem;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:15,代码来源:PeekedOfferTransactionResult.java


示例15: asInventoryTransactionBuilder

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
protected InventoryTransactionResult.Builder asInventoryTransactionBuilder() {
    final InventoryTransactionResult.Builder builder = InventoryTransactionResult.builder();
    builder.type(this.type);
    if (this.rejectedItem != null) {
        builder.reject(this.rejectedItem);
    }
    return builder;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:PeekedOfferTransactionResult.java


示例16: asTransactionResult

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
/**
 * Converts this {@link FastOfferResult} into a
 * {@link InventoryTransactionResult}.
 *
 * @return The transaction result
 */
public InventoryTransactionResult asTransactionResult() {
    if (this.rejectedItem == null && this.success) {
        return CachedInventoryTransactionResults.SUCCESS_NO_TRANSACTIONS;
    } else {
        final InventoryTransactionResult.Builder builder = InventoryTransactionResult.builder();
        builder.type(this.success ? InventoryTransactionResult.Type.SUCCESS : InventoryTransactionResult.Type.FAILURE);
        if (this.rejectedItem != null) {
            builder.reject(this.rejectedItem);
        }
        return builder.build();
    }
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:19,代码来源:FastOfferResult.java


示例17: set

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
/**
 * Set the item for the specified equipment type.
 *
 * @see Inventory#set(ItemStack)
 * @param equipmentType Type of equipment slot to set
 * @param stack The stack to insert
 * @return The operation result, for details see {@link Inventory#set}
 */
default InventoryTransactionResult set(EquipmentSlotType equipmentType, @Nullable ItemStack stack) {
    checkNotNull(equipmentType, "equipmentType");
    //noinspection ConstantConditions
    return getSlot(equipmentType).map(slot -> slot.set(stack))
            .orElseGet(() -> InventoryTransactionResult.builder()
                    .type(InventoryTransactionResult.Type.FAILURE)
                    .reject(LanternItemStack.toSnapshot(stack).createStack())
                    .build());
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:18,代码来源:IEquipmentInventory.java


示例18: giveItems

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
public static Clause<Boolean, List<Clause<ItemStack, Integer>>> giveItems(Player player, Collection<ItemStack> stacks, Cause cause) {
  List<Clause<ItemStack, Integer>> transactions = new ArrayList<>(stacks.size());
  List<ItemStackSnapshot> itemBuffer = new ArrayList<>();
  itemBuffer.addAll(stacks.stream().map(ItemStack::createSnapshot).collect(Collectors.toList()));

  PlayerInventory playerInventory = player.getInventory().query(PlayerInventory.class);
  List<Inventory> inventories = new ArrayList<>();
  inventories.add(playerInventory.getHotbar());
  inventories.add(playerInventory.getMain());

  // Loop through replacing empty space with the requested items
  for (Inventory inventory : inventories) {
    List<ItemStackSnapshot> newBuffer = new ArrayList<>();
    for (ItemStackSnapshot snapshot : itemBuffer) {
      ItemStack stack = snapshot.createStack();

      InventoryTransactionResult result = inventory.offer(stack);
      newBuffer.addAll(result.getRejectedItems());

      transactions.add(new Clause<>(stack, stack.getQuantity()));
    }
    itemBuffer = newBuffer;
  }

  // Drop remaining items
  new ItemDropper(player.getLocation()).dropStackSnapshots(itemBuffer, SpawnTypes.PLUGIN);

  return new Clause<>(true, transactions);
}
 
开发者ID:Skelril,项目名称:Skree,代码行数:30,代码来源:MarketImplUtil.java


示例19: setForced

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override
public InventoryTransactionResult setForced(@Nullable ItemStack stack) {
    return set(stack, true);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:AbstractInventorySlot.java


示例20: peekOffer

import org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult; //导入依赖的package包/类
@Override
public PeekedOfferTransactionResult peekOffer(ItemStack itemStack) {
    return new PeekedOfferTransactionResult(InventoryTransactionResult.Type.FAILURE, ImmutableList.of(), itemStack);
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternEmptyInventory.java



注:本文中的org.spongepowered.api.item.inventory.transaction.InventoryTransactionResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Parser类代码示例发布时间:2022-05-22
下一篇:
Java NamingContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap