当前位置: 首页>>代码示例>>Java>>正文


Java ThaumcraftApiHelper.getConnectableTile方法代码示例

本文整理汇总了Java中thaumcraft.api.ThaumcraftApiHelper.getConnectableTile方法的典型用法代码示例。如果您正苦于以下问题:Java ThaumcraftApiHelper.getConnectableTile方法的具体用法?Java ThaumcraftApiHelper.getConnectableTile怎么用?Java ThaumcraftApiHelper.getConnectableTile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thaumcraft.api.ThaumcraftApiHelper的用法示例。


在下文中一共展示了ThaumcraftApiHelper.getConnectableTile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fillJar

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的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));
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:22,代码来源:TileBlockProtector.java

示例2: fillJar

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的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()));
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:25,代码来源:TileStickyJar.java

示例3: handleIO

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的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));
            }
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:16,代码来源:TileAuraPylon.java

示例4: handleIO

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的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));
            }
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:16,代码来源:TileAIShutdown.java

示例5: drawEssentia

import thaumcraft.api.ThaumcraftApiHelper; //导入方法依赖的package包/类
void drawEssentia()
{
    for(int x = 0;x < ForgeDirection.VALID_DIRECTIONS.length;x++){
        ForgeDirection current = ForgeDirection.VALID_DIRECTIONS[x];
        TileEntity te = ThaumcraftApiHelper.getConnectableTile(worldObj, xCoord, yCoord, zCoord, current);
        if(te != null) {
            IEssentiaTransport ic = (IEssentiaTransport)te;
            if(ic.canOutputTo(current.getOpposite()) && special < 64 //THE DIRECTION HERE MAY BE WRONG SPITEFULFOXY SO CHECK IT
                && ic.getEssentiaType(current.getOpposite()) == aspect && ic.getEssentiaAmount(current.getOpposite()) > 0 && ic.takeEssentia(aspect, 1, current.getOpposite()) == 1) {
                special++;
                worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                return;
            }
            else if(ic.canOutputTo(current.getOpposite()) && wrath < 64 && special < Config.wrathCost
                && ic.getEssentiaType(current.getOpposite()) == DarkAspects.WRATH && ic.getEssentiaAmount(current.getOpposite()) > 0 && ic.takeEssentia(DarkAspects.WRATH, 1, current.getOpposite()) == 1) {
                wrath++;
                worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                return;
            }
            else if(ic.canOutputTo(current.getOpposite()) && sloth < 64 && special < Config.wrathCost && wrath < Config.wrathCost
                && ic.getEssentiaType(current.getOpposite()) == DarkAspects.SLOTH && ic.getEssentiaAmount(current.getOpposite()) > 0 && ic.takeEssentia(DarkAspects.SLOTH, 1, current.getOpposite()) == 1) {
                sloth++;
                worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
                return;
            }
        }
    }
}
 
开发者ID:SpitefulFox,项目名称:ForbiddenMagic,代码行数:29,代码来源:TileEntityWrathCage.java


注:本文中的thaumcraft.api.ThaumcraftApiHelper.getConnectableTile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。