本文整理汇总了Java中thaumcraft.api.aspects.IEssentiaTransport类的典型用法代码示例。如果您正苦于以下问题:Java IEssentiaTransport类的具体用法?Java IEssentiaTransport怎么用?Java IEssentiaTransport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IEssentiaTransport类属于thaumcraft.api.aspects包,在下文中一共展示了IEssentiaTransport类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getNeighborWantedAspect
import thaumcraft.api.aspects.IEssentiaTransport; //导入依赖的package包/类
protected Aspect getNeighborWantedAspect( final ForgeDirection side )
{
// Get the tile entity next to this side
TileEntity neighbor = this.worldObj.getTileEntity( this.xCoord + side.offsetX, this.yCoord + side.offsetY, this.zCoord + side.offsetZ );
// Do we have essentia transport neighbor?
if( ( neighbor != null ) && ( neighbor instanceof IEssentiaTransport ) )
{
// Get the aspect they want
Aspect wantedAspect = ( (IEssentiaTransport)neighbor ).getSuctionType( side.getOpposite() );
// Return the aspect they want
return wantedAspect;
}
return null;
}
示例4: getConnectableTile
import thaumcraft.api.aspects.IEssentiaTransport; //导入依赖的package包/类
public static TileEntity getConnectableTile(World world, int x, int y, int z, ForgeDirection face) {
TileEntity te = world.getTileEntity(x + face.offsetX, y + face.offsetY, z + face.offsetZ);
if ( (te instanceof IEssentiaTransport) && ((IEssentiaTransport) te).isConnectable(face.getOpposite())) {
return te;
}
else {
return null;
}
}
示例5: getConnectableTile
import thaumcraft.api.aspects.IEssentiaTransport; //导入依赖的package包/类
public static TileEntity getConnectableTile(World world, int x, int y, int z, ForgeDirection face) {
TileEntity te = world.getTileEntity(x+face.offsetX, y+face.offsetY, z+face.offsetZ);
if (te instanceof IEssentiaTransport && ((IEssentiaTransport)te).isConnectable(face.getOpposite()))
return te;
else
return null;
}
示例6: handleIO
import thaumcraft.api.aspects.IEssentiaTransport; //导入依赖的package包/类
private void handleIO() {
if ((!worldObj.isRemote) && ((ticksExisted & 15) == 0) && (getEssentiaAmount() < getMaxAmount())) {
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;
}
if ((holdingAspect != null) && (ic.getSuctionAmount(ForgeDirection.UP) < getSuctionAmount(ForgeDirection.DOWN))) {
addToContainer(holdingAspect, ic.takeEssentia(holdingAspect, 1, ForgeDirection.UP));
}
}
}
}
示例7: handleIO
import thaumcraft.api.aspects.IEssentiaTransport; //导入依赖的package包/类
private void handleIO() {
if (storedAmount < MAX_AMT) {
TileEntity te = ThaumcraftApiHelper.getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.UP);
if (te != null) {
IEssentiaTransport ic = (IEssentiaTransport) te;
if (!ic.canOutputTo(ForgeDirection.DOWN)) {
return;
}
if (ic.getSuctionAmount(ForgeDirection.DOWN) < getSuctionAmount(ForgeDirection.UP)) {
addToContainer(Aspect.ENTROPY, ic.takeEssentia(Aspect.ENTROPY, 1, ForgeDirection.DOWN));
}
}
}
}
示例8: getConnectableTile
import thaumcraft.api.aspects.IEssentiaTransport; //导入依赖的package包/类
public static TileEntity getConnectableTile(World world, int x, int y, int z, ForgeDirection face) {
TileEntity te = world.getTileEntity(x + face.offsetX, y + face.offsetY, z + face.offsetZ);
if (te instanceof IEssentiaTransport && ((IEssentiaTransport) te).isConnectable(face.getOpposite())) {
return te;
} else {
return null;
}
}