本文整理汇总了Java中micdoodle8.mods.galacticraft.api.vector.BlockVec3类的典型用法代码示例。如果您正苦于以下问题:Java BlockVec3类的具体用法?Java BlockVec3怎么用?Java BlockVec3使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockVec3类属于micdoodle8.mods.galacticraft.api.vector包,在下文中一共展示了BlockVec3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public void onCreate(BlockVec3 placedPosition)
{
this.mainBlockPosition = placedPosition;
this.markDirty();
int buildHeight = this.worldObj.getHeight() - 1;
for (int y = 0; y < 3; y++)
{
if (placedPosition.y + y > buildHeight) return;
final BlockVec3 vecToAdd = new BlockVec3(placedPosition.x, placedPosition.y + y, placedPosition.z);
if (!vecToAdd.equals(placedPosition))
{
((BlockMulti) GCBlocks.fakeBlock).makeFakeBlock(this.worldObj, vecToAdd, placedPosition, 5);
}
}
}
示例2: injectEnergyUnits
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@VersionSpecific(version = "[1.7.2]")
@RuntimeInterface(clazz = "ic2.api.energy.tile.IEnergySink", modID = "IC2")
public double injectEnergyUnits(ForgeDirection directionFrom, double amount)
{
TileEntity tile = new BlockVec3(this).getTileEntityOnSide(this.worldObj, directionFrom);
int tier = 1;
if (tile instanceof IEnergySource && ((IEnergySource) tile).getOfferedEnergy() >= 128)
{
tier = 2;
}
float convertedEnergy = (float) amount * EnergyConfigHandler.IC2_RATIO;
float surplus = this.getNetwork().produce(convertedEnergy, true, tier, this, tile);
if (surplus >= 0.001F)
{
this.IC2surplusJoules = surplus;
}
else
{
this.IC2surplusJoules = 0F;
}
return 0D;
}
示例3: onCreate
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public void onCreate(BlockVec3 placedPosition)
{
int buildHeight = this.worldObj.getHeight() - 1;
for (int y = 0; y < 3; y += 2)
{
if (placedPosition.y + y > buildHeight) return;
for (int x = -1; x <= 1; x++)
{
for (int z = -1; z <= 1; z++)
{
final BlockVec3 vecToAdd = new BlockVec3(placedPosition.x + x, placedPosition.y + y, placedPosition.z + z);
if (!vecToAdd.equals(placedPosition))
{
((BlockTelepadFake) AsteroidBlocks.fakeTelepad).makeFakeBlock(this.worldObj, vecToAdd, placedPosition, y == 0 ? 1 : 0);
}
}
}
}
}
示例4: spawnMiner
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
public boolean spawnMiner(EntityPlayerMP player)
{
if (this.isMaster)
{
if (this.linkedMiner != null)
{
if (this.linkedMiner.isDead)
this.unlinkMiner();
}
if (this.linkedMinerID == null)
{
if (EntityAstroMiner.spawnMinerAtBase(this.worldObj, this.xCoord + 1, this.yCoord + 1, this.zCoord + 1, (this.facing + 2) ^ 1, new BlockVec3(this), player))
{
this.findTargetPoints();
return true;
}
}
return false;
}
TileEntityMinerBase master = this.getMaster();
if (master != null)
{
return master.spawnMiner(player);
}
return false;
}
示例5: checkTorchHasOxygen
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
public static boolean checkTorchHasOxygen(World world, Block block, int x, int y, int z)
{
if (OxygenUtil.inOxygenBubble(world, x + 0.5D, y + 0.6D, z + 0.5D)) return true;
OxygenUtil.checked = new HashSet();
BlockVec3 vec = new BlockVec3(x, y, z);
for (int side = 0; side < 6; side++)
{
BlockVec3 sidevec = vec.newVecSide(side);
Block newblock = sidevec.getBlockID_noChunkLoad(world);
if (OxygenUtil.testContactWithBreathableAir(world, newblock, sidevec.x, sidevec.y, sidevec.z, 1) >= 0)
{
return true;
}
}
return false;
}
示例6: getProvide
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public float getProvide(ForgeDirection direction)
{
if (direction == ForgeDirection.UNKNOWN && EnergyConfigHandler.isIndustrialCraft2Loaded())
{
TileEntity tile = new BlockVec3(this).getTileEntityOnSide(this.worldObj, this.getElectricalOutputDirectionMain());
if (tile instanceof IConductor)
{
//No power provide to IC2 mod if it's a Galacticraft wire on the output. Galacticraft network will provide the power.
return 0.0F;
}
}
if (this.getElectricalOutputDirections().contains(direction))
{
return this.storage.extractEnergyGC(Float.MAX_VALUE, true);
}
return 0F;
}
示例7: getBedDirection
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public int getBedDirection(IBlockAccess world, int x, int y, int z)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TileEntityMulti)
{
BlockVec3 mainBlockPosition = ((TileEntityMulti) tileEntity).mainBlockPosition;
if (mainBlockPosition != null)
{
return mainBlockPosition.getBlock(world).getBedDirection(world, mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z);
}
}
return BlockDirectional.getDirection(world.getBlockMetadata(x, y, z));
}
示例8: onNeighborBlockChange
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
/**
* Lets the block know when one of its neighbor changes. Doesn't know which
* neighbor changed (coordinates passed are their own) Args: x, y, z,
* neighbor blockID
*/
@Override
public void onNeighborBlockChange(World par1World, int x, int y, int z, Block par5)
{
final int side = par1World.getBlockMetadata(x, y, z);
BlockVec3 thisvec = new BlockVec3(x, y, z);
if (thisvec.blockOnSideHasSolidFace(par1World, side))
{
return;
}
this.dropBlockAsItem(par1World, x, y, z, 0, 0);
par1World.setBlock(x, y, z, Blocks.air);
}
示例9: resetMainBlockPosition
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
private void resetMainBlockPosition()
{
for (int y = -2; y < 1; y += 2)
{
for (int x = -1; x <= 1; x++)
{
for (int z = -1; z <= 1; z++)
{
final BlockVec3 vecToCheck = new BlockVec3(this.xCoord + x, this.yCoord + y, this.zCoord + z);
if (vecToCheck.getTileEntity(this.worldObj) instanceof TileEntityShortRangeTelepad)
{
this.setMainBlock(vecToCheck);
return;
}
}
}
}
}
示例10: getBlockHardness
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public float getBlockHardness(World par1World, int par2, int par3, int par4)
{
TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4);
if (tileEntity instanceof TileEntityTelepadFake)
{
BlockVec3 mainBlockPosition = ((TileEntityTelepadFake) tileEntity).mainBlockPosition;
if (mainBlockPosition != null)
{
return mainBlockPosition.getBlock(par1World).getBlockHardness(par1World, par2, par3, par4);
}
}
return this.blockHardness;
}
示例11: getPickBlock
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
BlockVec3 mainBlockPosition = ((TileEntityTelepadFake) tileEntity).mainBlockPosition;
if (mainBlockPosition != null)
{
Block mainBlockID = world.getBlock(mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z);
if (Blocks.air != mainBlockID)
{
return mainBlockID.getPickBlock(target, world, mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z);
}
}
return null;
}
示例12: addHitEffects
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addHitEffects(World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer)
{
if (worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ) == 6)
{
return true;
}
TileEntity tileEntity = worldObj.getTileEntity(target.blockX, target.blockY, target.blockZ);
if (tileEntity instanceof TileEntityTelepadFake)
{
BlockVec3 mainBlockPosition = ((TileEntityTelepadFake) tileEntity).mainBlockPosition;
if (mainBlockPosition != null)
{
effectRenderer.addBlockHitEffects(mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z, target);
}
}
return super.addHitEffects(worldObj, target, effectRenderer);
}
示例13: getPickBlock
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TileEntityMulti)
{
BlockVec3 mainBlockPosition = ((TileEntityMulti) tileEntity).mainBlockPosition;
if (mainBlockPosition != null)
{
Block mainBlockID = world.getBlock(mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z);
if (Blocks.air != mainBlockID)
{
return mainBlockID.getPickBlock(target, world, mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z);
}
}
}
return null;
}
示例14: tryBlockClient
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
private boolean tryBlockClient(int x, int y, int z)
{
BlockVec3 bv = new BlockVec3(x, y, z);
if (this.laserBlocks.contains(bv)) return false;
//Add minable blocks to the laser fx list
Block b = this.worldObj.getBlock(x, y, z);
if (b.getMaterial() == Material.air) return false;
if (noMineList.contains(b)) return true;
if (b instanceof BlockLiquid) return false;
if (b instanceof IFluidBlock) return false;
if (b instanceof IPlantable) return true;
int meta = this.worldObj.getBlockMetadata(x, y, z);
if (b.hasTileEntity(meta) || b.getBlockHardness(this.worldObj, x, y, z) < 0) return true;
if (this.tryBlockLimit == 0) return false;
this.tryBlockLimit--;
this.laserBlocks.add(bv);
this.laserTimes.add(this.ticksExisted);
return false;
}
示例15: isBed
import micdoodle8.mods.galacticraft.api.vector.BlockVec3; //导入依赖的package包/类
@Override
public boolean isBed(IBlockAccess world, int x, int y, int z, EntityLivingBase player)
{
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TileEntityMulti)
{
BlockVec3 mainBlockPosition = ((TileEntityMulti) tileEntity).mainBlockPosition;
if (mainBlockPosition != null)
{
return mainBlockPosition.getBlock(world).isBed(world, mainBlockPosition.x, mainBlockPosition.y, mainBlockPosition.z, player);
}
}
return super.isBed(world, x, y, z, player);
}