本文整理汇总了Java中thaumcraft.api.aspects.IEssentiaTransport.getMinimumSuction方法的典型用法代码示例。如果您正苦于以下问题:Java IEssentiaTransport.getMinimumSuction方法的具体用法?Java IEssentiaTransport.getMinimumSuction怎么用?Java IEssentiaTransport.getMinimumSuction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thaumcraft.api.aspects.IEssentiaTransport
的用法示例。
在下文中一共展示了IEssentiaTransport.getMinimumSuction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillJar
import thaumcraft.api.aspects.IEssentiaTransport; //导入方法依赖的package包/类
private void fillJar() {
TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN);
if (te != null) {
IEssentiaTransport ic = (IEssentiaTransport) te;
if (!ic.canOutputTo(ForgeDirection.UP)) {
return;
}
Aspect ta = null;
if (this.aspectFilter != null) {
ta = this.aspectFilter;
} else if ((this.aspect != null) && (this.amount > 0)) {
ta = this.aspect;
} else if ((ic.getEssentiaAmount(ForgeDirection.UP) > 0) &&
(ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN)) && (getSuctionAmount(ForgeDirection.DOWN) >= ic.getMinimumSuction())) {
ta = ic.getEssentiaType(ForgeDirection.UP);
}
if ((ta != null) && (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN))) {
addToContainer(ta, ic.takeEssentia(ta, 1, ForgeDirection.UP));
}
}
}
示例2: fillJar
import thaumcraft.api.aspects.IEssentiaTransport; //导入方法依赖的package包/类
private void fillJar() {
ForgeDirection inputDir = placedOn.getOpposite();
TileEntity te = ThaumcraftApiHelper.getConnectableTile(parent.getWorldObj(), parent.xCoord, parent.yCoord, parent.zCoord, inputDir);
if (te != null)
{
IEssentiaTransport ic = (IEssentiaTransport)te;
if (!ic.canOutputTo(ForgeDirection.DOWN)) {
return;
}
Aspect ta = null;
if (parent.aspectFilter != null) {
ta = parent.aspectFilter;
} else if ((parent.aspect != null) && (parent.amount > 0)) {
ta = parent.aspect;
} else if ((ic.getEssentiaAmount(inputDir.getOpposite()) > 0) &&
(ic.getSuctionAmount(inputDir.getOpposite()) < getSuctionAmount(ForgeDirection.UP)) && (getSuctionAmount(ForgeDirection.UP) >= ic.getMinimumSuction())) {
ta = ic.getEssentiaType(inputDir.getOpposite());
}
if ((ta != null) && (ic.getSuctionAmount(inputDir.getOpposite()) < getSuctionAmount(ForgeDirection.UP))) {
addToContainer(ta, ic.takeEssentia(ta, 1, inputDir.getOpposite()));
}
}
}
示例3: takeEssentiaFromTransportNeighbors
import thaumcraft.api.aspects.IEssentiaTransport; //导入方法依赖的package包/类
public void takeEssentiaFromTransportNeighbors( final IEssentiaTransportWithSimulate destination, final World world, final int x, final int y,
final int z )
{
// Null checks
if( ( destination == null ) || ( world == null ) )
{
return;
}
// For each side
for( ForgeDirection destinationSide : ForgeDirection.VALID_DIRECTIONS )
{
// Can the destination accept essentia from this side?
if( !destination.canInputFrom( destinationSide ) )
{
// Destination can not accept essentia from this side
continue;
}
// Get the source
TileEntity sourceTile = world.getTileEntity( destinationSide.offsetX + x, destinationSide.offsetY + y, destinationSide.offsetZ + z );
// Ensure the source is a transport
if( !( sourceTile instanceof IEssentiaTransport ) )
{
// Invalid source
continue;
}
// Cast
IEssentiaTransport source = (IEssentiaTransport)sourceTile;
// Get the opposite direction
ForgeDirection sourceSide = destinationSide.getOpposite();
// Can the source output to this side?
if( !source.canOutputTo( sourceSide ) )
{
// Source can not output to this side
continue;
}
// Does the source have any essentia to give?
if( source.getEssentiaAmount( sourceSide ) <= 0 )
{
// No essentia from this side
continue;
}
// Does the destination have enough suction?
int dSuck = destination.getSuctionAmount( destinationSide );
if( ( dSuck < source.getMinimumSuction() ) || ( dSuck < source.getSuctionAmount( sourceSide ) ) )
{
// Destination does not have enough suction.
continue;
}
// Get the source aspect
Aspect sourceAspect = source.getEssentiaType( sourceSide );
if( sourceAspect == null )
{
// Invalid aspect
continue;
}
// Simulate an injection
if( destination.addEssentia( sourceAspect, 1, destinationSide, Actionable.SIMULATE ) == 1 )
{
// Inject
destination.addEssentia( sourceAspect, source.takeEssentia( sourceAspect, 1, sourceSide ), destinationSide, Actionable.MODULATE );
}
}
}