本文整理汇总了Java中li.cil.oc.api.Driver类的典型用法代码示例。如果您正苦于以下问题:Java Driver类的具体用法?Java Driver怎么用?Java Driver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Driver类属于li.cil.oc.api包,在下文中一共展示了Driver类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: recomputeMemory
import li.cil.oc.api.Driver; //导入依赖的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;
}
示例2: calculateMemory
import li.cil.oc.api.Driver; //导入依赖的package包/类
private int calculateMemory(Iterable<ItemStack> components) {
int memorySize = 0;
for (ItemStack component : components) {
if (Driver.driverFor(component) instanceof Memory) {
Memory driver = (Memory) Driver.driverFor(component);
memorySize += driver.amount(component) * 1024;
}
}
return Math.min(Math.max(memorySize, 0), Config.ARM_MAX_MEMORY);
}
示例3: addDrivers
import li.cil.oc.api.Driver; //导入依赖的package包/类
public static void addDrivers(){
Driver.add(new DriverAdvancedInfoPanel());
Driver.add(new DriverInfoPanel());
Driver.add(new DriverThermalMonitor());
Driver.add(new DriverHowlerAlarm());
Driver.add(new DriverAverageCounter());
Driver.add(new DriverEnergyCounter());
}
示例4: initializeDrivers
import li.cil.oc.api.Driver; //导入依赖的package包/类
@Optional.Method(modid = ModIds.OPEN_COMPUTERS)
private void initializeDrivers() {
Driver.add(new DriverPneumaticCraft());
}
示例5: init
import li.cil.oc.api.Driver; //导入依赖的package包/类
public static void init(FMLInitializationEvent event)
{
Driver.add(new SimpleDimensionsCardDriver());
}
示例6: init
import li.cil.oc.api.Driver; //导入依赖的package包/类
public void init() {
Driver.add(new OpenComputersDriver());
}
示例7: init
import li.cil.oc.api.Driver; //导入依赖的package包/类
public void init() {
Driver.add(new OpenComputersDriver());
}
示例8: init
import li.cil.oc.api.Driver; //导入依赖的package包/类
@Override
public void init(FMLInitializationEvent ev) {
Driver.add(new DriverMotor());
}
示例9: initializeDrivers
import li.cil.oc.api.Driver; //导入依赖的package包/类
@Optional.Method(modid = ModIds.OPEN_COMPUTERS)
private void initializeDrivers(){
Driver.add(new DriverPneumaticCraft());
}
示例10: registerProvider
import li.cil.oc.api.Driver; //导入依赖的package包/类
public static void registerProvider() {
Driver.add(new DriverOpenPeripheral());
}