當前位置: 首頁>>代碼示例>>Java>>正文


Java ILandingPadAttachable類代碼示例

本文整理匯總了Java中micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable的典型用法代碼示例。如果您正苦於以下問題:Java ILandingPadAttachable類的具體用法?Java ILandingPadAttachable怎麽用?Java ILandingPadAttachable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ILandingPadAttachable類屬於micdoodle8.mods.galacticraft.api.tile包,在下文中一共展示了ILandingPadAttachable類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getConnectedTiles

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
@Override
public HashSet<ILandingPadAttachable> getConnectedTiles()
{
    HashSet<ILandingPadAttachable> connectedTiles = new HashSet<ILandingPadAttachable>();

    for (int x = -2; x < 3; x++)
    {
        for (int z = -2; z < 3; z++)
        {
            if (x == -2 || x == 2 || z == -2 || z == 2)
            {
                if (Math.abs(x) != Math.abs(z))
                {
                    final TileEntity tile = this.worldObj.getTileEntity(this.xCoord + x, this.yCoord, this.zCoord + z);

                    if (tile != null && tile instanceof ILandingPadAttachable && ((ILandingPadAttachable) tile).canAttachToLandingPad(this.worldObj, this.xCoord, this.yCoord, this.zCoord))
                    {
                        connectedTiles.add((ILandingPadAttachable) tile);
                    }
                }
            }
        }
    }

    return connectedTiles;
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:27,代碼來源:TileEntityBuggyFueler.java

示例2: onLandingPadRemoved

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
@SubscribeEvent
public void onLandingPadRemoved(EventLandingPadRemoval event)
{
    TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);

    if (tile instanceof IFuelDock)
    {
        IFuelDock dock = (IFuelDock) tile;

        TileEntityLaunchController launchController = null;

        for (ILandingPadAttachable connectedTile : dock.getConnectedTiles())
        {
            if (connectedTile instanceof TileEntityLaunchController)
            {
                launchController = (TileEntityLaunchController) event.world.getTileEntity(((TileEntityLaunchController) connectedTile).xCoord, ((TileEntityLaunchController) connectedTile).yCoord, ((TileEntityLaunchController) connectedTile).zCoord);
                break;
            }
        }

        if (launchController != null)
        {
            if (!launchController.getDisabled(0) && launchController.getEnergyStoredGC() > 0.0F)
            {
                event.allow = !launchController.launchPadRemovalDisabled;
            }
        }
    }
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:30,代碼來源:EventHandlerMars.java

示例3: isBlockAttachable

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
@Override
public boolean isBlockAttachable(IBlockAccess world, int x, int y, int z)
{
    TileEntity tile = world.getTileEntity(x, y, z);

    if (tile != null && tile instanceof ILandingPadAttachable)
    {
        return ((ILandingPadAttachable) tile).canAttachToLandingPad(world, this.xCoord, this.yCoord, this.zCoord);
    }

    return false;
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:13,代碼來源:TileEntityBuggyFueler.java

示例4: getConnectedTiles

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
@Override
public HashSet<ILandingPadAttachable> getConnectedTiles()
{
    HashSet<ILandingPadAttachable> connectedTiles = new HashSet<ILandingPadAttachable>();

    for (int x = -2; x < 3; x++)
    {
        for (int z = -2; z < 3; z++)
        {
            if (x == -2 || x == 2 || z == -2 || z == 2)
            {
                if (Math.abs(x) != Math.abs(z))
                {
                    final TileEntity tile = this.worldObj.getTileEntity(this.xCoord + x, this.yCoord, this.zCoord + z);

                    if (tile != null && tile instanceof ILandingPadAttachable && ((ILandingPadAttachable) tile).canAttachToLandingPad(this.worldObj, this.xCoord, this.yCoord, this.zCoord))
                    {
                        connectedTiles.add((ILandingPadAttachable) tile);
                        if (GalacticraftCore.isPlanetsLoaded && tile instanceof TileEntityLaunchController)
                        	((TileEntityLaunchController) tile).setAttachedPad(this);
                    }
                }
            }
        }
    }

    return connectedTiles;
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:29,代碼來源:TileEntityLandingPad.java

示例5: checkTileAt

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
protected void checkTileAt(HashSet<ILandingPadAttachable> connectedTiles, int x, int y, int z) {
    final TileEntity tile = this.worldObj.getTileEntity(x, y, z);

    if (tile != null && tile instanceof ILandingPadAttachable && ((ILandingPadAttachable) tile).canAttachToLandingPad(this.worldObj, this.xCoord, this.yCoord, this.zCoord))
    {
        connectedTiles.add((ILandingPadAttachable) tile);
    }
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:9,代碼來源:TileEntityShuttleDock.java

示例6: getConnectedTiles

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
@Override
public HashSet<ILandingPadAttachable> getConnectedTiles() {
    HashSet<ILandingPadAttachable> connectedTiles = new HashSet<ILandingPadAttachable>();

    // check the blocks in a doorframe form around me
    // below
    checkTileAt(connectedTiles, xCoord, yCoord-1, zCoord);

    // above
    checkTileAt(connectedTiles, xCoord, yCoord+2, zCoord);

    // sides
    switch (this.getRotationMeta())
    {
    case 0: // -> +Z (the side which is towards the player)
    case 2: // -> -Z
        checkTileAt(connectedTiles, xCoord-1, yCoord, zCoord);
        checkTileAt(connectedTiles, xCoord+1, yCoord, zCoord);
        checkTileAt(connectedTiles, xCoord-1, yCoord+1, zCoord);
        checkTileAt(connectedTiles, xCoord+1, yCoord+1, zCoord);
        break;
    case 1: // -> -X
    case 3: // -> +X
        checkTileAt(connectedTiles, xCoord, yCoord, zCoord-1);
        checkTileAt(connectedTiles, xCoord, yCoord, zCoord+1);
        checkTileAt(connectedTiles, xCoord, yCoord+1, zCoord-1);
        checkTileAt(connectedTiles, xCoord, yCoord+1, zCoord+1);
        break;
    }
    // maybe do the edges, too?

    return connectedTiles;
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:34,代碼來源:TileEntityShuttleDock.java

示例7: isBlockAttachable

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
@Override
public boolean isBlockAttachable(IBlockAccess world, int x, int y, int z) {
    TileEntity tile = world.getTileEntity(x, y, z);
    // maybe prevent launch controllers from working here?
    if (tile != null && tile instanceof ILandingPadAttachable)
    {
        return ((ILandingPadAttachable) tile).canAttachToLandingPad(world, this.xCoord, this.yCoord, this.zCoord);
    }

    return false;
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:12,代碼來源:TileEntityShuttleDock.java

示例8: getConnectedTiles

import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable; //導入依賴的package包/類
@Override
public HashSet<ILandingPadAttachable> getConnectedTiles() {
    TileEntity main = getMainBlockTile();
    if(main instanceof IFuelDock) {
        return ((IFuelDock)main).getConnectedTiles();
    }

    return new HashSet<ILandingPadAttachable>();
}
 
開發者ID:katzenpapst,項目名稱:amunra,代碼行數:10,代碼來源:TileEntityShuttleDockFake.java


注:本文中的micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。