本文整理汇总了Java中li.cil.oc.api.driver.Item类的典型用法代码示例。如果您正苦于以下问题:Java Item类的具体用法?Java Item怎么用?Java Item使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Item类属于li.cil.oc.api.driver包,在下文中一共展示了Item类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: recomputeMemory
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
public boolean recomputeMemory(Iterable<ItemStack> components) {
numMappedRamBanks = 0;
ramTier = 3;
for(ItemStack stack : components) {
Item driver = Driver.driverFor(stack);
if(driver instanceof li.cil.oc.api.driver.item.Memory) {
double amount = ((li.cil.oc.api.driver.item.Memory)driver).amount(stack);
int tier = (int)Math.floor(amount);
if(tier < 0) tier = 0;
else if(tier > 2) tier = 2;
if(tier < ramTier) ramTier = tier;
numMappedRamBanks += MainClass.instance.getMemoryModuleBankCount(amount);
}
else if(driver instanceof Processor) {
cpuTier = driver.tier(stack);
parent.cpuCyclesPerTick = MainClass.instance.getCPUCyclesPerTick(cpuTier);
}
}
if(numMappedRamBanks > 0x1FFF) numMappedRamBanks = 0x1FFF;
remapMemory();
return true;
}
开发者ID:SolraBizna,项目名称:j6502,代码行数:23,代码来源:MMU.java
示例2: add
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Registers a new item driver.
* <p/>
* Item components can inserted into a computers component slots. They have
* to specify their type, to determine into which slots they can fit.
* <p/>
* This must be called in the init phase, <em>not</em> the pre- or post-init
* phases.
*
* @param driver the driver to register.
*/
public static void add(final Item driver) {
if (API.driver != null)
API.driver.add(driver);
}
开发者ID:Herobone,项目名称:HeroUtils,代码行数:16,代码来源:Driver.java
示例3: driverFor
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Looks up a driver for the specified item stack.
* <p/>
* Note that unlike for blocks, there can always only be one item driver
* per item. If there are multiple ones, the first one that was registered
* will be used.
*
* @param stack the item stack to get a driver for.
* @param host the type that will host the environment created by returned driver.
* @return a driver for the item, or <tt>null</tt> if there is none.
*/
public static Item driverFor(ItemStack stack, Class<? extends EnvironmentHost> host) {
if (API.driver != null)
return API.driver.driverFor(stack, host);
return null;
}
开发者ID:Herobone,项目名称:HeroUtils,代码行数:17,代码来源:Driver.java
示例4: itemDrivers
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Get a list of all registered item drivers.
* <p/>
* This is intended to allow checking for particular drivers using more
* customized logic.
* <p/>
* The returned collection is read-only.
*
* @return the list of all registered item drivers.
*/
public static Collection<Item> itemDrivers() {
if (API.driver != null)
return API.driver.itemDrivers();
return null;
}
开发者ID:Herobone,项目名称:HeroUtils,代码行数:16,代码来源:Driver.java
示例5: add
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Registers a new driver for an item component.
* <p/>
* Item components can inserted into a computers component slots. They have
* to specify their type, to determine into which slots they can fit.
* <p/>
* This must be called in the init phase, <em>not</em> the pre- or post-init
* phases.
*
* @param driver the driver for an item component.
*/
void add(Item driver);
开发者ID:Herobone,项目名称:HeroUtils,代码行数:13,代码来源:DriverAPI.java
示例6: driverFor
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Looks up a driver for the specified item stack.
* <p/>
* Note that unlike for blocks, there can always only be one item driver
* per item. If there are multiple ones, the first one that was registered
* will be used.
*
* @param stack the item stack to get a driver for.
* @param host the type that will host the environment created by returned driver.
* @return a driver for the item, or <tt>null</tt> if there is none.
*/
Item driverFor(ItemStack stack, Class<? extends EnvironmentHost> host);
开发者ID:Herobone,项目名称:HeroUtils,代码行数:13,代码来源:DriverAPI.java
示例7: itemDrivers
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Get a list of all registered item drivers.
* <p/>
* This is intended to allow checking for particular drivers using more
* customized logic.
* <p/>
* The returned collection is read-only.
*
* @return the list of all registered item drivers.
*/
Collection<Item> itemDrivers();
开发者ID:Herobone,项目名称:HeroUtils,代码行数:12,代码来源:DriverAPI.java
示例8: itemDrivers
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Get a list of all registered item drivers.
* <p/>
* This is intended to allow checking for particular drivers using more
* customized logic, and in particular to check for drivers with the
* {@link li.cil.oc.api.driver.EnvironmentAware} interface.
* <p/>
* The returned collection is read-only.
*
* @return the list of all registered item drivers.
*/
public static Collection<Item> itemDrivers() {
if (API.driver != null)
return API.driver.itemDrivers();
return null;
}
开发者ID:amadornes,项目名称:Framez,代码行数:17,代码来源:Driver.java
示例9: itemDrivers
import li.cil.oc.api.driver.Item; //导入依赖的package包/类
/**
* Get a list of all registered item drivers.
* <p/>
* This is intended to allow checking for particular drivers using more
* customized logic, and in particular to check for drivers with the
* {@link li.cil.oc.api.driver.EnvironmentAware} interface.
*
* @return the list of all registered item drivers.
*/
Collection<Item> itemDrivers();
开发者ID:amadornes,项目名称:Framez,代码行数:11,代码来源:DriverAPI.java
注:本文中的li.cil.oc.api.driver.Item类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论