本文整理汇总了Java中ic2.api.energy.prefab.BasicSource类的典型用法代码示例。如果您正苦于以下问题:Java BasicSource类的具体用法?Java BasicSource怎么用?Java BasicSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BasicSource类属于ic2.api.energy.prefab包,在下文中一共展示了BasicSource类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tileFactorize
import ic2.api.energy.prefab.BasicSource; //导入依赖的package包/类
private void tileFactorize(LazyEnergyCapProvider lecp) {
if (broken) return;
final ICapabilityProvider cp = lecp.getObject();
if (cp == null || !(cp instanceof TileEntity)) return;
final TileEntity te = (TileEntity) cp;
final IEnergyTile et = EnergyNet.instance.getTile(te.getWorld(), te.getPos());
final IEnergySource esrc = et instanceof IEnergySource ? (IEnergySource) et : null;
final IEnergySink esnk = et instanceof IEnergySink ? (IEnergySink) et : null;
DoubleSupplier cfunc = et instanceof BasicSource ? ((BasicSource) et)::getCapacity : et instanceof BasicSink ? ((BasicSink) et)::getCapacity : null;
DoubleSupplier efunc = et instanceof BasicSource ? ((BasicSource) et)::getEnergyStored : et instanceof BasicSink ? ((BasicSink) et)::getEnergyStored : null;
if (IC2_TEB.isInstance(cp)) {
Object o = null;
try {
o = COMPONENT.invoke(cp, IC2_ENERGY);
} catch (Exception e) {
MCFluxReport.sendException(e, "[IC2] FluxCompat factorize");
}
cfunc = doubleFunc(CAPACITY, o);
efunc = doubleFunc(ENERGY, o);
}
final EUDelegate eud = new EUDelegate(cfunc, efunc, esnk, esrc);
final EnergyTile[] es = new EnergyTile[7];
for (int i = 0; i < U.FANCY_FACING.length; i++) {
EnumFacing f = U.FANCY_FACING[i];
es[i] = new EnergyTile(eud, f);
}
lecp.update(es, new int[0], null, true);
CloudUtils.reportEnergy(cp.getClass(), et.getClass(), "ic2");
}
示例2: TileHvTurbine
import ic2.api.energy.prefab.BasicSource; //导入依赖的package包/类
public TileHvTurbine() {
energy = new BasicSource(this, euPerBucket, 2);
}
示例3: TileLvTurbine
import ic2.api.energy.prefab.BasicSource; //导入依赖的package包/类
public TileLvTurbine() {
energy = new BasicSource(this, euPerBucket, 1);
}
示例4: TileEvTurbine
import ic2.api.energy.prefab.BasicSource; //导入依赖的package包/类
public TileEvTurbine() {
energy = new BasicSource(this, euPerBucket, 5);
}
示例5: TileMvTurbine
import ic2.api.energy.prefab.BasicSource; //导入依赖的package包/类
public TileMvTurbine() {
energy = new BasicSource(this, euPerBucket, 2);
}