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