Search in sources :

Example 1 with PhysicsObject

use of ValkyrienWarfareBase.PhysicsManagement.PhysicsObject in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class BlockEtherCompressor method getBlockForce.

@Override
public Vector getBlockForce(World world, BlockPos pos, IBlockState state, Entity shipEntity, double secondsToApply) {
    PhysicsWrapperEntity wrapper = (PhysicsWrapperEntity) shipEntity;
    PhysicsObject obj = wrapper.wrapping;
    IBlockState controllerState = obj.VKChunkCache.getBlockState(pos);
    TileEntity worldTile = obj.VKChunkCache.getTileEntity(pos);
    if (worldTile == null) {
        return null;
    }
    if (worldTile instanceof TileEntityEtherCompressor) {
        TileEntityEtherCompressor engineTile = (TileEntityEtherCompressor) worldTile;
        return engineTile.getForceOutput(world, pos, state, wrapper, secondsToApply);
    }
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) IBlockState(net.minecraft.block.state.IBlockState) PhysicsWrapperEntity(ValkyrienWarfareBase.PhysicsManagement.PhysicsWrapperEntity) PhysicsObject(ValkyrienWarfareBase.PhysicsManagement.PhysicsObject)

Example 2 with PhysicsObject

use of ValkyrienWarfareBase.PhysicsManagement.PhysicsObject in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.

the class BlockBalloonBurner method getTileEntity.

private BalloonBurnerTileEntity getTileEntity(World world, BlockPos pos, IBlockState state, Entity shipEntity) {
    PhysicsWrapperEntity wrapper = (PhysicsWrapperEntity) shipEntity;
    PhysicsObject obj = wrapper.wrapping;
    IBlockState controllerState = obj.VKChunkCache.getBlockState(pos);
    TileEntity worldTile = obj.VKChunkCache.getTileEntity(pos);
    if (worldTile == null) {
        return null;
    }
    if (worldTile instanceof BalloonBurnerTileEntity) {
        BalloonBurnerTileEntity burnerTile = (BalloonBurnerTileEntity) worldTile;
        return burnerTile;
    }
    return null;
}
Also used : BalloonBurnerTileEntity(ValkyrienWarfareControl.TileEntity.BalloonBurnerTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) IBlockState(net.minecraft.block.state.IBlockState) PhysicsWrapperEntity(ValkyrienWarfareBase.PhysicsManagement.PhysicsWrapperEntity) BalloonBurnerTileEntity(ValkyrienWarfareControl.TileEntity.BalloonBurnerTileEntity) PhysicsObject(ValkyrienWarfareBase.PhysicsManagement.PhysicsObject)

Aggregations

PhysicsObject (ValkyrienWarfareBase.PhysicsManagement.PhysicsObject)2 PhysicsWrapperEntity (ValkyrienWarfareBase.PhysicsManagement.PhysicsWrapperEntity)2 IBlockState (net.minecraft.block.state.IBlockState)2 TileEntity (net.minecraft.tileentity.TileEntity)2 BalloonBurnerTileEntity (ValkyrienWarfareControl.TileEntity.BalloonBurnerTileEntity)1