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

Java InventoryArchetype类代码示例

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

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



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

示例1: create

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public SimpleCustomInventory create(DataHolder dataHolder) {
    SimpleCustomInventory result = new SimpleCustomInventory(this, dataHolder);
    String typeId = getTypeId();
    InventoryArchetype archetype = InventoryArchetype.builder()
            .with(InventoryArchetypes.DOUBLE_CHEST)
            .property(new InventoryDimension(INVENTORY_SLOTS_WIDTH, getHeight()))
            .build(typeId, typeId);
    Inventory inventory = Inventory.builder()
            .of(archetype)
            .listener(InteractInventoryEvent.class, result)
            .build(CustomItemLibrary.getInstance());

    result.setInventory(inventory);
    populate(result);

    return result;
}
 
开发者ID:Limeth,项目名称:CustomItemLibrary,代码行数:19,代码来源:SimpleCustomInventoryDefinition.java


示例2: registerDefaults

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public void registerDefaults() {
    register(new UnknownInventoryArchetype("minecraft", "unknown"));
    register(new UnknownInventoryArchetype("minecraft", "empty"));

    for (Class<?> target : Arrays.asList(VanillaInventoryArchetypes.class, SpongeInventoryArchetypes.class)) {
        for (Field field : target.getFields()) {
            if (LanternInventoryArchetype.class.isAssignableFrom(field.getType())) {
                try {
                    register((InventoryArchetype) field.get(null));
                } catch (IllegalAccessException e) {
                    throw new IllegalStateException(e);
                }
            }
        }
    }
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:18,代码来源:InventoryArchetypeRegistryModule.java


示例3: getArchetypes

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
protected List<InventoryArchetype> getArchetypes() {
    if (this.cachedArchetypesList == null) {
        final List<PrioritizedObject<InventoryArchetype>> list = new ArrayList<>();
        for (int y = 0; y < this.slots.length; y++) {
            for (int x = 0; x < this.slots[y].length; x++) {
                checkState(this.slots[y][x] != null, "There is no slot bound at %s;%s", x, y);
                list.add((PrioritizedObject) this.slots[y][x]);
            }
        }
        this.cachedArchetypesList = list.stream()
                .sorted()
                .map(entry -> entry.object)
                .collect(ImmutableList.toImmutableList());
    }
    return this.cachedArchetypesList;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:18,代码来源:AbstractGridInventory.java


示例4: Open

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
public CommandResult Open(CommandSource src, CommandContext args, InventoryArchetype invArch, Text inventorytitle) {
    final Inventory invx = Inventory.builder().of(invArch)
            .property(InventoryTitle.PROPERTY_NAME, new InventoryTitle(inventorytitle))
            .build(vt);
    return this.Open(src, args, invx);

}
 
开发者ID:poqdavid,项目名称:VirtualTool,代码行数:8,代码来源:Invs.java


示例5: from

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public InventoryArchetype.Builder from(InventoryArchetype value) {
    checkNotNull(value, "value");
    this.baseArchetype = (LanternInventoryArchetype<?>) value;
    this.archetypes.clear();
    this.properties.clear();
    return this;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:LanternInventoryArchetypeBuilder.java


示例6: reset

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public InventoryArchetype.Builder reset() {
    this.baseArchetype = null;
    this.archetypes.clear();
    this.properties.clear();
    return this;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:8,代码来源:LanternInventoryArchetypeBuilder.java


示例7: with

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public InventoryArchetype.Builder with(InventoryArchetype archetype) {
    checkNotNull(archetype, "archetype");
    if (this.baseArchetype != null && this.baseArchetype.getBuilder() instanceof AbstractSlot.Builder) {
        throw new IllegalArgumentException("Slots cannot contain children InventoryArchetypes.");
    }
    this.archetypes.add((LanternInventoryArchetype<?>) archetype);
    return this;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:10,代码来源:LanternInventoryArchetypeBuilder.java


示例8: of

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public LanternInventoryBuilder<T> of(InventoryArchetype archetype) {
    checkNotNull(archetype, "archetype");
    this.inventoryArchetype = (LanternInventoryArchetype<T>) archetype;
    this.builder = null; // Regenerate the builder if needed
    return this;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:8,代码来源:LanternInventoryBuilder.java


示例9: parseInventory

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
private static Inventory parseInventory(ItemBank<ItemStack, Logger, Player, World> plugin, AccountPage<ItemStack> page, String ownerName, World world) {
    String name = ownerName + "'s Account for " + world.getName() + " - Page " + page.getPage();
    InventoryArchetype.Builder builder = InventoryArchetype.builder().property(new InventoryCapacity(54)).title(Text.of(name));
    for (int i = 0; i < 54; i++) {
        builder.with(InventoryArchetype.builder().from(InventoryArchetypes.SLOT).property(new SlotIndex(i)).build("minecraft:slot" + i, "Slot"));
    }

    Inventory inventory = Inventory.builder().of(builder.build(plugin.getId() + ":" + name.replace("\\s", "_").replace("'", "").replace("-", ""), name)).build(plugin);
    page.getSlots().values().forEach(slot -> setItem(inventory, slot.getSlot(), slot.getItemStack()));
    return inventory;
}
 
开发者ID:Musician101,项目名称:ItemBank,代码行数:12,代码来源:SpongeInventoryHandler.java


示例10: getInventoryType

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public InventoryArchetype getInventoryType() {
    return InventoryArchetypeRegistryModule.getInstance().getById(inventoryType).orElse(InventoryArchetypes.UNKNOWN);
}
 
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:5,代码来源:MixinPacketOpenWindow.java


示例11: setInventoryType

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public void setInventoryType(InventoryArchetype inventoryType) {
    this.inventoryType = inventoryType.getId();
}
 
开发者ID:Guichaguri,项目名称:PacketControl,代码行数:5,代码来源:MixinPacketOpenWindow.java


示例12: getArchetype

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public InventoryArchetype getArchetype() {
    return VanillaInventoryArchetypes.DOUBLE_CHEST;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:DoubleChestInventory.java


示例13: getArchetypes

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
protected List<InventoryArchetype> getArchetypes() {
    return Collections.emptyList();
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:AbstractInventorySlot.java


示例14: getArchetype

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public InventoryArchetype getArchetype() {
    return LanternInventoryArchetypes.EMPTY;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:LanternEmptyInventory.java


示例15: getArchetype

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public InventoryArchetype getArchetype() {
    return this.archetype == null ? InventoryArchetypes.UNKNOWN : this.archetype;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:AbstractMutableInventory.java


示例16: getArchetypes

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
protected List<InventoryArchetype> getArchetypes() {
    return (List) this.inventories;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:AbstractOrderedInventory.java


示例17: getChildArchetypes

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public List<InventoryArchetype> getChildArchetypes() {
    return this.childArchetypes;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:BuilderInventoryArchetype.java


示例18: getChildArchetypes

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
@Override
public List<InventoryArchetype> getChildArchetypes() {
    return Collections.emptyList();
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:5,代码来源:UnknownInventoryArchetype.java


示例19: setArchetype

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
/**
 * Sets the {@link InventoryArchetype} of this inventory.
 *
 * @param archetype The archetype
 */
void setArchetype(InventoryArchetype archetype) {
    this.archetype = archetype;
}
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:9,代码来源:AbstractMutableInventory.java


示例20: getArchetypes

import org.spongepowered.api.item.inventory.InventoryArchetype; //导入依赖的package包/类
/**
 * Gets a {@link List} with all the children {@link InventoryArchetype}s.
 *
 * @return The inventory archetypes
 */
protected abstract List<InventoryArchetype> getArchetypes();
 
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:7,代码来源:AbstractArchetypeBuilder.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java ReusableAnalyzerBase类代码示例发布时间:2022-05-22
下一篇:
Java DefaultEurekaClientConfig类代码示例发布时间: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