本文整理匯總了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);
}